mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 13:01:56 +00:00
feat(compliance): improve docs
This commit is contained in:
@@ -1,3 +1,70 @@
|
||||
# How to use it?
|
||||
# ThreatScore Compliance Report Generator
|
||||
|
||||
python3 util/compliance_report/compliance_generator.py --scan-id 01975963-8db9-7d65-8422-aded62a0a7ad --compliance-id prowler_threatscore_azure --email <email> --password <password>
|
||||
This tool generates a PDF compliance report using Prowler's API endpoints, summarizing compliance requirements, risk levels, and findings for a given scan and compliance framework.
|
||||
|
||||
## Features
|
||||
- Authenticates with the Prowler API using email and password
|
||||
- Retrieves compliance requirements and attributes for a given scan and compliance framework
|
||||
- Generates a visually rich PDF report, including:
|
||||
- Compliance summary and description
|
||||
- Compliance score by section (with charts)
|
||||
- Critical failed requirements (with risk and weight)
|
||||
- Detailed requirements and findings
|
||||
|
||||
## Requirements
|
||||
- Python 3.7+
|
||||
- Dependencies: `matplotlib`, `requests`, `reportlab`
|
||||
|
||||
Install dependencies with:
|
||||
```bash
|
||||
pip install matplotlib requests reportlab
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
python3 util/compliance_report/threatscore_report_generator.py \
|
||||
--scan-id <scan_id> \
|
||||
--compliance-id <compliance_id> \
|
||||
--email <email> \
|
||||
--password <password> \
|
||||
[--output <output_path>] \
|
||||
[--base-url <base_url>] \
|
||||
[--only-failed] \
|
||||
[--min-risk-level <level>]
|
||||
```
|
||||
|
||||
### Arguments
|
||||
- `--scan-id` (required): ID of the scan executed by Prowler.
|
||||
- `--compliance-id` (required): Compliance framework ID (e.g., `prowler_threatscore_azure`, `nis2_azure`).
|
||||
- `--email` (required): Email for API authentication.
|
||||
- `--password` (required): Password for API authentication.
|
||||
- `--output` (optional): Output PDF file path (default: `threatscore_report.pdf`).
|
||||
- `--base-url` (optional): Base URL for the API (default: `http://localhost:8080`).
|
||||
- `--only-failed` (optional): Only include failed requirements in the report.
|
||||
- `--min-risk-level` (optional): Minimum risk level for critical failed requirements (default: 4).
|
||||
|
||||
### Example
|
||||
```bash
|
||||
python3 util/compliance_report/threatscore_report_generator.py \
|
||||
--scan-id 12345678-1234-5678-1234-567812345678 \
|
||||
--compliance-id prowler_threatscore_azure \
|
||||
--email user@example.com \
|
||||
--password mypassword \
|
||||
--output my_report.pdf \
|
||||
--base-url http://localhost:8080 \
|
||||
--only-failed \
|
||||
--min-risk-level 4
|
||||
```
|
||||
|
||||
## Output
|
||||
- The script will generate a PDF file with:
|
||||
- Compliance framework summary
|
||||
- Compliance score by section (with bar chart)
|
||||
- Table of critical failed requirements (if any)
|
||||
- Detailed breakdown of each requirement and its findings
|
||||
|
||||
## Notes
|
||||
- The script authenticates with the API and retrieves all necessary data automatically.
|
||||
- If you encounter authentication errors, check your email, password, and API URL.
|
||||
- For more details, see the script source: `util/compliance_report/threatscore_report_generator.py`
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ from reportlab.platypus import (
|
||||
)
|
||||
|
||||
|
||||
def generate_compliance_report(
|
||||
def generate_threatscore_report(
|
||||
scan_id: str,
|
||||
compliance_id: str,
|
||||
output_path: str,
|
||||
@@ -873,7 +873,7 @@ if __name__ == "__main__":
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
generate_compliance_report(
|
||||
generate_threatscore_report(
|
||||
args.scan_id,
|
||||
args.compliance_id,
|
||||
args.output,
|
||||
Reference in New Issue
Block a user