Skip to content

Instantly share code, notes, and snippets.

@pawgajda-drs
Created September 5, 2025 13:57
Show Gist options
  • Save pawgajda-drs/45794c6090e1d14a838db0f32edc0f16 to your computer and use it in GitHub Desktop.
Save pawgajda-drs/45794c6090e1d14a838db0f32edc0f16 to your computer and use it in GitHub Desktop.
ingress-nginx with ModSecurity
apiVersion: v1
kind: ConfigMap
metadata:
name: modsecurity-plugins
data:
empty-after.conf: |
# no data
empty-before.conf: |
# no data
empty-config.conf: |
# no data
generic-rule-exculsions-before.conf: |
# ByPass RuleId=920350 for Health Checks
SecRule REQUEST_URI "^/health(z|status|check)$" \
"id:1000001,\
phase:1,\
pass,\
nolog,\
ctl:ruleRemoveById=920350"
basic-rules-before.conf: |
# Set allowed HTTP Methods (add RESTful APIs Methods)
SecAction \
"id:900200,\
phase:1,\
pass,\
t:none,\
nolog,\
tag:'OWASP_CRS',\
ver:'OWASP_CRS/4.15.0-dev',\
setvar:'tx.allowed_methods=GET HEAD POST OPTIONS PUT PATCH DELETE'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment