Skip to content

fix(container): handle Grype source-scheme prefix collisions in image refs#115

Merged
eFAILution merged 1 commit intofeat/argus-portabilityfrom
fix/grype-prefix-collision
May 5, 2026
Merged

fix(container): handle Grype source-scheme prefix collisions in image refs#115
eFAILution merged 1 commit intofeat/argus-portabilityfrom
fix/grype-prefix-collision

Conversation

@eFAILution
Copy link
Copy Markdown
Collaborator

fix(container): handle Grype source-scheme prefix collisions in image refs

Background

  • User config: image: docker:argus-scan, dockerfile: docker/Dockerfile, context: .
  • Argus's builder correctly runs docker build --tag docker:argus-scan --file docker/Dockerfile . and tags the image locally.
  • Grype's CLI then mis-parses docker:argus-scan: docker: is a
    reserved Grype source-scheme prefix (alongside podman:,
    registry:, dir:, sbom:, oci-archive:, oci-dir:,
    singularity:, attestation:). Grype reads the colon as the
    scheme separator, looks for an image named argus-scan in the
    docker daemon, and fails — the user's locally-built image
    docker:argus-scan (image docker, tag argus-scan) is
    never resolved.
  • Trivy doesn't have this ambiguity (positional arg, no scheme
    prefixes), so the same target works under Trivy.

Two-pronged fix

  1. Config-load warning. warn_on_grype_prefix_collision checks
    each image ref against the reserved-prefix list at parse time
    and logs a remediation message ("rename to e.g. argus-app:dev")
    before the Docker build runs — saves the user a wasted build
    cycle. Non-fatal so Trivy-only or build-only workflows aren't
    blocked.
  2. Runtime escape in _run_grype. When local=True, the
    user's ref is prefixed with docker: so Grype's parser sees
    an explicit scheme regardless of what the user named the image:
    docker:argus-scandocker:docker:argus-scan (scheme
    docker, identifier docker:argus-scan)
    myapp:devdocker:myapp:dev (scheme
    docker, identifier myapp:dev)
    For remote (registry) scans we leave the ref untouched — that
    path was working before, and forcing the daemon source for an
    image that doesn't exist locally would break it.

Behavior preserved

  • Trivy invocation unchanged.
  • Healthy Grype scans (clean ref, local=True or local=False)
    resolve identically; the new prefix is a no-op for daemon-resident
    images.

Tests (+8)

  • TestGrypePrefixCollisionWarning (5): warning fires for each
    documented prefix, doesn't fire for clean refs, surfaces during
    parse_container_config, defensive on non-string input,
    message includes a rename suggestion.
  • TestRunGrypeLocalDaemonScheme (3): local target gets the
    docker: prefix uniformly (collision case AND clean-ref case),
    remote target does not.

Validation

  • Full SDK suite: 1459 passed (+8), 8 skipped.

… refs

Background
- User config: ``image: docker:argus-scan, dockerfile: docker/Dockerfile,
  context: .``
- Argus's builder correctly runs ``docker build --tag docker:argus-scan
  --file docker/Dockerfile .`` and tags the image locally.
- Grype's CLI then mis-parses ``docker:argus-scan``: ``docker:`` is a
  reserved Grype source-scheme prefix (alongside ``podman:``,
  ``registry:``, ``dir:``, ``sbom:``, ``oci-archive:``, ``oci-dir:``,
  ``singularity:``, ``attestation:``). Grype reads the colon as the
  scheme separator, looks for an image named ``argus-scan`` in the
  docker daemon, and fails — the user's locally-built image
  ``docker:argus-scan`` (image ``docker``, tag ``argus-scan``) is
  never resolved.
- Trivy doesn't have this ambiguity (positional arg, no scheme
  prefixes), so the same target works under Trivy.

Two-pronged fix
1. Config-load warning. ``warn_on_grype_prefix_collision`` checks
   each image ref against the reserved-prefix list at parse time
   and logs a remediation message ("rename to e.g. ``argus-app:dev``")
   before the Docker build runs — saves the user a wasted build
   cycle. Non-fatal so Trivy-only or build-only workflows aren't
   blocked.
