Repository navigation
⚡ Feature Request: Give Trivy scan containers a stable name #5195
zacgoodwin
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature Description
Set
Namein theContainerCreatecall for Trivy scan containers, so they stop getting random Docker names.Arcane already removes the containers after reading the result (
vuln.RemoveContainer, withAutoRemove: falseon purpose inbackend/pkg/vuln/driver.go), so--rmisn't needed. This request covers the name only.Problem It Solves
Arcane creates each Trivy scan container with no name, so Docker assigns a random one (
crazy_borg,amazing_blackburn). Log and metrics agents that read every container on a host (OneUptime's docker-agent, Grafana Alloy, cAdvisor) treat each name as a new service. Each scan leaves behind a one-off service in OneUptime holding that scan's output.Proposed Solution
A fixed name such as
trivy-scancollides when "Concurrent Scan Containers" is above 1, or when the previous container is still being removed. A name per slot avoids that:arcane-trivy-<slot>for per-image scans andarcane-trivy-batchfor the batch container. If a stale container already holds the name, remove it first.That caps the names at one per slot, so a collector sees a handful of services instead of one per scan.
Optional, same area: a setting for extra labels on scan containers, next to "Trivy Security Options". The existing
com.getarcaneapp.internal.resource=truelabel helps collectors that filter on labels; a user-defined label would let people match whatever their agent expects.Alternatives Considered
Workaround for now, in the collector:
docker_stats.excluded_images: ["*aquasecurity/trivy*"]for metrics, plus a filter processor that drops log records starting with{"SchemaVersion": ..., "Trivy":.Additional Context
Something else I saw
On v3.2.0 the full JSON report also shows up in the scan containers' stdout logs, even though
buildTrivyCommandArgspasses--output /tmp/arcane-trivy-result-*.json. I haven't found why. If the report stayed out of stdout, agents that ship container logs would stop collecting it. The reports include package maintainer email addresses, which OneUptime's PII scanner flags.Setup
ghcr.io/aquasecurity/trivy:0.76.0oneuptime/docker-agent:release(OpenTelemetry Collector contrib 0.165.0)Would you be willing to work on this feature?
All reactions