This repository may be used as a starting point for Python applications using Poetry for using Snyk SBOM test and to get a simple diff between scans.
Need to have the following environment variables set: SNYK_TOKEN and SNYK_ORG_ID
To run, install the dependencies using poetry install
, and execute poetry run python src/main.py
Alternatively, use the provided launch.json to specify the command to run and execute in VS Code.
In this example, we assume you already have a SBOM file with the components that is named orig-sbom1.json
- Generate a new SBOM with all the vulnerabilities information:
poetry run python src/main.py ./orig-sbom1.json orig-sbom1-vulns.json
- Pull down the newest vulnerabilities in a new JSON file and compare with the previous vulnerabilities JSON (from the command above). The diff is given in the terminal output:
poetry run python src/main.py ./orig-sbom1.json new-sbom1-vulns.json orig-sbom1-vulns.json