2. Runtime escape in ``_run_grype``. When ``local=True``, the
   user's ref is prefixed with ``docker:`` so Grype's parser sees
   an explicit scheme regardless of what the user named the image:
     ``docker:argus-scan`` → ``docker:docker:argus-scan`` (scheme
     ``docker``, identifier ``docker:argus-scan``)
     ``myapp:dev``         → ``docker:myapp:dev`` (scheme
     ``docker``, identifier ``myapp:dev``)
   For remote (registry) scans we leave the ref untouched — that
   path was working before, and forcing the daemon source for an
   image that doesn't exist locally would break it.

Behavior preserved
- Trivy invocation unchanged.
- Healthy Grype scans (clean ref, ``local=True`` or ``local=False``)
  resolve identically; the new prefix is a no-op for daemon-resident
  images.

Tests (+8)
- ``TestGrypePrefixCollisionWarning`` (5): warning fires for each
  documented prefix, doesn't fire for clean refs, surfaces during
  ``parse_container_config``, defensive on non-string input,
  message includes a rename suggestion.
- ``TestRunGrypeLocalDaemonScheme`` (3): local target gets the
  ``docker:`` prefix uniformly (collision case AND clean-ref case),
  remote target does not.

Validation
- Full SDK suite: 1459 passed (+8), 8 skipped.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🔒 Argus Container Security Scan

Branch: fix/grype-prefix-collision
Commit: c7089b8

📊 Combined Findings Summary

🚨 Critical ⚠️ High 🟡 Medium 🔵 Low 📦 Total 🔢 Unique
1 22 61 64 148 148

Scanned: 4 containers | Build Failures: 0

📦 Container Breakdown

Container Image 🚨 Crit ⚠️ High 🟡 Med 🔵 Low Total Unique Status
cli ghcr.io/huntridge-labs/argus/cli:c7089b8b1f4ca0a2215777b728ce93316245b7c2 1 11 15 1 28 28
scanner-bandit ghcr.io/huntridge-labs/argus/scanner-bandit:c7089b8b1f4ca0a2215777b728ce93316245b7c2 0 0 1 0 1 1
scanner-opengrep ghcr.io/huntridge-labs/argus/scanner-opengrep:c7089b8b1f4ca0a2215777b728ce93316245b7c2 0 7 41 63 111 111
scanner-supply-chain ghcr.io/huntridge-labs/argus/scanner-supply-chain:c7089b8b1f4ca0a2215777b728ce93316245b7c2 0 4 4 0 8 8

🔍 Detailed Findings by Container

🚨 cli - 28 vulnerabilities (22 unique)

Image: ghcr.io/huntridge-labs/argus/cli:c7089b8b1f4ca0a2215777b728ce93316245b7c2

Combined (Deduplicated)

🚨 Critical ⚠️ High 🟡 Medium 🔵 Low Total Unique
1 11 15 1 28 22
🔷 Trivy Scanner (28 findings, 22 unique)
CVE Severity Package Version Fixed
CVE-2025-68121 🚨 CRITICAL stdlib v1.24.11 1.24.13, 1.25.7, 1.26.0-rc.3
CVE-2026-32280 ⚠️ HIGH stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32281 ⚠️ HIGH stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32283 ⚠️ HIGH stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-33810 ⚠️ HIGH stdlib v1.26.1 1.26.2
CVE-2025-61726 ⚠️ HIGH stdlib v1.24.11 1.24.12, 1.25.6
CVE-2025-61728 ⚠️ HIGH stdlib v1.24.11 1.24.12, 1.25.6
CVE-2026-25679 ⚠️ HIGH stdlib v1.24.11 1.25.8, 1.26.1
CVE-2026-32280 ⚠️ HIGH stdlib v1.24.11 1.25.9, 1.26.2
CVE-2026-32281 ⚠️ HIGH stdlib v1.24.11 1.25.9, 1.26.2
CVE-2026-32283 ⚠️ HIGH stdlib v1.24.11 1.25.9, 1.26.2
CVE-2026-34040 ⚠️ HIGH github.com/docker/docker v28.5.2+incompatible 29.3.1
CVE-2026-3219 🟡 MEDIUM pip 26.0.1 N/A
CVE-2026-32282 🟡 MEDIUM stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32288 🟡 MEDIUM stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32289 🟡 MEDIUM stdlib v1.26.1 1.25.9, 1.26.2
CVE-2025-11579 🟡 MEDIUM github.com/nwaples/rardecode/v2 v2.1.0 2.2.0
CVE-2025-58058 🟡 MEDIUM github.com/ulikunitz/xz v0.5.12 0.5.15
CVE-2025-47914 🟡 MEDIUM golang.org/x/crypto v0.35.0 0.45.0
CVE-2025-58181 🟡 MEDIUM golang.org/x/crypto v0.35.0 0.45.0
CVE-2025-61730 🟡 MEDIUM stdlib v1.24.11 1.24.12, 1.25.6
CVE-2026-27142 🟡 MEDIUM stdlib v1.24.11 1.25.8, 1.26.1
CVE-2026-32282 🟡 MEDIUM stdlib v1.24.11 1.25.9, 1.26.2
CVE-2026-32288 🟡 MEDIUM stdlib v1.24.11 1.25.9, 1.26.2
CVE-2026-32289 🟡 MEDIUM stdlib v1.24.11 1.25.9, 1.26.2
CVE-2026-33997 🟡 MEDIUM github.com/docker/docker v28.5.2+incompatible 29.3.1
CVE-2026-41506 🟡 MEDIUM github.com/go-git/go-git/v5 v5.17.2 5.18.0
CVE-2026-27139 🔵 LOW stdlib v1.24.11 1.25.8, 1.26.1
⚓ Grype Scanner (0 findings, 0 unique)

