A GitHub Action wrapper for aibomgen-cli that supports the non-interactive CI workflows for generating, validating, enriching, and merging AIBOM data.
This repository is part of the broader AIBoMGen ecosystem for generating, analyzing, and validating AI/ML Bills of Materials (AIBOMs).
| Repository | Purpose |
|---|---|
| AIBoMGen CLI | Command-line tool for generating AIBOMs from source code and ML artifacts |
| AIBoMGen CLI Action | GitHub Action for automated AIBOM generation in CI/CD pipelines |
| AIBoMGen CLI Dashboard | Demo dashboard using AIBoMGen CLI |
| AIBoMGen | Proof of concept research repository |
| AIBoMGen Experiments | Experimental evaluations of AIBoMGen |
The action is command-based. Each command runs one aibomgen-cli command, non-interactively:
scan: detect the Hugging Face models a directory uses and write one AIBOM per modelgenerate: write AIBOMs for explicit model IDsvalidate: check AIBOMs against the CycloneDX schema, completeness, and vulnerability findingscompleteness: print a completeness report for one AIBOMvuln-scan: fetch the Hub's security scan results again, and optionally write them into the AIBOMsmerge: merge AIBOMs into an SBOM from any generatordownload: only install the CLI and output its path ascmd
All inputs and their defaults are listed in action.yml. The examples use the @v1 tag; for the strongest supply-chain guarantee, pin a full commit SHA instead.
.github/workflows/reference-pipeline.yml is the DevSecOps pipeline from Fig. 1 of the AIBoMGen CLI paper. It runs on every push to this repository against the fake product in examples/reference-product, so it also tests the action:
- generate an SBOM with an SBOM generator of choice (Syft)
scanthe product and write one AIBOM per modelvalidatethe AIBOMs in strict mode (fails the build on invalid AIBOMs or findings ratedhighor above)mergethe AIBOMs into the SBOM- sign every AIBOM and the merged BOM with keyless Sigstore (gh-action-sigstore-python), which also verifies the signatures
- upload everything as the
reference-bomsworkflow artifact - on a release of the product, attach the same files to that release
Releases of the fake product are tagged reference-product-v*, separate from the action's own vX.Y.Z releases, which the pipeline ignores. Create them as prereleases that are not marked latest, so the action release stays the repository's latest release:
gh release create reference-product-v1.0.0 --prerelease --latest=false \
--title "Reference product v1.0.0" --notes "Release of the fake product in examples/reference-product".github/workflows/reference-security-gate.yml covers the failing branch. It scans examples/reference-product-unsafe, which uses ykilcher/totally-harmless-model, a demo model whose pytorch_model.bin every Hub scanner rates critical. The workflow succeeds only when strict validation blocks the build. The AIBOM, with the finding in its vulnerabilities, is uploaded as blocked-aiboms for inspection.
.github/workflows/reference-refresh.yml is the scheduled half. Every week, and after each successful pipeline run on main, it downloads the latest AIBOMs, refreshes their security findings with vuln-scan (vuln-scan-enrich: "true"), and validates them again.
Copy the workflows into your own repository, replacing uses: ./ with uses: CRA-tools/aibomgen-cli-action@v1 and PRODUCT_DIR with the directory to scan. To verify a signature from the artifact:
cosign verify-blob merged.cdx.json \
--bundle merged.cdx.json.sigstore.json \
--certificate-identity "https://github.com/CRA-tools/aibomgen-cli-action/.github/workflows/reference-pipeline.yml@refs/heads/main" \
--certificate-oidc-issuer https://token.actions.githubusercontent.comFor files from a product release, the identity ends in @refs/tags/<tag> instead of @refs/heads/main.
- id: scan
uses: CRA-tools/aibomgen-cli-action@v1
with:
command: scan
scan-input: .
hf-token: ${{ secrets.HF_TOKEN }} # optional, for gated models and higher rate limits- uses: CRA-tools/aibomgen-cli-action@v1
with:
command: generate
generate-model-ids: |
google-bert/bert-base-uncased
gpt2
format: json- uses: CRA-tools/aibomgen-cli-action@v1
with:
command: validate
validate-input: ${{ steps.scan.outputs.written-files }}
validate-strict: "true"
validate-fail-severity: high
validate-min-score: "0.5"- uses: CRA-tools/aibomgen-cli-action@v1
with:
command: merge
merge-aibom-files: ${{ steps.scan.outputs.written-files }}
merge-sbom-file: sbom.cdx.json
merge-output-file: dist/merged.cdx.jsonThe merged BOM is written as XML when merge-output-file ends in .xml, and as JSON otherwise.
- uses: CRA-tools/aibomgen-cli-action@v1
with:
command: vuln-scan
vuln-scan-input: |
dist/model1.aibom.cdx.json
dist/model2.aibom.cdx.json
vuln-scan-enrich: "true"With vuln-scan-enrich: "true", each AIBOM is updated in place. Without it, the findings are only reported.
- uses: CRA-tools/aibomgen-cli-action@v1
with:
command: completeness
completeness-input: dist/model.aibom.cdx.json- id: aibomgen
uses: CRA-tools/aibomgen-cli-action@v1
with:
command: download
- run: ${{ steps.aibomgen.outputs.cmd }} --helpscan,generate,merge, and an enrichingvuln-scanupload the files they write as one workflow artifact, keeping the original filenames. The default artifact names areoutput-aiboms(scan,generate),output-aiboms-vuln(vuln-scan), andmerged(merge);artifact-nameoverrides them. Setupload-artifact: "false"to skip the upload.- On a
releaseevent or a tag push that has a release, the same files are attached to that release (upload-release-assets). This needs:
permissions:
contents: writecmd: path to the installed aibomgen-cli (downloadcommand)executed-command: the command the action ranwritten-files: newline-separated paths of the files the command wrote
Run the same checks as CI before opening a PR:
npm run all- The default CLI version is
v0.3.0(aibomgen-version). aibomgen-sha256verifies the downloaded release archive.hf-tokenis passed to the CLI as theHF_TOKENenvironment variable and masked in logs.
For inquiries, feel free to reach out
Maintained by:
Wiebe Vandendriessche
wiebe.vandendriessche@ugent.be
LinkedIn
DISCOVER: IDLab, Ghent University – imec.
This project is licensed under the terms described in the LICENSE file.
This work has been partially supported by the CRACY project, funded by the European Union’s Digital Europe Programme under grant agreement No 101190492.