feat: implement per-image SBOMs with attestations #2445
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2445
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2445/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1977
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1977
Original created: 2025-11-23T00:13:55Z
Original updated: 2025-11-23T02:03:09Z
Original head: carverauto/serviceradar:chore/syft_integration
Original base: main
Original merged: 2025-11-23T02:02:59Z by @mfreeman451
User description
Summary
Implements Option 2 from our SBOM strategy discussion: hybrid approach with both source and per-image SBOMs.
What's New
1. Per-Image Container SBOMs 🎯
2. Improved Source SBOM
serviceradar-source.spdx.jsonfor clarity3. Build Environment Updates
4. Documentation
docs/SBOM.mdwith:Benefits
✅ Per-image dependency tracking (know exactly what's in each container)
✅ Supply chain security (signed attestations)
✅ Vulnerability scanning per deployment
✅ NIST SP 800-218 compliance
✅ Works with Grype, Trivy, etc.
Verification Example
Testing
Compliance
Supports compliance with:
PR Type
Enhancement
Description
Implement per-image container SBOMs with OCI attestations using cosign keyless signing
Add new workflow to generate SBOMs for 14 container images automatically after releases
Improve source SBOM with better exclusions and weekly scheduling
Install cosign v2.4.1 and syft v1.38.0 in build environments (RBE and ARC runner)
Add comprehensive SBOM documentation with verification and vulnerability scanning guides
Diagram Walkthrough
File Walkthrough
sbom-images.yml
New container image SBOM generation workflow.github/workflows/sbom-images.yml
dispatch
sbom-syft.yml
Improve source SBOM with scheduling and exclusions.github/workflows/sbom-syft.yml
docs/.docusaurus, and other build artifacts
serviceradar-source.spdx.jsonDockerfile.rbe
Add cosign and syft to RBE build imagedocker/Dockerfile.rbe
Dockerfile
Add cosign and syft to ARC runner imagedocker/arc-runner/Dockerfile
SBOM.md
Add comprehensive SBOM documentation and guidesdocs/SBOM.md
using cosign
guidelines)
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1977#issuecomment-3567184087
Original created: 2025-11-23T00:14:37Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
Unconstrained cosign identity
Description: The cosign attestation step performs keyless signing without constraining certificate
identity or OIDC issuer (no --certificate-identity/-regexp or
--certificate-oidc-issuer/-regexp), allowing attestations issued to any identity to be
considered valid during later verification if consumers follow the permissive examples,
weakening supply-chain guarantees.
sbom-images.yml [93-97]
Referred Code
Excessive token permissions
Description: The workflow logs into GHCR using the default GITHUB_TOKEN and grants packages: write and
contents: write permissions at workflow scope, which is broader than needed for SBOM
generation and increases blast radius if the job is compromised; least-privilege scoping
to read packages (for pulls) and limiting contents to read is recommended.
sbom-images.yml [60-66]
Referred Code
Unverified install script
Description: The Dockerfile installs syft via a remote install script piped to sh over HTTPS without
pinning the script source or verifying checksums/signatures, enabling supply-chain
compromise if the script is tampered with.
Dockerfile.rbe [113-116]
Referred Code
Unverified install script
Description: The Dockerfile fetches and executes the syft install script via curl | sh without checksum
or signature verification, allowing arbitrary code execution if the script or transport is
compromised.
Dockerfile [30-32]
Referred Code
Unsigned binary download
Description: Cosign binary is downloaded directly from GitHub Releases without checksum/signature
verification or pinned digest, risking binary tampering or downgrade attacks despite
version pinning.
Dockerfile.rbe [107-110]
Referred Code
Unsigned binary download
Description: Cosign is downloaded via curl from GitHub Releases without verifying checksums/signatures,
exposing the build to potential supply-chain attacks if the artifact is altered.
Dockerfile [23-26]
Referred Code
Lax release upload checks
Description: The release upload step uses GH CLI with GH_TOKEN but does not restrict which release is
targeted beyond a tag string and continues on failure, which could unintentionally upload
artifacts to an incorrect release if TAG is misderived or attacker-controlled; add
explicit repo/ref checks and strict failure handling.
sbom-images.yml [109-117]
Referred Code
🎫 No ticket provided
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Missing audit logs: The workflow performs critical actions (image login, SBOM generation, signing/attestation,
release uploads) without explicit logging of actor, action, and outcomes beyond minimal
echo statements, which may hinder reconstructing events.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Weak error handling: Shell steps call external tools (syft, cosign, gh) without explicit set -e/-o pipefail or
conditional checks, and errors are sometimes ignored (release upload continues on
failure), risking silent or unclear failures.
Referred Code
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status:
Tag validation: The workflow uses an unvalidated tag input and branch-derived tag to construct image
references without sanitization or pattern checks, which could allow malformed inputs to
influence operations.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR review comment.
Original author: @github-advanced-security[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1977#discussion_r2553528240
Original created: 2025-11-23T00:14:45Z
Original path: .github/workflows/sbom-images.yml
Original line: 74
Code injection
Potential code injection in ${{ github.event.workflow_run.head_branch }}, which may be controlled by an external user (workflow_run).
Show more details
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1977#issuecomment-3567185789
Original created: 2025-11-23T00:15:45Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Correct insecure
cosignverification commandThe
cosign verify-attestationcommand is insecure due to overly permissivewildcards for identity and issuer verification. It should be updated to use
specific, trusted values to ensure attestations originate from the correct
GitHub Actions workflow.
Examples:
.github/workflows/sbom-images.yml [135-136]
docs/SBOM.md [51-52]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: The suggestion identifies a critical security flaw in the provided verification instructions, which, if followed, would negate the security benefits of the entire attestation process.
Improve image tag determination logic
Improve the image tag determination logic to explicitly check for a tag and fail
the job if one is not found, preventing the use of incorrect tags like branch
names or
latest..github/workflows/sbom-images.yml [67-76]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a critical flaw in the tag determination logic that could lead to incorrect or overwritten attestations, and provides a robust fix that makes the workflow fail-safe.
Fix condition for release asset upload
Correct the
ifcondition for the 'Attach SBOM to release' step by usinggithub.event.workflow_run.head_branchto ensure assets are uploaded forworkflow_runevents..github/workflows/sbom-images.yml [108-117]
Suggestion importance[1-10]: 9
__
Why: This suggestion fixes a bug that would prevent a key feature of the workflow—uploading SBOMs to a release—from working correctly when triggered by another workflow.
Standardize tool version variable definitions
Standardize tool version variables by removing the
vprefix fromARGdefinitionsand adding it within the
RUNcommands where required, aligning this file withdocker/Dockerfile.rbe.docker/arc-runner/Dockerfile [21-32]
Suggestion importance[1-10]: 5
__
Why: The suggestion improves code consistency across multiple Dockerfiles by standardizing the format of version variables, which enhances maintainability.
Imported GitHub PR review comment.
Original author: @github-advanced-security[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1977#discussion_r2553571788
Original created: 2025-11-23T00:34:54Z
Original path: .github/workflows/sbom-images.yml
Original line: 83
Code injection
Potential code injection in ${{ steps.tag.outputs.tag }}, which may be controlled by an external user (workflow_run).
Show more details
Imported GitHub PR review comment.
Original author: @github-advanced-security[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1977#discussion_r2553571790
Original created: 2025-11-23T00:34:54Z
Original path: .github/workflows/sbom-images.yml
Original line: 93
Code injection
Potential code injection in ${{ steps.tag.outputs.tag }}, which may be controlled by an external user (workflow_run).
Show more details
Imported GitHub PR review comment.
Original author: @github-advanced-security[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1977#discussion_r2553571791
Original created: 2025-11-23T00:34:54Z
Original path: .github/workflows/sbom-images.yml
Original line: 116
Code injection
Potential code injection in ${{ steps.tag.outputs.tag }}, which may be controlled by an external user (workflow_run).
Show more details