✅ No vulnerabilities detected by Grype

🟡 scanner-bandit - 1 vulnerabilities (1 unique)

Image: ghcr.io/huntridge-labs/argus/scanner-bandit:c7089b8b1f4ca0a2215777b728ce93316245b7c2

Combined (Deduplicated)

🚨 Critical ⚠️ High 🟡 Medium 🔵 Low Total Unique
0 0 1 0 1 1
🔷 Trivy Scanner (1 findings, 1 unique)
CVE Severity Package Version Fixed
CVE-2026-3219 🟡 MEDIUM pip 26.0.1 N/A
⚓ Grype Scanner (0 findings, 0 unique)

✅ No vulnerabilities detected by Grype

⚠️ scanner-opengrep - 113 vulnerabilities (49 unique)

Image: ghcr.io/huntridge-labs/argus/scanner-opengrep:c7089b8b1f4ca0a2215777b728ce93316245b7c2

Combined (Deduplicated)

🚨 Critical ⚠️ High 🟡 Medium 🔵 Low Total Unique
0 7 41 63 113 49
🔷 Trivy Scanner (113 findings, 48 unique)
CVE Severity Package Version Fixed
CVE-2026-4878 ⚠️ HIGH libcap2 1:2.75-10+b8 N/A
CVE-2025-69720 ⚠️ HIGH libncursesw6 6.5+20250216-2 N/A
CVE-2026-29111 ⚠️ HIGH libsystemd0 257.9-1~deb13u1 N/A
CVE-2025-69720 ⚠️ HIGH libtinfo6 6.5+20250216-2 N/A
CVE-2026-29111 ⚠️ HIGH libudev1 257.9-1~deb13u1 N/A
CVE-2025-69720 ⚠️ HIGH ncurses-base 6.5+20250216-2 N/A
CVE-2025-69720 ⚠️ HIGH ncurses-bin 6.5+20250216-2 N/A
CVE-2026-27456 🟡 MEDIUM bsdutils 1:2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM bsdutils 1:2.41-5 N/A
CVE-2026-27456 🟡 MEDIUM libblkid1 2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM libblkid1 2.41-5 N/A
CVE-2026-4046 🟡 MEDIUM libc-bin 2.41-12+deb13u2 N/A
CVE-2026-4437 🟡 MEDIUM libc-bin 2.41-12+deb13u2 N/A
CVE-2026-4438 🟡 MEDIUM libc-bin 2.41-12+deb13u2 N/A
CVE-2026-5435 🟡 MEDIUM libc-bin 2.41-12+deb13u2 N/A
CVE-2026-5450 🟡 MEDIUM libc-bin 2.41-12+deb13u2 N/A
CVE-2026-5928 🟡 MEDIUM libc-bin 2.41-12+deb13u2 N/A
CVE-2026-4046 🟡 MEDIUM libc6 2.41-12+deb13u2 N/A
CVE-2026-4437 🟡 MEDIUM libc6 2.41-12+deb13u2 N/A
CVE-2026-4438 🟡 MEDIUM libc6 2.41-12+deb13u2 N/A
CVE-2026-5435 🟡 MEDIUM libc6 2.41-12+deb13u2 N/A
CVE-2026-5450 🟡 MEDIUM libc6 2.41-12+deb13u2 N/A
CVE-2026-5928 🟡 MEDIUM libc6 2.41-12+deb13u2 N/A
CVE-2026-27456 🟡 MEDIUM liblastlog2-2 2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM liblastlog2-2 2.41-5 N/A
CVE-2026-34743 🟡 MEDIUM liblzma5 5.8.1-1 N/A
CVE-2026-27456 🟡 MEDIUM libmount1 2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM libmount1 2.41-5 N/A
CVE-2026-27456 🟡 MEDIUM libsmartcols1 2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM libsmartcols1 2.41-5 N/A
CVE-2026-40225 🟡 MEDIUM libsystemd0 257.9-1~deb13u1 N/A
CVE-2026-40226 🟡 MEDIUM libsystemd0 257.9-1~deb13u1 N/A
CVE-2026-4105 🟡 MEDIUM libsystemd0 257.9-1~deb13u1 N/A
CVE-2026-40225 🟡 MEDIUM libudev1 257.9-1~deb13u1 N/A
CVE-2026-40226 🟡 MEDIUM libudev1 257.9-1~deb13u1 N/A
CVE-2026-4105 🟡 MEDIUM libudev1 257.9-1~deb13u1 N/A
CVE-2026-27456 🟡 MEDIUM libuuid1 2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM libuuid1 2.41-5 N/A
CVE-2026-27456 🟡 MEDIUM login 1:4.16.0-2+really2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM login 1:4.16.0-2+really2.41-5 N/A
CVE-2026-27456 🟡 MEDIUM mount 2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM mount 2.41-5 N/A
CVE-2026-5958 🟡 MEDIUM sed 4.9-2 N/A
CVE-2026-5704 🟡 MEDIUM tar 1.35+dfsg-3.1 N/A
CVE-2026-27456 🟡 MEDIUM util-linux 2.41-5 N/A
CVE-2026-3184 🟡 MEDIUM util-linux 2.41-5 N/A
CVE-2026-27171 🟡 MEDIUM zlib1g 1:1.3.dfsg+really1.3.1-1+b1 N/A
CVE-2026-3219 🟡 MEDIUM pip 26.0.1 N/A
CVE-2011-3374 🔵 LOW apt 3.0.3 N/A
TEMP-0841856-B18BAF 🔵 LOW bash 5.2.37-2+b8 N/A

