Skip to content

Commit

Permalink
Fix kubernetes#4629 - (and ((not false) false)) = true
Browse files Browse the repository at this point in the history
somehow, this is weird but true. Previously, either owasp was disabled globally and rendered in all locations, or it was enabled globally. This commit fixes the logic issue by fixing the and-clause in the if-statement. This reduces baseline global modsecurity-enabled resource usage.
  • Loading branch information
MMeent authored Nov 28, 2019
1 parent de12fc1 commit 44c55ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ stream {
modsecurity_rules '
{{ $location.ModSecurity.Snippet }}
';
{{ else if (and ((not $all.Cfg.EnableOWASPCoreRules) $location.ModSecurity.OWASPRules))}}
{{ else if (and (not $all.Cfg.EnableOWASPCoreRules) ($location.ModSecurity.OWASPRules))}}
modsecurity_rules_file /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf;
{{ end }}

Expand Down

0 comments on commit 44c55ae

Please sign in to comment.