Skip to content

Instantly share code, notes, and snippets.

@anunay
Last active December 9, 2022 14:08
Show Gist options
  • Save anunay/5376902 to your computer and use it in GitHub Desktop.
Save anunay/5376902 to your computer and use it in GitHub Desktop.
Whitelist IP in ModSecurity (whitelist.conf)
##Whitelist IP in ModSecurity
#1. If you need to whitelist an IP in ModSecurity (v2.7+), here’s what to do:
nano /usr/local/apache/conf/modsec2/whitelist.conf
#2. add this line, replacing (#####) with a unique ID number for mod security, I used a version of my whitelisted ip address:
SecRule REMOTE_ADDR "@ipMatch 1.2.3.4" "phase:1,t:none,nolog,allow,ctl:ruleEngine=Off,ctl:auditEngine=Off,id:(#####)"
#3. Then restart apache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment