fix: add /tmp emptyDir volume to SBOM scanner sidecar#811
Conversation
The SBOM scanner sidecar runs with readOnlyRootFilesystem: true but Syft's Java cataloger needs writable temp space to process JAR archives (Go's archive/zip requires io.ReaderAt for random access via temp files). Without /tmp, Java packages are silently dropped from SBOMs, causing incomplete vulnerability scans. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Ben <ben@armosec.io>
📝 WalkthroughWalkthroughThe Helm chart values configuration for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
charts/kubescape-operator/values.yaml (1)
790-791: Consider bounding/tmpgrowth for safer node-level behavior.
emptyDir: {}is valid, but adding asizeLimitcan reduce eviction risk during large image/JAR processing spikes.Suggested values tweak
volumes: - name: sbom-comm emptyDir: medium: Memory sizeLimit: 10Mi - name: sbom-scanner-tmp - emptyDir: {} + emptyDir: + sizeLimit: 2Gi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@charts/kubescape-operator/values.yaml` around lines 790 - 791, The emptyDir volume named "sbom-scanner-tmp" currently uses an unbounded emptyDir (emptyDir: {}); change it to a bounded emptyDir by adding a sizeLimit (and optionally medium if you want memory-backed tmpfs) so the sbom-scanner-tmp volume cannot grow unbounded and cause node evictions—update the sbom-scanner-tmp emptyDir stanza to include a sensible sizeLimit (for example "1Gi" or another cluster-appropriate value).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@charts/kubescape-operator/values.yaml`:
- Around line 790-791: The emptyDir volume named "sbom-scanner-tmp" currently
uses an unbounded emptyDir (emptyDir: {}); change it to a bounded emptyDir by
adding a sizeLimit (and optionally medium if you want memory-backed tmpfs) so
the sbom-scanner-tmp volume cannot grow unbounded and cause node
evictions—update the sbom-scanner-tmp emptyDir stanza to include a sensible
sizeLimit (for example "1Gi" or another cluster-appropriate value).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7e6ffdd5-5bbf-430d-8d07-d85185d53ae0
📒 Files selected for processing (1)
charts/kubescape-operator/values.yaml
Summary
emptyDirvolume (sbom-scanner-tmp) mounted at/tmpto the node-agent SBOM scanner sidecararchive/ziprequiresio.ReaderAt, which uses temp files for random access)/tmp, Java packages are silently dropped from SBOMs (e.g., nginx SBOM missinglibintlat/usr/share/java/libintl-0.21.jar— 142 packages instead of 143)readOnlyRootFilesystem: truestays in place — the emptyDir provides writable temp space without weakening security/tmpmounted correctly; only the node-agent sidecar was missing itTest plan
helm unittest charts/kubescape-operator/— all 12 tests, 656 snapshots passhelm templatewithnodeAgent.sbomScanner.enabled=trueconfirms/tmpvolumeMount andsbom-scanner-tmpvolume render correctly🤖 Generated with Claude Code
Summary by CodeRabbit