-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phase 1: Container Image with Python application #14
Comments
@CISA-SBOM-Community/sbom-generation-tiger-team I've posted some benchmarks for container and application generation. Please review and let me know what your thoughts. The qualification methodology is rather primitive but should hopefully help guide us at least. |
Quantitative AnalysisContainerSummary
Syft$ jq '.components[] | .name' syft_container-sbom_cyclonedx.json | wc -l
192
$ jq '.components[] | .name' syft_container-sbom_cyclonedx.json | uniq | wc -l
173 $ jq '.packages[] | .name' syft_container-sbom_spdx.json | wc -l
192
$ jq '.packages[] | .name' syft_container-sbom_spdx.json | uniq | wc -l
173 Trivy$ jq '.components[] | .name' trivy_container-sbom_cyclonedx.json | wc -l
180
$ jq '.components[] | .name' trivy_container-sbom_cyclonedx.json | uniq | wc -l
178 $ jq '.packages[] | .name' trivy_container-sbom_spdx.json | wc -l
181
$ jq '.packages[] | .name' trivy_container-sbom_spdx.json | uniq | wc -l
172 What we can conclude here is that both tools evaluated generated duplicates. ApplicationSummary
$ for i in *cyclonedx*; do echo $i; jq '.components[] | .name' $i | wc -l; jq '.components[] | .name' $i | uniq | wc -l; done
cyclonedx-python_application-sbom_cyclonedx.json
3
3
sbom4python_application-sbom_cyclonedx.json
3
3
syft_application-sbom_cyclonedx.json
3
3
trivy_application-sbom_cyclonedx.json
4
4 $ for i in *spdx*; do echo $i; jq '.packages[] | .name' $i | wc -l; jq '.packages[] | .name' $i | uniq | wc -l; done
sbom4python_application-sbom_spdx.json
3
3
syft_application-sbom_spdx.json
4
4
trivy_application-sbom_spdx.json
5
5 VerdictMuch like the findings in #15, Trivy appears to generate less duplicate packages. The findings for the Application SBOM is less interesting. The objective here isn't necessarily to do a deep dive into the output of these tools. The view is that they should be a good starting point and to be replaceable in the pipeline as they evolve. With this in mind, I will proceed with |
@CISA-SBOM-Community/sbom-generation-tiger-team review. I've implemented the first few steps. Please review the data in the comment above. If anyone has any arguments for why we should not use For the next step, we need to find a tool for creating a hierarchy SBOM that includes both the container and application SBOMs. Note that "merging" these into a single SBOM isn't possible as they are of two different SBOM types (container and application). Thus a tool for creating a hierarchy is needed. Tools that will be evaluated include bomctl and bomasm. Neither of these tools can do this in the current version but future versions promises this ability. Thus Phase 1 is somewhat blocked by this. |
I'm good with moving forward with Trivy. |
Tracker for
Container Image with Python application
.Work to be carried out in #4
Todo
merginggenerating hierarchical SBOMsmerginghierarchyContainer SBOM Generation
Tools Evaluated
As per the discussion in the Tiger Team, the tools qualify as per the qualification criteria (citation needed).
Before we generate the result, we first need to build the Docker image:
$ docker build . -t phase-1-python
Result
syft phase-1-python -o cyclonedx-json | jq > syft_container-sbom_cyclonedx.json
jq
for improved readabilitysyft phase-1-python -o spdx-json | jq > syft_container-sbom_spdx.json
jq
for improved readabilitytrivy image --format cyclonedx --output trivy_container-sbom_cyclonedx.json phase-1-python
trivy image --format spdx-json --output trivy_container-sbom_spdx.json phase-1-python
$ du -hs ./* 832K ./syft_container-sbom_cyclonedx.json 4.1M ./syft_container-sbom_spdx.json 272K ./trivy_container-sbom_cyclonedx.json 272K ./trivy_container-sbom_spdx.json
$ wc -l ./*.json 24671 ./syft_container-sbom_cyclonedx.json 106267 ./syft_container-sbom_spdx.json 10431 ./trivy_container-sbom_cyclonedx.json 7359 ./trivy_container-sbom_spdx.json
We need to dive deeper dive into the quality of these SBOMs, but based on the amount of data picked up (measured by LOC),
syft
appears to pick up a lot more.Some rudamentary automated assesment using sbomdiff (0.5.4) yielded the following:
sbomdiff --sbom spdx syft_container-sbom_spdx.json trivy_container-sbom_spdx.json
: outputsbomdiff --sbom cyclonedx syft_container-sbom_cyclonedx.json trivy_container-sbom_cyclonedx.json
: outputApplication (
requirements.txt
) SBOM GenerationNote: We are only only looking at Build and Source SBOMs (reference), thus any tool that cannot take a
requirements.txt
file (or similar) is disqualified from the selection process.Tools Evaluated
syft requirements.txt -o cyclonedx-json | jq > syft_application-sbom_cyclonedx.json
jq
for improved readabilitysyft requirements.txt -o spdx-json | jq > syft_application-sbom_spdx.json
jq
for improved readabilitytrivy fs --format cyclonedx --output trivy_application-sbom_cyclonedx.json requirements.txt
trivy fs --format spdx-json --output trivy_application-sbom_spdx.json requirements.txt
--format
needs to bespdx-json
to be JSON, whereascyclonedx
generates JSONcyclonedx-py requirements requirements.txt > cyclonedx-python_application-sbom_cyclonedx.json
sbom4python -r requirements.txt --sbom spdx --format json -o sbom4python_application-sbom_spdx.json
sbom4python -r requirements.txt --sbom cyclonedx --format json -o sbom4python_application-sbom_cyclonedx.json
$ du -hs ./* 8.0K ./cyclonedx-python_application-sbom_cyclonedx.json 8.0K ./syft_application-sbom_cyclonedx.json 12K ./syft_application-sbom_spdx.json 4.0K ./trivy_application-sbom_cyclonedx.json 4.0K ./trivy_application-sbom_spdx.json 8.0K sbom4python_application-sbom_cyclonedx.json 4.0K sbom4python_application-sbom_spdx.json
$ wc -l ./*.json 147 ./cyclonedx-python_application-sbom_cyclonedx.json 206 ./syft_application-sbom_cyclonedx.json 273 ./syft_application-sbom_spdx.json 137 ./trivy_application-sbom_cyclonedx.json 129 ./trivy_application-sbom_spdx.json 176 ./sbom4python_application-sbom_cyclonedx.json 119 ./sbom4python_application-sbom_spdx.json
Merging Tool
Tools Evaluated
Annotation tool
TODO
Conformance Check
We want all our SBOMs to meet National Telecommunications and Information Administration (NTIA)'s minimum elements and have this checked automatically in the CI/CD pipeline.
The text was updated successfully, but these errors were encountered: