fix: make SBOM failure service discovery opt-in - #946
Conversation
Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds an opt-in ChangesSBOM failure reporting
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to SBOM failure reporting is now explicitly opt-in, preventing service discovery unless both SBOM generation and failure reporting are enabled. The documented configuration behavior and guarded receiver handling are covered without an identified merge-blocking risk. Sequence Diagram(s)sequenceDiagram
participant Main
participant resolveSbomFailureReportReceiverURL
participant LoadServiceURLs
participant HTTPFailureReporter
Main->>resolveSbomFailureReportReceiverURL: Resolve receiver URL
resolveSbomFailureReportReceiverURL->>LoadServiceURLs: Load services when both toggles are enabled
LoadServiceURLs-->>resolveSbomFailureReportReceiverURL: Return services or error
resolveSbomFailureReportReceiverURL-->>Main: Return URL or empty string
Main->>HTTPFailureReporter: Create reporter when URL is non-empty
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Overview
Prevent node-agent from performing remote service discovery for SBOM failure reporting unless it is explicitly enabled.
This adds the default-disabled
sbomFailureReportingEnabledconfiguration option. Service discovery now runs only when both:sbomGenerationEnabledistruesbomFailureReportingEnabledistrueWhen enabled, the existing discovery behavior is preserved:
SERVICESor/etc/config/services.jsonwhen available.API_URL.api.armosec.iowhenAPI_URLis unset.Setting
API_URLor mountingservices.jsonalone does not enable failure reporting. Discovery errors and empty receiver URLs remainnon-fatal.
Additional Information
This changes SBOM failure reporting from implicit behavior to explicit opt-in behavior. Existing deployments that require failure reporting must add:
{ "sbomGenerationEnabled": true, "sbomFailureReportingEnabled": true }How to Test
Focused tests:
These checks pass locally.
A serial non-e2e repository test sweep was also performed. The remaining unrelated environment-dependent failures were:
Socket-dependent exporter, node-profile, and SBOM-scanner tests passed when run outside the restricted sandbox.
Related issues/PRs
Checklist before requesting a review
Summary by CodeRabbit
New Features
Documentation