Skip to content

Commit ab3ad29

Browse files
author
Timothy MacDonald
committed
refactor: change to Fortinet messaging and branding
Signed-off-by: Timothy MacDonald <[email protected]>
1 parent b675d47 commit ab3ad29

File tree

11 files changed

+825
-633
lines changed

11 files changed

+825
-633
lines changed

assets/FortiCNAPP-info.png

147 KB
Loading

assets/Fortinet_logo.png

4.01 KB
Loading

assets/mainwindow.ui

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
14-
<string>Lacework Extensible Reporting</string>
14+
<string>FortiCNAPP Extensible Reporting</string>
1515
</property>
1616
<widget class="QWidget" name="centralwidget">
1717
<layout class="QHBoxLayout" name="horizontalLayout_9">
@@ -22,7 +22,7 @@
2222
<item>
2323
<spacer name="horizontalSpacer">
2424
<property name="orientation">
25-
<enum>Qt::Horizontal</enum>
25+
<enum>Qt::Orientation::Horizontal</enum>
2626
</property>
2727
<property name="sizeHint" stdset="0">
2828
<size>
@@ -56,7 +56,7 @@
5656
<item>
5757
<spacer name="horizontalSpacer_4">
5858
<property name="orientation">
59-
<enum>Qt::Horizontal</enum>
59+
<enum>Qt::Orientation::Horizontal</enum>
6060
</property>
6161
<property name="sizeHint" stdset="0">
6262
<size>
@@ -152,7 +152,7 @@
152152
<item>
153153
<widget class="Line" name="line">
154154
<property name="orientation">
155-
<enum>Qt::Vertical</enum>
155+
<enum>Qt::Orientation::Vertical</enum>
156156
</property>
157157
</widget>
158158
</item>
@@ -217,7 +217,7 @@
217217
<item>
218218
<widget class="Line" name="line_2">
219219
<property name="orientation">
220-
<enum>Qt::Vertical</enum>
220+
<enum>Qt::Orientation::Vertical</enum>
221221
</property>
222222
</widget>
223223
</item>
@@ -262,7 +262,7 @@
262262
<item>
263263
<spacer name="horizontalSpacer_3">
264264
<property name="orientation">
265-
<enum>Qt::Horizontal</enum>
265+
<enum>Qt::Orientation::Horizontal</enum>
266266
</property>
267267
<property name="sizeHint" stdset="0">
268268
<size>
@@ -303,7 +303,7 @@
303303
<item>
304304
<spacer name="horizontalSpacer_2">
305305
<property name="orientation">
306-
<enum>Qt::Horizontal</enum>
306+
<enum>Qt::Orientation::Horizontal</enum>
307307
</property>
308308
<property name="sizeHint" stdset="0">
309309
<size>
@@ -332,7 +332,7 @@
332332
<x>0</x>
333333
<y>0</y>
334334
<width>1049</width>
335-
<height>29</height>
335+
<height>24</height>
336336
</rect>
337337
</property>
338338
</widget>

modules/gui_main.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
class ReportPreview(QMainWindow):
1414

15+
16+
1517
def __init__(self):
1618
super().__init__()
1719
self.web_viewer = QWebEngineView()
@@ -40,7 +42,6 @@ def save_pdf(self, path):
4042
self.web_viewer.page().printToPdf(path)
4143

4244

43-
4445
class ErrorDialog(QMessageBox):
4546
def __init__(self, message):
4647
super().__init__()
@@ -78,8 +79,9 @@ def __init__(self, args, pre_processed_args, available_reports, basedir):
7879
else:
7980
self.window.lineEditCustomLogo.text = "None"
8081
self.report_preview = ReportPreview()
81-
self.connect_ui_elements()
82+
8283
self.populate_fields_from_args()
84+
self.connect_ui_elements()
8385
self.window.show()
8486

8587

