From 876bb7e8e0edc20cf7c3dbb8a29dd3260f2a15eb Mon Sep 17 00:00:00 2001 From: gbucchino Date: Wed, 20 Sep 2023 10:49:31 +0200 Subject: [PATCH] Auditing apache indexes --- core/plugins/apache.py | 7 ++++--- reports/templates/apache-signature.html.j2 | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/plugins/apache.py b/core/plugins/apache.py index 0cc0d77..bdc68ac 100644 --- a/core/plugins/apache.py +++ b/core/plugins/apache.py @@ -132,7 +132,7 @@ class Apache: else: self._reports["signature"]["audit"] = False - self._reports["signature"]["audit"] = \ + self._reports["signature"]["msg"] = \ f"The file {path} do not exist" def _parsingApacheConfigForSignature(self, fdata) -> dict: @@ -184,7 +184,7 @@ class Apache: self._parsingApacheConfig(fdata) else: self._reports["indexes"]["audit"] = False - self._reports["indexes"]["audit"] = \ + self._reports["indexes"]["msg"] = \ f"The file {path} do not exist" def _parsingApacheConfig(self, fdata) -> dict: @@ -240,7 +240,7 @@ class Apache: ) if grOption: optsFound.append(opt) - + # We can check if you found the options if len(optsFound) == len(self._indexes['options']): report["directories"][directory]["result"] = "success" @@ -251,6 +251,7 @@ class Apache: report["directories"][directory]["options"].append( f"{opt} is not removed. You should disable it" ) + optsFound.clear() report["audit"] = True report["description"] = self._indexes["description"] diff --git a/reports/templates/apache-signature.html.j2 b/reports/templates/apache-signature.html.j2 index 970b174..15e1d66 100644 --- a/reports/templates/apache-signature.html.j2 +++ b/reports/templates/apache-signature.html.j2 @@ -34,5 +34,5 @@ {% endfor %} {% else %} - {{ data['apache']['msg'] }} + {{ data['apache']['signature']['msg'] }} {% endif %}