modsecurity:configure_mod_security
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
modsecurity:configure_mod_security [2016/10/14 13:31] – created peter | modsecurity:configure_mod_security [2019/11/30 14:16] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ModSecurity - Configure mod_security ====== | ||
- | |||
- | Out of the box, modsecurity doesn' | ||
- | |||
- | nano / | ||
- | Find this line | ||
- | |||
- | SecRuleEngine DetectionOnly | ||
- | and change it to: | ||
- | |||
- | SecRuleEngine On | ||
- | If you're trying this out on a production server, change this directive only after testing all your rules. | ||
- | |||
- | Another directive to modify is SecResponseBodyAccess. This configures whether response bodies are buffered (i.e. read by modsecurity). This is only neccessary if data leakage detection and protection is required. Therefore, leaving it On will use up droplet resources and also increase the logfile size. | ||
- | |||
- | Find this | ||
- | |||
- | SecResponseBodyAccess On | ||
- | and change it to: | ||
- | |||
- | SecResponseBodyAccess Off | ||
- | Now we'll limit the maximum data that can be posted to your web application. Two directives configure these: | ||
- | |||
- | SecRequestBodyLimit | ||
- | SecRequestBodyNoFilesLimit | ||
- | The SecRequestBodyLimit directive specifies the maximum POST data size. If anything larger is sent by a client the server will respond with a 413 Request Entity Too Large error. If your web application doesn' | ||
- | |||
- | The value mentioned in the configuration file is | ||
- | |||
- | SecRequestBodyLimit 13107200 | ||
- | which is 12.5MB. | ||
- | |||
- | Similar to this is the SecRequestBodyNoFilesLimit directive. The only difference is that this directive limits the size of POST data minus file uploads-- this value should be "as low as practical." | ||
- | |||
- | The value in the configuration file is | ||
- | |||
- | SecRequestBodyNoFilesLimit 131072 | ||
- | which is 128KB. | ||
- | |||
- | Along the lines of these directives is another one which affects server performance: | ||
- | |||
- | SecRequestBodyInMemoryLimit 131072 | ||
- | This is the value (128KB) specified in the configuration file. | ||
- | |||
- | |||
- | |||
- | |||
- | ===== References ===== | ||
- | |||
- | https:// | ||
modsecurity/configure_mod_security.1476451883.txt.gz · Last modified: 2020/07/15 09:30 (external edit)