Upload an SBOM from CI
Use this guide to replace an application's package inventory after a build. You need an Assure server, an organisation admin account, curl, and a supported JSON SBOM.
-
Sign in as an admin and add an application on Assets. Record its asset ID and the upload token shown when it is created. The API equivalent is
POST /api/assetswith an admin session. -
Store the
nmu_upload token as a masked CI secret. SetASSURE_URL,ASSURE_ASSET_ID, andASSURE_UPLOAD_TOKENin the job environment. -
Generate the complete SBOM for the build and save it as
sbom.json. -
Send the JSON body:
curl --fail-with-body --silent --show-error \ --header "Authorization: Bearer ${ASSURE_UPLOAD_TOKEN}" \ --header 'Content-Type: application/json' \ --data-binary @sbom.json \ "${ASSURE_URL}/api/assets/${ASSURE_ASSET_ID}/sbom" -
Check
unique_packagesand bothskippedcounters in the response. Compare them with the build inventory. Open the application in Assure and review its findings and scan coverage.
The token only works for that asset. Organisation API tokens (nmt_) are read-only and cannot upload. An asset's agent key can also upload an SBOM for its own asset.
Every successful upload replaces the previous SBOM packages. Keep the previous build's SBOM if you need to restore its inventory. Re-upload that complete document to restore it; doing so records a new scan and ledger event.
Resolve an upload failure
| Response | Action |
|---|---|
| 401 | Check the asset ID and its upload token. Do not substitute an organisation API token. |
| 403 with a browser session | Sign in as an admin and complete two-step sign-in when required. |
| 413 | Reduce the document below 10 MiB. Do not split it into consecutive partial uploads: each replaces the previous inventory. |
| 422 | Read detail; check JSON format, supported spec version, nesting, and component count. |
| Success with skipped packages | Generate versioned package URLs for supported ecosystems. Review the skipped counts before treating the scan as complete. |
See SBOM reference for limits and HTTP API for authentication.