...and 63 more

⚓ Grype Scanner (0 findings, 0 unique)

✅ No vulnerabilities detected by Grype

⚠️ scanner-supply-chain - 8 vulnerabilities (8 unique)

Image: ghcr.io/huntridge-labs/argus/scanner-supply-chain:c7089b8b1f4ca0a2215777b728ce93316245b7c2

Combined (Deduplicated)

🚨 Critical ⚠️ High 🟡 Medium 🔵 Low Total Unique
0 4 4 0 8 8
🔷 Trivy Scanner (8 findings, 8 unique)
CVE Severity Package Version Fixed
CVE-2026-32280 ⚠️ HIGH stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32281 ⚠️ HIGH stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32283 ⚠️ HIGH stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-33810 ⚠️ HIGH stdlib v1.26.1 1.26.2
CVE-2026-3219 🟡 MEDIUM pip 26.0.1 N/A
CVE-2026-32282 🟡 MEDIUM stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32288 🟡 MEDIUM stdlib v1.26.1 1.25.9, 1.26.2
CVE-2026-32289 🟡 MEDIUM stdlib v1.26.1 1.25.9, 1.26.2
⚓ Grype Scanner (0 findings, 0 unique)

✅ No vulnerabilities detected by Grype


Generated by Argus

@eFAILution eFAILution merged commit d7c94dc into feat/argus-portability May 5, 2026
21 checks passed
@eFAILution eFAILution deleted the fix/grype-prefix-collision branch May 5, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant