From 9d38eca40fe615a4c756500ca57b05634240edde Mon Sep 17 00:00:00 2001 From: besha100 Date: Wed, 15 Dec 2021 23:00:24 +0100 Subject: [PATCH] Fixed the default config condition in ingress controller template --- internal/ingress/controller/template/template.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/ingress/controller/template/template.go b/internal/ingress/controller/template/template.go index 5db9fd3ec..e5be1490a 100644 --- a/internal/ingress/controller/template/template.go +++ b/internal/ingress/controller/template/template.go @@ -1537,6 +1537,11 @@ func buildModSecurityForLocation(cfg config.Configuration, location *ingress.Loc `, location.ModSecurity.TransactionID)) } + if !isMSEnabled && location.ModSecurity.Snippet == "" { + buffer.WriteString(`modsecurity_rules_file /etc/nginx/modsecurity/modsecurity.conf; +`) + } + if !cfg.EnableOWASPCoreRules && location.ModSecurity.OWASPRules { buffer.WriteString(`modsecurity_rules_file /etc/nginx/owasp-modsecurity-crs/nginx-modsecurity.conf; `)