@@ -159,6 +161,16 @@ def toggle_preview(self):
159161
def populate_fields_from_args(self):
160162
for available_report in self.available_reports:
161163
self.window.comboBoxReportSelector.addItem(available_report['report_name'])
164+
#print(str(self.args.report))
165+
selected_report_name = [report['report_name'] for report in self.available_reports if report['report_short_name'] == self.args.report][0]
166+
#print(selected_report_name)
167+
# Could not get comboBoxReportSelector.setCurrentIndex to work. Switching to setCurrentText
168+
report_index = self.window.comboBoxReportSelector.findText(str(selected_report_name))
169+
# print(report_index)
170+
# print(type(self.window.comboBoxReportSelector))
171+
self.window.comboBoxReportSelector.setCurrentIndex(report_index)
172+
#self.window.comboBoxReportSelector.setCurrentText(selected_report_name)
173+
162174
if self.args.cache_data:
163175
self.window.checkBoxUseCache.setCheckState(Qt.Checked)
164176
self.window.lineEditCustomer.text = self.args.customer

modules/process_args.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ def get_arguments():
5252

5353

5454
parser.add_argument("--report-path", type=str, help="Filename to save report")
55-
parser.add_argument("--author", help="Author of report", type=str, default="John Doe")
56-
parser.add_argument("--customer", help="Customer Name (Company)", type=str, default="Some Company")
55+
parser.add_argument("--author", help="Author of report", type=str, default="Fortinet")
56+
parser.add_argument("--customer", help="Customer Name (Company)", type=str, default="customer")
5757
parser.add_argument("--cache-data", help="Create/use locally cached copies of Lacework data. This is mainly used for dev testing.", action='store_true')
5858
parser.add_argument("--vulns-start-time", type=str,
5959
help="The number of days and hours in the past relative to NOW to start the vulnerability report. In the format <D:H>",
@@ -71,7 +71,7 @@ def get_arguments():
7171
help="Read your credentials from an API key file downloaded from the Lacework UI (JSON formatted).")
7272
parser.add_argument("--v", help="Set Verbose Logging", action='store_true')
7373
parser.add_argument("--vv", help="Set Extremely Verbose Logging", action='store_true')
74-
parser.add_argument("--report", help="Choose which report to execute. Default is 'CSA'", default="CSA")
74+
parser.add_argument("--report", help="Choose which report to execute. Default is 'CSA_Detailed'", default="CSA_Detailed")
7575
parser.add_argument("--report-format", help="Specify output format, HTML or PDF. Default is HTML", default="HTML")
7676
parser.add_argument("--gui", help="Run this tool in GUI mode, which provides additional customization options.", action='store_true')
7777
parser.add_argument("--logo", type=str, help="Specify a custom logo (PNG file) to add to the report.")
@@ -133,7 +133,7 @@ def pre_process_args(args, available_reports):
133133
if args.list_reports:
134134
print(f'\nAvailable Reports (use the "ID" with the "--report" flag to specify one):\n')
135135
for available_report in available_reports:
136-
print(f"{'(*Default) ' if available_report['report_short_name'] == 'CSA' else ''}ID:{available_report['report_short_name']}", end=" ")
136+
print(f"{'(*Default) ' if available_report['report_short_name'] == 'CSA_Detailed' else ''}ID:{available_report['report_short_name']}", end=" ")
137137
print(f"Name:{available_report['report_name']}", end=" ")
138138
print(f"Description: {available_report['report_description']}")
139139
print('')

modules/reports/reportgen_csa.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@ class ReportGenCSA(ReportGen):
66

77
report_short_name = 'CSA'
88
report_name = 'Cloud Security Assessment (CIS)'
9-
report_description = "This is the Lacework provided Cloud Security Assessment with CIS compliance reporting."
9+
report_description = "This is the FortiCNAPP provided Cloud Security Assessment with CIS compliance reporting."
1010
default_recommendations = """<h3>Recommendations</h3>
1111
<p>
12-
Based on the findings of this assessment, Lacework recommends the following action plan and next steps:
12+
Based on the findings of this assessment, Fortinet recommends the following action plan and next steps:
1313
</p>
1414
<ol>
15-
<li>Engage with your Lacework account team and partner to review services offerings to prioritize and remediate the findings</li>
16-
<li>Complete a recurring Cloud Security Assessment once a wider Lacework deployment has been completed to baseline and trend improvements to your cloud security posture.</li>
15+
<li>Engage with your Fortinet account team and partner to review services offerings to prioritize and remediate the findings</li>
16+
<li>Complete a recurring Cloud Security Assessment once a wider FortiCNAPP deployment has been completed to baseline and trend improvements to your cloud security posture.</li>
1717
</ol>"""
1818

