4.2 KiB
4.2 KiB
Ecosystem Reality Acceptance Test Fixtures
Module
Scanner
Status
PARTIALLY_IMPLEMENTED
Description
Maps five specific real-world production incidents (credential leak, offline DB schema mismatch, SBOM parity drift, scanner instability, ecosystem-specific SCA failure) into deterministic acceptance test fixtures. Each fixture reproduces the incident scenario end-to-end with frozen inputs and expected outputs, ensuring the scanner does not regress on previously observed production failures.
What's Implemented
- SCA Failure Catalogue:
src/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Node.Tests/- Node.js SCA test fixtures covering package resolution edge casessrc/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Ruby.Tests/- Ruby SCA test fixtures covering Gemfile.lock parsingsrc/Scanner/__Tests/StellaOps.Scanner.Analyzers.Lang.Java.Tests/- Java SCA test fixtures covering Maven/Gradle dependency resolution
- SmartDiff Golden Fixtures:
src/Scanner/__Tests/StellaOps.Scanner.SmartDiff.Tests/- Deterministic golden fixture tests for diff-aware rescanning, covering expected SBOM delta outputs
- Determinism Infrastructure:
- Existing test projects use frozen fixture files (JSON SBOMs, lock files, manifest files) as inputs with expected output assertions
What's Missing
- Incident-to-Test Mapping: No structured mapping from five specific real-world incidents to dedicated test fixtures:
- Credential Leak Incident: No fixture reproducing a secret detection false-negative that led to a credential leak in production
- Offline DB Schema Mismatch: No fixture reproducing scanner behavior when the offline vulnerability database schema version mismatches the scanner version
- SBOM Parity Drift: No fixture reproducing divergence between container-scanned SBOM and source-scanned SBOM for the same artifact
- Scanner Instability: No fixture reproducing non-deterministic scanner output across repeated scans of the same image layer
- Ecosystem SCA Failure: No fixture reproducing ecosystem-specific SCA resolution failures (e.g., npm optional dependency with missing platform binary)
- Incident Metadata: No
incident.metadata.jsonfiles linking each fixture to its originating production incident (date, severity, root cause, fix) - Acceptance Test Runner: No dedicated CI job or test category for running ecosystem reality acceptance tests separately from unit tests
Implementation Plan
- Create
src/Scanner/__Tests/StellaOps.Scanner.EcosystemReality.Tests/project with five incident fixture directories - For each incident, create:
incident.metadata.json(date, severity, root cause), frozen input fixtures, expected output assertions - Implement credential leak fixture using a container layer with an embedded secret that was previously missed
- Implement offline DB schema mismatch fixture with mismatched vuln-db schema version headers
- Implement SBOM parity drift fixture with container vs. source scan inputs producing divergent SBOMs
- Implement scanner instability fixture verifying byte-identical output across 10 repeated scans
- Implement ecosystem SCA failure fixture with npm optional dependency edge case
- Add CI job category
ecosystem-realityfor running these acceptance tests
E2E Test Plan
- Run the credential leak incident fixture and verify the scanner now detects the previously-missed embedded secret in the container layer
- Run the offline DB schema mismatch fixture and verify the scanner produces a clear error or graceful degradation when vuln-db schema version does not match
- Run the SBOM parity drift fixture and verify the scanner flags divergence between container-scanned and source-scanned SBOMs for the same artifact
- Run the scanner instability fixture and verify byte-identical SBOM output across 10 repeated scans of the same frozen image layer
- Run the ecosystem SCA failure fixture and verify correct handling of npm optional dependencies with missing platform binaries
- Verify each fixture includes incident.metadata.json with date, severity, root cause, and link to the originating production incident
Related Documentation
- Source: See feature catalog
- Architecture:
docs/modules/scanner/architecture.md