diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 593fe061..f041854f 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -48,4 +48,7 @@ jobs: exit 1 fi ./scripts/unittests.sh + - uses: trailofbits/gh-action-pip-audit@v1.0.0 + with: + inputs: requirements.txt diff --git a/Taskfile.yml b/Taskfile.yml index be72a759..0878af39 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -11,7 +11,6 @@ tasks: audit: desc: Audit the code - deps: [about] cmds: - ./scripts/builder.sh pip-audit -r requirements.txt @@ -57,7 +56,7 @@ tasks: docs: desc: Create sphinx documentation - deps: [about] + deps: [about, sbom] cmds: - ./scripts/builder.sh /bin/bash -c "cd docs && make clean && make html" @@ -91,6 +90,11 @@ tasks: cmds: - ./scripts/builder.sh python3 -m twine upload --repository pypi dist/* + sbom: + desc: Audit the code + cmds: + - ./scripts/builder.sh ./scripts/sbom.sh + unittests: desc: Run unittests deps: [about] diff --git a/docs/index.rst b/docs/index.rst index f26108ef..e904cd77 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,6 +29,7 @@ errors logger proof_mechanism + sbom Indices and tables ================== diff --git a/docs/sbom.rst b/docs/sbom.rst new file mode 100644 index 00000000..6b721d9e --- /dev/null +++ b/docs/sbom.rst @@ -0,0 +1,10 @@ +.. _sbomxmlref: + +SBOM CDX for PySDK +........................... + +.. literalinclude:: sbom.xml + :language: xml + + + diff --git a/docs/sbom.xml b/docs/sbom.xml new file mode 100644 index 00000000..bbd285ae --- /dev/null +++ b/docs/sbom.xml @@ -0,0 +1,137 @@ + + + 2022-08-16T12:45:07.303664+00:00 + + + CycloneDX + cyclonedx-python-lib + 2.7.1 + + + https://github.com/CycloneDX/cyclonedx-python-lib/actions + + + https://pypi.org/project/cyclonedx-python-lib/ + + + https://cyclonedx.github.io/cyclonedx-python-lib/ + + + https://github.com/CycloneDX/cyclonedx-python-lib/issues + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE + + + https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md + + + https://github.com/CycloneDX/cyclonedx-python-lib + + + https://cyclonedx.org + + + + + + + + backoff + 1.11.1 + + + certifi + 2022.6.15 + + + charset-normalizer + 2.1.0 + + + flatten-dict + 0.4.2 + + + idna + 3.3 + + + importlib-metadata + 4.12.0 + + + iso8601 + 1.0.2 + + + jinja2 + 3.1.2 + + + markupsafe + 2.1.1 + + + pyaml-env + 1.1.5 + + + pyyaml + 5.4.1 + + + requests + 2.28.1 + + + requests-toolbelt + 0.9.1 + + + rfc3339 + 6.2 + + + six + 1.16.0 + + + typing-extensions + 4.3.0 + + + urllib3 + 1.26.11 + + + xmltodict + 0.13.0 + + + zipp + 3.8.1 + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/requirements-dev.txt b/requirements-dev.txt index 8292bba1..35fab324 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -19,6 +19,7 @@ twine~=4.0 sphinx~=5.1 sphinx-rtd-theme~=1.0 sphinxcontrib-spelling~=7.6 +xq~=0.0 # analyze dependencies pipdeptree~=2.2 diff --git a/scripts/sbom.sh b/scripts/sbom.sh new file mode 100755 index 00000000..61968339 --- /dev/null +++ b/scripts/sbom.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# generate sbom +# +if [ "$USER" != "builder" -a "$USER" != "vscode" ] +then + echo "Cannot run sbom.sh outside container" + exit 0 +fi + +pip-audit -r requirements.txt -f cyclonedx-xml -o /tmp/sbom.xml +cat /tmp/sbom.xml | xq > docs/sbom.xml +rm /tmp/sbom.xml