From b3654d50c8ad0775df5ff97d5958a1aa129d4ac0 Mon Sep 17 00:00:00 2001 From: geoffrey Date: Tue, 13 Jun 2023 20:18:34 +0200 Subject: [PATCH] Update report --- core/main.py | 1 - core/report.py | 13 +++++++++-- reports/templates/postfix.html.j2 | 39 +++++++++++-------------------- reports/templates/sysctl.html.j2 | 17 ++++++++++++++ 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/core/main.py b/core/main.py index f2be5f5..c8a7a9e 100644 --- a/core/main.py +++ b/core/main.py @@ -45,7 +45,6 @@ def main(): if args.audit == "application": pass - print(report) generateHtmlReport(report) @Dispatcher.register_plugins diff --git a/core/report.py b/core/report.py index 53c1d4c..e1875d7 100644 --- a/core/report.py +++ b/core/report.py @@ -25,6 +25,17 @@ def generateHtmlReport(data): print(plugin) dataJinja2['plugins'].append(f"{plugin}.html.j2") + if 'postfix' in dataJinja2['plugins']: + pass + + if 'sysctl' in data['system']: + dataJinja2['sysctl'] = dict() + + for sysctl in data['system']['sysctl']['file']: + print(data['system']['sysctl']['file'][sysctl]) + + + dataJinja2['year'] = '2023' rdr = tmplIndex.render(data=dataJinja2) @@ -49,9 +60,7 @@ def generateHtmlReport(data): # body += f"Description: {result['description']}

" #body += f"

" - html += body #print(body) - html += "" with open(f"reports/reports_{today}.html", "w") as f: f.write(rdr) diff --git a/reports/templates/postfix.html.j2 b/reports/templates/postfix.html.j2 index 3e1498c..29601f0 100644 --- a/reports/templates/postfix.html.j2 +++ b/reports/templates/postfix.html.j2 @@ -1,29 +1,18 @@

Postfix

-
-
-

- -

-
-
- This is the first item's accordion body. It is shown by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
-
-
-

- -

-
-
- This is the second item's accordion body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the .accordion-body, though the transition does limit overflow. -
-
+{% for item in data['postfix'] %} +
+
+

+ +

+
+
+
- +
+
+{% endfor %} diff --git a/reports/templates/sysctl.html.j2 b/reports/templates/sysctl.html.j2 index 2413230..fb427a0 100644 --- a/reports/templates/sysctl.html.j2 +++ b/reports/templates/sysctl.html.j2 @@ -1 +1,18 @@

Sysctl

+ +{% for item in data['sysctl'] %} +
+
+

+ +

+
+
+ +
+
+
+
+{% endfor %}