This repository provides Contrast Security reporting in two workflows:
- Notebook workflow (
notebooks/) for guided, interactive execution in Jupyter. - Script workflow (
Reports/) for direct CLI execution and automation.
From repository root:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txtInstall Jupyter only if you plan to run notebooks:
pip install jupyterlab notebookUse pre-commit if you want .ipynb outputs and execution counts stripped automatically before commit.
One-time setup from repository root:
pip install -r requirements-dev.txt
pre-commit installRun once against all files (optional):
pre-commit run --all-filesAll workflows default to one root .env file.
cp example.env .envSet these values in .env:
TEAMSERVER_URL=https://your_saas_instance.contrastsecurity.com/
ORG_UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CONTRAST_AUTH=base64_encoded_authorization_header_value
CONTRAST_API_KEY=your_api_key_hereNotes:
.envis git-ignored.example.envis the committed template.- Scripts and notebooks support the flat keys shown above from root
.env. - Legacy key names (
TeamserverURL,AUTH,API_KEY) are still accepted for compatibility.
Use this for interactive, cell-by-cell execution.
Start Jupyter from repository root:
jupyter labor
jupyter notebookAvailable notebooks:
notebooks/app_mttr_report/generate_app_kpi_report.ipynbnotebooks/full-app-report/generate_app_report.ipynbnotebooks/top-vulns-report/generate_single_vuln_report.ipynbnotebooks/used_OSS_by_app/generate_used_oss_by_app_report.ipynb
Notebook outputs are written to notebooks/<report>/Output/.
Use this for CLI execution, automation, and pipelines.
Run scripts from repository root, for example:
python3 Reports/used_OSS_by_app/generate_used_oss_by_app_report.pyScript outputs are written to Reports/<report>/Output/ by default.
Detailed report-by-report script usage has moved to:
Reports/README.md
Reference docs are in API documentation/:
saas-restapi-v1/saas-restapi-v2/saas-restapi-v3/
- Do not commit
.env. - Keep
CONTRAST_AUTHandCONTRAST_API_KEYprivate. - Treat generated reports as potentially sensitive.