Skip to content

Commit 158f8af

Browse files
author
Timothy MacDonald
committed
chore: update readme.md and requirements.txt
Signed-off-by: Timothy MacDonald <[email protected]>
1 parent 05e2086 commit 158f8af

File tree

3 files changed

+86
-92
lines changed

3 files changed

+86
-92
lines changed

README.md

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
## Description
44

5-
A project to abstract the gathering, transformations, and rendering of datasets from Lacework into auto-generated reports.
5+
A project to abstract the gathering, transformations, and rendering of datasets from Lacework FortiCNAPP into auto-generated reports.
66

7+
A sample report can be found [here](https://github.com/lacework/extensible-reporting/blob/main/Example-Report.pdf)
78
## Quickstart
89

9-
1. Download the binary for your platform from the releases section
10+
1. Download the binary for your platform from the [releases section](https://github.com/lacework/extensible-reporting/releases/latest)
1011

1112
2. Ensure you have some method of authenticating against your FortiCNAPP API. The easiest
1213
way is to download an API key file from your FortiCNAPP UI under Settings -> API Keys.
@@ -28,35 +29,24 @@ https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unknown-develope
2829

2930
## Usage for CSA Reports
3031

31-
This tool framework simplifies how partners and internal resources can execute Lacework Cloud Security Assessments to prospective customers. Below are a few example screenshots of the report that once generated is an html that can be modified and exported as a PDF and sent to prospects.
32-
33-
<img width="604" alt="image (1)" src="https://user-images.githubusercontent.com/10535862/196780720-f74c93d1-ebcb-42d4-930f-66d3c2a6571d.png">
34-
35-
<img width="604" src="https://user-images.githubusercontent.com/10535862/196780812-f546f58a-d40b-4e50-a119-38a0a6e3c656.png">
36-
37-
<img width="604" src="https://user-images.githubusercontent.com/10535862/196780860-a9cae2d1-e047-4b23-9d23-ade77c1d6de0.png">
38-
39-
<img width="604" src="https://user-images.githubusercontent.com/10535862/196780942-de7297c0-89ea-4cce-a6f8-ca712f4ea0ed.png">
40-
41-
42-
32+
This tool leverages the Lacework FortiCNAPP API to create HTML and PDF reports.
4333

4434
## Downloading and Setting up the Tool
4535

4636
### Option 1:
4737

48-
Use the compiled binary on the releases page. This is the easiest option as you do not need to install python3 and the required prerequisites through pip. To execute this binary:
49-
- Download the corresponding binary based on your computer's OS: https://github.com/lacework/extensible-reporting/releases/
38+
Use the compiled binary on the [releases page](https://github.com/lacework/extensible-reporting/releases/latest). This is the easiest option as you do not need to install python3 or any python libraries. To execute this binary:
39+
- Download the corresponding binary for your computer's OS from the [releases page](https://github.com/lacework/extensible-reporting/releases/latest)
40+
- If running on MacOS or Linux you will need to:
41+
1. Launch a terminal and execute `chmod +x lw_report_gen_mac` (replace "lw_report_gen_mac" with the name of the binary you downloaded)
42+
2. Execute the binary FROM THE TERMINAL with the -h flag to review the command line options. You will need to provide API credentials. Read the section below on how to specify credentials, or use download a FortiCNAPP JSON credentials file and specify it:
43+
`./lw_report_gen_mac --gui --api-key-file <instancename>.json`
44+
3. On Mac, If prompted to trust this code to execute in your terminal, navigate to `System Preferences -> Security & Privacy -> Privacy (tab)` and scroll to `Developer Tools` and ensure that `Terminal` is checked. You will then need to relaunch your Terminal session
5045

51-
- If running on MacOS you will need to:
52-
1. Launch a terminal and `chmod +x lw_report_gen_mac`
53-
2. If prompted to trust this code to execute in your terminal, navigate to `System Preferences -> Security & Privacy -> Privacy (tab)` and scroll to `Developer Tools` and ensure that `Terminal` is checked. You will then need to relaunch your Terminal session
54-
- Run the report: `./lw_report_gen_mac --author your_name --customer your_customer`
5546

5647
- If running on Windows you will need to:
57-
1. Launch a command prompt and run the report from the directory you downloaded it to `lw_report_gen.exe --author your_name --customer your_customer`
58-
59-
48+
1. Execute the binary FROM THE TERMINAL with the -h flag to review the command line options. You will need to provide API credentials. Read the section below on how to specify credentials, or use download a FortiCNAPP JSON credentials file and specify it:
49+
`lw_report_gen.exe --gui --api-key-file <instancename>.json`
6050

6151
The report will be generated in the same directory you execute the binary with a name of `CSA_Report_customer_date.html`
6252

@@ -76,44 +66,45 @@ $ pip3 install -r requirements.txt
7666

7767
On Windows or Linux run the script using the python interpreter:
7868
```
79-
python lw_report_gen.py --author your_name --customer your_customer
69+
python lw_report_gen.py --gui --api-key-file <instancename>.json
8070
```
8171
On a Mac you may need to specify "python3" instead of "python" ("python" references python 2, which won't work). so...
8272
```
83-
python3 lw_report_gen.py --author your_name --customer your_customer
73+
python3 lw_report_gen.py --gui --api-key-file <instancename>.json
8474
```
85-
Once the report is generated, you may edit the html with your own company logo or add in new content. From there, simply print as a PDF and your report is ready to be shared.
8675

87-
## GUI Mode
76+
## Command Line Mode
77+
78+
If you do not want to run this tool in gui mode omit the `--gui' command line flag. You will likely need to specify additional flags
79+
such as specifying the report format (pdf or html) `--report-format PDF`.
8880

89-
A new GUI mode has been added to the script. To run the script in GUI mode use the "--gui"
90-
command line flag.
81+
Run the tool with the `-h` flag to see a full list of options.
9182

92-
## Specifying a Lacework instance and credentials:
83+
## Specifying a Lacework FortiCNAPP instance and credentials:
9384

94-
You must have a valid Lacework API key for your Lacework instance to run this tool. You can read about creating and downloading
85+
You must have a valid Lacework FortiCNAPP API key for your Lacework FortiCNAPP instance to run this tool. You can read about creating and downloading
9586
an API key here:
9687

97-
https://docs.lacework.com/api/api-access-keys-and-tokens
88+
https://docs.fortinet.com/document/lacework-forticnapp/latest/api-reference/863111/about-the-lacework-forticnapp-api
9889

99-
Once you have created an API key There are three ways to specify the Lacework API instance/credentials used when generating a report:
90+
Once you have created an API key There are three ways to specify the Lacework FortiCNAPP API instance/credentials used when generating a report:
10091

101-
1. Install and configure the Lacework CLI to setup a credentials file which this tool will read.
92+
1. Install and configure the Lacework FortiCNAPP CLI to setup a credentials file which this tool will read.
10293
2. Specify a JSON file containing your API instance/credentials.
10394
3. Specify your credentials via variables.
10495

105-
### Method 1: Lacework CLI
106-
Though it is not required, you may wish to install and configure the Lacework CLI to create a .lacework.toml file containing your API credentials. Instructions to do so can be found here: https://docs.lacework.com/cli/
96+
### Method 1: Lacework FortiCNAPP CLI
97+
Though it is not required, you may wish to install and configure the Lacework FortiCNAPP CLI to create a .lacework.toml file containing your API credentials. Instructions to do so can be found here: https://docs.fortinet.com/document/lacework-forticnapp/latest/cli-reference/68020/get-started-with-the-lacework-forticnapp-cli
10798

10899
### Method 2: JSON File
109100

110-
You may download an API key JSON file from your Lacework instance (Settings > Configuration > API keys) and specify it using the ````"--api-key-file"```` command line
101+
You may download an API key JSON file from your Lacework FortiCNAPP instance (Settings > Configuration > API keys) and specify it using the ````"--api-key-file"```` command line
111102
parameter.
112103

113104
### Method 3: Environment Variables
114105

115-
If you wish to configure the LaceworkClient instance using environment variables, this tool honors the same
116-
variables used by the Lacework CLI. The `account`, `subaccount`, `api_key`, `api_secret`, and `profile` parameters
106+
If you wish to configure the Lacework FortiCNAPP Client instance using environment variables, this tool honors the same
107+
variables used by the Lacework FortiCNAPP CLI. The `account`, `subaccount`, `api_key`, `api_secret`, and `profile` parameters
117108
can all be configured as specified below.
118109

119110
| Environment Variable | Description | Required |
@@ -125,7 +116,7 @@ can all be configured as specified below.
125116
| `LW_API_SECRET` | Lacework API Access Secret | Y |
126117
## Query Time Ranges
127118

128-
By default the tool will query Lacework for data in the following time ranges:
119+
By default the tool will query Lacework FortiCNAPP for data in the following time ranges:
129120
```
130121
Vulnerability Data Start: 25 hours prior to execution time -> End : Current time at execution
131122
Alert Data Start Time: 7 days prior to execution time -> End: Current time at execution
@@ -153,7 +144,7 @@ Whereas to specify a 7 day window for alerts that starts 2 weeks in the past you
153144
## Cached Data
154145

155146
To simplify development and limit the API calls made to a provider's backend, the main CLI interface supports the `--cache-data` flag.
156-
If you are customizing this script you may wish to use this flag to speed up script execution during testing and eliminate most of the API calls to Lacework.
147+
If you are customizing this script you may wish to use this flag to speed up script execution during testing and eliminate most of the API calls to Lacework FortiCNAPP.
157148
Note that the cache files created the first time you use this flag will be used in all subsequent runs in which you use this flag. They will not expire.
158149
If you want to create new cache files you need to manually delete the cache files. For instance on Mac and Linux:
159150
```
@@ -193,7 +184,7 @@ put it in the `templates` folder. You can then reference this template in your c
193184

194185
## License and Copyright
195186

196-
Copyright 2022, Lacework Inc.
187+
Copyright 2025, Fortinet Inc.
197188

198189
```
199190
Licensed under the Apache License, Version 2.0 (the "License");

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pyinstaller = "^6.0.0"
3232
boto3 = "^1.26.0"
3333
poethepoet = "^0.24.0"
3434

35+
[tool.poetry.requires-plugins]
36+
poetry-plugin-export = ">=1.8"
37+
3538
[build-system]
3639
requires = ["poetry-core"]
3740
build-backend = "poetry.core.masonry.api"

requirements.txt

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
bleach==6.1.0 ; python_version >= "3.9" and python_version < "3.12"
2-
brotli==1.1.0 ; platform_python_implementation == "CPython" and python_version >= "3.9" and python_version < "3.12"
3-
brotlicffi==1.1.0.0 ; platform_python_implementation != "CPython" and python_version >= "3.9" and python_version < "3.12"
4-
certifi==2024.2.2 ; python_version >= "3.9" and python_version < "3.12"
5-
cffi==1.16.0 ; python_version >= "3.9" and python_version < "3.12"
6-
charset-normalizer==3.3.2 ; python_version >= "3.9" and python_version < "3.12"
7-
colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32"
8-
coloredlogs==15.0.1 ; python_version >= "3.9" and python_version < "3.12"
9-
configparser==7.0.0 ; python_version >= "3.9" and python_version < "3.12"
10-
cssselect2==0.7.0 ; python_version >= "3.9" and python_version < "3.12"
11-
exceptiongroup==1.2.1 ; python_version >= "3.9" and python_version < "3.11"
12-
fonttools[woff]==4.51.0 ; python_version >= "3.9" and python_version < "3.12"
13-
html5lib==1.1 ; python_version >= "3.9" and python_version < "3.12"
14-
humanfriendly==10.0 ; python_version >= "3.9" and python_version < "3.12"
15-
idna==3.7 ; python_version >= "3.9" and python_version < "3.12"
16-
importlib-metadata==7.1.0 ; python_version >= "3.9" and python_version < "3.12"
17-
iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "3.12"
18-
jinja2==3.1.4 ; python_version >= "3.9" and python_version < "3.12"
19-
kaleido==0.2.1 ; python_version >= "3.9" and python_version < "3.12"
20-
laceworksdk==4.1.0 ; python_version >= "3.9" and python_version < "3.12"
21-
logzero==1.7.0 ; python_version >= "3.9" and python_version < "3.12"
22-
markupsafe==2.1.5 ; python_version >= "3.9" and python_version < "3.12"
23-
numpy==1.26.4 ; python_version >= "3.9" and python_version < "3.12"
24-
packaging==24.0 ; python_version >= "3.9" and python_version < "3.12"
25-
pandas==1.5.3 ; python_version >= "3.9" and python_version < "3.12"
26-
pillow==10.3.0 ; python_version >= "3.9" and python_version < "3.12"
27-
plotly==5.22.0 ; python_version >= "3.9" and python_version < "3.12"
28-
pluggy==1.5.0 ; python_version >= "3.9" and python_version < "3.12"
29-
pycparser==2.22 ; python_version >= "3.9" and python_version < "3.12"
30-
pydyf==0.10.0 ; python_version >= "3.9" and python_version < "3.12"
31-
pyphen==0.15.0 ; python_version >= "3.9" and python_version < "3.12"
32-
pyreadline3==3.4.1 ; sys_platform == "win32" and python_version >= "3.9" and python_version < "3.12"
33-
pyside6-addons==6.7.0 ; python_version >= "3.9" and python_version < "3.12"
34-
pyside6-essentials==6.7.0 ; python_version >= "3.9" and python_version < "3.12"
35-
pyside6==6.7.0 ; python_version >= "3.9" and python_version < "3.12"
36-
pytest==7.4.4 ; python_version >= "3.9" and python_version < "3.12"
37-
python-dateutil==2.9.0.post0 ; python_version >= "3.9" and python_version < "3.12"
38-
python-dotenv==0.21.1 ; python_version >= "3.9" and python_version < "3.12"
39-
pytz==2024.1 ; python_version >= "3.9" and python_version < "3.12"
40-
requests==2.32.2 ; python_version >= "3.9" and python_version < "3.12"
41-
shiboken6==6.7.0 ; python_version >= "3.9" and python_version < "3.12"
42-
six==1.16.0 ; python_version >= "3.9" and python_version < "3.12"
43-
tenacity==8.3.0 ; python_version >= "3.9" and python_version < "3.12"
44-
tinycss2==1.3.0 ; python_version >= "3.9" and python_version < "3.12"
45-
tomli==2.0.1 ; python_version >= "3.9" and python_version < "3.11"
46-
urllib3==2.2.1 ; python_version >= "3.9" and python_version < "3.12"
47-
weasyprint==62.1 ; python_version >= "3.9" and python_version < "3.12"
48-
webencodings==0.5.1 ; python_version >= "3.9" and python_version < "3.12"
49-
zipp==3.18.2 ; python_version >= "3.9" and python_version < "3.12"
50-
zopfli==0.2.3 ; python_version >= "3.9" and python_version < "3.12"
1+
bleach==6.2.0 ; python_version >= "3.10" and python_version < "3.13"
2+
brotli==1.1.0 ; python_version >= "3.10" and python_version < "3.13" and platform_python_implementation == "CPython"
3+
brotlicffi==1.1.0.0 ; python_version >= "3.10" and python_version < "3.13" and platform_python_implementation != "CPython"
4+
certifi==2025.1.31 ; python_version >= "3.10" and python_version < "3.13"
5+
cffi==1.17.1 ; python_version >= "3.10" and python_version < "3.13"
6+
charset-normalizer==3.4.1 ; python_version >= "3.10" and python_version < "3.13"
7+
colorama==0.4.6 ; python_version >= "3.10" and python_version < "3.13" and sys_platform == "win32"
8+
coloredlogs==15.0.1 ; python_version >= "3.10" and python_version < "3.13"
9+
configparser==7.2.0 ; python_version >= "3.10" and python_version < "3.13"
10+
cssselect2==0.8.0 ; python_version >= "3.10" and python_version < "3.13"
11+
exceptiongroup==1.2.2 ; python_version == "3.10"
12+
fonttools==4.57.0 ; python_version >= "3.10" and python_version < "3.13"
13+
html5lib==1.1 ; python_version >= "3.10" and python_version < "3.13"
14+
humanfriendly==10.0 ; python_version >= "3.10" and python_version < "3.13"
15+
idna==3.10 ; python_version >= "3.10" and python_version < "3.13"
16+
importlib-metadata==8.6.1 ; python_version >= "3.10" and python_version < "3.13"
17+
iniconfig==2.1.0 ; python_version >= "3.10" and python_version < "3.13"
18+
jinja2==3.1.6 ; python_version >= "3.10" and python_version < "3.13"
19+
kaleido==0.2.1 ; python_version >= "3.10" and python_version < "3.13"
20+
laceworksdk==4.1.0 ; python_version >= "3.10" and python_version < "3.13"
21+
logzero==1.7.0 ; python_version >= "3.10" and python_version < "3.13"
22+
markupsafe==3.0.2 ; python_version >= "3.10" and python_version < "3.13"
23+
numpy==1.26.4 ; python_version >= "3.10" and python_version < "3.13"
24+
packaging==24.2 ; python_version >= "3.10" and python_version < "3.13"
25+
pandas==1.5.3 ; python_version >= "3.10" and python_version < "3.13"
26+
pillow==11.1.0 ; python_version >= "3.10" and python_version < "3.13"
27+
plotly==5.24.1 ; python_version >= "3.10" and python_version < "3.13"
28+
pluggy==1.5.0 ; python_version >= "3.10" and python_version < "3.13"
29+
pycparser==2.22 ; python_version >= "3.10" and python_version < "3.13"
30+
pydyf==0.11.0 ; python_version >= "3.10" and python_version < "3.13"
31+
pyphen==0.17.2 ; python_version >= "3.10" and python_version < "3.13"
32+
pyreadline3==3.5.4 ; python_version >= "3.10" and python_version < "3.13" and sys_platform == "win32"
33+
pyside6-addons==6.9.0 ; python_version >= "3.10" and python_version < "3.13"
34+
pyside6-essentials==6.9.0 ; python_version >= "3.10" and python_version < "3.13"
35+
pyside6==6.9.0 ; python_version >= "3.10" and python_version < "3.13"
36+
pytest==7.4.4 ; python_version >= "3.10" and python_version < "3.13"
37+
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "3.13"
38+
python-dotenv==0.21.1 ; python_version >= "3.10" and python_version < "3.13"
39+
pytz==2025.2 ; python_version >= "3.10" and python_version < "3.13"
40+
requests==2.32.3 ; python_version >= "3.10" and python_version < "3.13"
41+
shiboken6==6.9.0 ; python_version >= "3.10" and python_version < "3.13"
42+
six==1.17.0 ; python_version >= "3.10" and python_version < "3.13"
43+
tenacity==9.1.2 ; python_version >= "3.10" and python_version < "3.13"
44+
tinycss2==1.4.0 ; python_version >= "3.10" and python_version < "3.13"
45+
tomli==2.2.1 ; python_version == "3.10"
46+
urllib3==2.3.0 ; python_version >= "3.10" and python_version < "3.13"
47+
weasyprint==62.3 ; python_version >= "3.10" and python_version < "3.13"
48+
webencodings==0.5.1 ; python_version >= "3.10" and python_version < "3.13"
49+
zipp==3.21.0 ; python_version >= "3.10" and python_version < "3.13"
50+
zopfli==0.2.3.post1 ; python_version >= "3.10" and python_version < "3.13"

0 commit comments

Comments
 (0)