diff --git a/audit/system/plugins/grub.py b/audit/system/plugins/grub.py index c7705a4..174fdd7 100644 --- a/audit/system/plugins/grub.py +++ b/audit/system/plugins/grub.py @@ -5,4 +5,5 @@ def grub() -> dict: grub['description'] = 'Change boot permission' grub['filename'] = '/boot/grub/grub.cfg' grub['value'] = 0o600 + grub['resolve'] = 'chmod 600 /boot/grub/grub.cfg' return grub diff --git a/core/plugins/grub.py b/core/plugins/grub.py index d5e6849..e82921b 100644 --- a/core/plugins/grub.py +++ b/core/plugins/grub.py @@ -29,10 +29,11 @@ class Grub: if permission != oct(self._object['value']): self._reports['result'] = 'failed' + self._reports['resolve'] = self._object['resolve'] else: self._reports['result'] = 'success' self._reports['description'] = self._object['description'] - self._reports['recommand_value'] = self._object['value'] + self._reports['current_value'] = permission[2:] except FileNotFoundError: self._reports['grub']['error'] = \ f'File {path} not found' diff --git a/core/report.py b/core/report.py index b89161a..c2adcc5 100644 --- a/core/report.py +++ b/core/report.py @@ -53,8 +53,6 @@ def generateHtmlReport(data): if 'grub' in data['system']: dataJinja2['grub'] = data['system']['grub'] dataJinja2['grub']['accordion-id'] = f"accordion-grub-1" - #_generateAccordion(dataJinja2['grub'], 'grub') - print(dataJinja2['grub']) dataJinja2['year'] = '2023' dataJinja2['hostname'] = data['hostname'] diff --git a/reports/templates/grub.html.j2 b/reports/templates/grub.html.j2 index 1c6d49d..3e909ad 100644 --- a/reports/templates/grub.html.j2 +++ b/reports/templates/grub.html.j2 @@ -16,19 +16,20 @@
{{ data['grub']['description'] }}.
{% if data['grub']['result'] == 'success' %} -
-
-

-                {{ data['grub']['recommand_value'] }}
-	            
-
-
- {% else %} - For resolving the issue, add this line in the {{ data['filename'] }} profile: + Your current permission of this file:

- 	        {{ data['grub']['recommand_value'] }}
+            {{ data['grub']['current_value'] }}
+	        
+
+
+ {% else %} + For resolving the issue, change the permission of the file: +
+
+

+ 	        {{ data['grub']['resolve'] }}