1919
def __init__(self, basedir, use_cache=False, api_key_file=None, graph_scale=1):
2020
super().__init__(basedir, use_cache=use_cache, api_key_file=api_key_file, graph_scale=graph_scale)
2121
self.recommendations = self.default_recommendations
2222
self.template = self.get_jinja2_template('csa_report.jinja2')
23-
self.polygraph_graphic_html = self.file_to_image_tag('assets/polygraph-info.png', 'png')
23+
self.company_logo_html = self.file_to_image_tag('assets/Fortinet_logo.png', 'png')
24+
self.polygraph_graphic_html = self.file_to_image_tag('assets/FortiCNAPP-info.png', 'png')
2425

2526
def gather_data(self,
2627
vulns_start_time: LaceworkTime,

modules/reports/reportgen_csa_detailed.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ class ReportGenCSADetailed(ReportGen):
66

77
report_short_name = 'CSA_Detailed'
88
report_name = 'Detailed Cloud Security Assessment (CIS)'
9-
report_description = "This is the detailed version of the Lacework Cloud Security Assessment with CIS compliance reporting."
9+
report_description = "This is the detailed version of the FortiCNAPP Cloud Security Assessment with CIS compliance reporting."
1010
default_recommendations = """<h2>Recommendations</h2>
1111
<p>
12-
Based on the findings of this assessment, Lacework recommends the following action plan and next steps:
12+
Based on the findings of this assessment, Fortinet recommends the following action plan and next steps:
1313
</p>
1414
<ol>
15-
<li>Engage with your Lacework account team and partner to review services offerings to prioritize and remediate the findings</li>
16-
<li>Complete a recurring Cloud Security Assessment once a wider Lacework deployment has been completed to baseline and trend improvements to your cloud security posture.</li>
15+
<li>Engage with your Fortinet account team and partner to review services offerings to prioritize and remediate the findings</li>
16+
<li>Complete a recurring Cloud Security Assessment once a wider FortiCNAPP deployment has been completed to baseline and trend improvements to your cloud security posture.</li>
1717
</ol>"""
1818

1919
def __init__(self, basedir, use_cache=False, api_key_file=None, graph_scale=1):
2020
super().__init__(basedir, use_cache=use_cache, api_key_file=api_key_file, graph_scale=graph_scale)
2121
self.recommendations = self.default_recommendations
2222
self.template = self.get_jinja2_template('csa_detailed_report.jinja2')
23-
self.polygraph_graphic_html = self.file_to_image_tag('assets/polygraph-info.png', 'png')
23+
self.company_logo_html = self.file_to_image_tag('assets/Fortinet_logo.png', 'png')
24+
self.polygraph_graphic_html = self.file_to_image_tag('assets/FortiCNAPP-info.png', 'png')
2425

2526
def gather_data(self,
2627
vulns_start_time: LaceworkTime,
2728
vulns_end_time: LaceworkTime,
2829
alerts_start_time: LaceworkTime,
2930
alerts_end_time: LaceworkTime):
3031

31-
3232
self.aws_compliance_data=self.gather_compliance_data(cloud_provider='AWS')
3333
self.azure_compliance_data=self.gather_compliance_data(cloud_provider='AZURE')
3434
self.gcp_compliance_data=self.gather_compliance_data(cloud_provider='GCP')
@@ -46,6 +46,7 @@ def render(self, customer, author, pagesize="a3", custom_logo=None):
4646
customer=str(customer),
4747
date=self.get_current_date(),
4848
author=str(author),
49+
company_logo_html=self.company_logo_html,
4950
custom_logo_html=self.custom_logo_html,
5051
polygraph_graphic_html=self.polygraph_graphic_html,
5152
aws_compliance_data=self.aws_compliance_data,

0 commit comments

Comments
 (0)