SBOM Grader
Project description
SBOM Grader
This project grades SBOMs according to Red Hat Product Security Guide to SBOMs.
Currently the script only fully supports SPDX v2.3 in json format. CycloneDX is partially supported in version v1.5 for Product SBOMs.
Installation
pip install sbomgrader
Quick start
To show the command line options, run the following command:
sbomgrader --help
This script uses both STDOUT and STDERR. STDOUT receives the output of the grading, while STDERR reports anything causing troubles to the command execution unrelated to the SBOM file.
Usage options
This application provides three subcommands:
gradeconvertlist
sbomgrader grade
This command grades SBOMs.
If you only specify the SBOM document, the script will try to estimate the SBOM type and apply all time-related cookbooks for that type (e.g. if it finds that an SBOM is for an RPM, it will run both rpm build and rpm release cookbooks). The release-time cookbook will take precedence in establishing the final grade.
To specify the cookbook to be used, use -c option. This option must be a reference
to an .y[a]ml file in the filesystem or a default cookbook. Can be used multiple times
to create a Cookbook bundle. To list default cookbooks, use sbomgrader list -c.
To specify SBOM type, the tool lets you specify content type -ct and SBOM type -st.
Component type is either product, image, image_index, rpm or generic. Generic type
only checks the common features of other types, the other types are described [here]
(https://redhatproductsecurity.github.io/security-data-guidelines/sbom/). The SBOM types
are also explained in the article linked. You can select values build or release.
The default passing grade is B. This can be changed with the argument -g and the target value.
The script outputs data in three possible formats. The default one in Markdown,
you can also select json or yaml.
Architecture
This project uses terms like Rules, RuleSets, Cookbooks and CookbookBundles. These are all representations of a test suite to run against an SBOM file.
CookbookBundles are composed of Cookbooks which reference RuleSets which are made of Rules.
Rules are specific tests to be run, RuleSets are suites of Rules.
Cookbook defines which force has to be applied on each rule for each SBOM type. You are completely free to create your own cookbook if the provided ones don't suit your needs. CookbookBundles are only aggregation of Cookbooks which ensures no test has to be run more than once on any document.
For details about Cookbooks, refer to the sbomgrader/cookbooks/README.md file.
For details about RuleSets, refer to the sbomgrader/rulesets/README.md file.
sbomgrader convert
This command converts SBOMs between standards.
To convert an SBOM, provide path to the JSON file containing the SBOM and a desired output format
using the option -f. To list all available conversion maps, use the command sbomgrader list -m.
You can even specify a custom translation map file yourself with the option -m. It must be a yaml file with
the format specified in sbomgrader/translation_maps/README.md. Can
be used multiple times (but only a single map will be used at a time).
User-defined maps can be ignored if the provided map is not suitable. If it is suitable, it will be preferred to the default maps. The order to pick a map is the following:
- user-defined with an exact version match
- user-defined with a fallback version match
- default with an exact version match
- default with a fallback version match
If no match is found, translation will fail.
sbomgrader list
This command lists default implementations.
To list the default conversion maps, use the flag -m.
To list the default cookbooks, use the flag -c.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sbomgrader-0.2.2.tar.gz.
File metadata
- Download URL: sbomgrader-0.2.2.tar.gz
- Upload date:
- Size: 95.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b425b3d6e738ce96be88c3e72b00ed5b82a058dc780129838091b1cafd23f0c
|
|
| MD5 |
16fefa5b53e7d7212d6d611826643271
|
|
| BLAKE2b-256 |
3724fbcabb1c93ba0bc006cc7809b5dfd0e09eedae9be001a1917e5f7c68bead
|
Provenance
The following attestation bundles were made for sbomgrader-0.2.2.tar.gz:
Publisher:
release-pypi.yml on BorekZnovustvoritel/SBOM-Grader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sbomgrader-0.2.2.tar.gz -
Subject digest:
0b425b3d6e738ce96be88c3e72b00ed5b82a058dc780129838091b1cafd23f0c - Sigstore transparency entry: 199282919
- Sigstore integration time:
-
Permalink:
BorekZnovustvoritel/SBOM-Grader@5bc0bda17ed7c06e4845bbbf5ffae0be76de4ce8 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/BorekZnovustvoritel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@5bc0bda17ed7c06e4845bbbf5ffae0be76de4ce8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sbomgrader-0.2.2-py3-none-any.whl.
File metadata
- Download URL: sbomgrader-0.2.2-py3-none-any.whl
- Upload date:
- Size: 65.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c19920f1b38140f5a174c55ba48201c5cb61d666367200d70e18a7423c4ca98
|
|
| MD5 |
33b1441409cf58cb1a9e33f3fff6049d
|
|
| BLAKE2b-256 |
fbdc332cc20aff59cb66d60b1a2a04329ba174a1c722e8f9dc3b0c6c6e7ca733
|
Provenance
The following attestation bundles were made for sbomgrader-0.2.2-py3-none-any.whl:
Publisher:
release-pypi.yml on BorekZnovustvoritel/SBOM-Grader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sbomgrader-0.2.2-py3-none-any.whl -
Subject digest:
2c19920f1b38140f5a174c55ba48201c5cb61d666367200d70e18a7423c4ca98 - Sigstore transparency entry: 199282920
- Sigstore integration time:
-
Permalink:
BorekZnovustvoritel/SBOM-Grader@5bc0bda17ed7c06e4845bbbf5ffae0be76de4ce8 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/BorekZnovustvoritel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@5bc0bda17ed7c06e4845bbbf5ffae0be76de4ce8 -
Trigger Event:
workflow_dispatch
-
Statement type: