feat(scan): leave test data (fixtures, testdata) out of the whole scan
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 3m51s
CI / Check (pull_request) Failing after 4m14s

A repository's fixtures are not what it ships, but every stage scanned
them as product code: our own repo got 211 CVE issues from sample
lockfiles (struts2 2.3.30, spring 5.0.0, urllib3 1.24.1) and 20 high
code issues from sample code under fixtures/.

Directories named fixtures, __fixtures__, testdata, test_data, test-data,
test-fixtures or test_fixtures (at any depth, top-most only, never the
tree itself, never through a link) now leave the scan's working copy
before the first stage, so no stage reports them: no code findings, no
SBOM components, no CVEs. tests/, spec/ and examples/ are scanned as
before.

- Only a working copy under the clone or artifact directories is pruned;
  anything else is refused. The git fetch now checks out with
  recreate_missing, and an upload is unpacked again every scan, so the
  directories come back before the next scan applies the current rules.
- The run notes what was left out (SkipCode::TestData, stage test_data).
- Findings an earlier scan stored there close as NowTestData, with their
  own issue comment, not as fixed.
- CVE issues of the removed components close on the next complete scan,
  as for a removed dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-11-04 08:53:01 +01:00
1 parent 3300bb1851
commit 5d6737ecd8
11 files changed
+421 -12

No files matched your search

+7
View File
@@ -24,6 +24,12 @@ names while the scan runs.
(out-of-bounds writes, uninitialised reads, null dereferences). Vendor and
third-party code (HAL, CMSIS, vendored libraries) is left out of the code
findings and listed under **Nicht ausgeführt**; it stays in the SBOM.
Test data is left out of the whole scan before this step: directories named
`fixtures`, `__fixtures__`, `testdata`, `test_data`, `test-data`,
`test-fixtures` or `test_fixtures` (at any depth) hold sample projects and
lockfiles that are not what the product ships, so they produce no code
findings, no SBOM components and no CVEs. `tests/`, `spec/` and
`examples/` are scanned as usual.
3. **Build the SBOM** (*SBOM erstellen*) -- the components from lockfiles
(Syft), plus libraries copied into a firmware tree (FreeRTOS, FreeRTOS+TCP,
lwIP, Mbed TLS, wolfSSL, FatFs), whose versions are read from their headers.
@@ -154,6 +160,7 @@ as a clean result: the CRA requirements it checks show as **Nicht geprüft**.
| e.g. **Dynamische Prüfung (DAST)**, **Penetrationstest**, **Industrieprotokolle (ICS)**, **SPS-Laufzeittest** | In dieser Umgebung nicht aktiviert. | Nothing. This deployment does not run the step. |
| **Git-Submodule** | Nicht ausgecheckt, daher nicht geprüft: *(names)* | Change SSH submodule URLs to HTTPS; see [Git Submodules](/guide/repositories#git-submodules). |
| **Herstellercode (HAL, CMSIS, Drittanbieter)** | Hersteller- und Fremdcode ohne Codeanalyse, in der Stückliste enthalten: *(directories)* | Nothing; for information. |
| **Testdaten (fixtures, testdata)** | Testdaten, von der ganzen Prüfung ausgenommen (Codeanalyse, Stückliste, CVEs): *(directories)* | Nothing; for information. Findings an earlier scan reported there are closed as test data. |
| e.g. **Statische Codeanalyse (Semgrep)**, **C/C++-Analyse (cppcheck)** | *(tool)* wurde nicht fertig; was es prüft, gilt als nicht bewertet. | Start the scan again; if it recurs, contact support. |
| **Abhängigkeiten (SBOM)** | *(manifest)* ohne Lockfile: Die Versionen der Abhängigkeiten und ihre CVEs sind nicht bekannt. | Commit the lockfile (see below). |
| e.g. **Firmware-Binäranalyse**, **Container-Analyse**, **Mobile-App-Analyse** | e.g. Firmware-Images werden noch nicht entpackt … | Nothing analyses these files yet; scan the source code instead. |