Files
pruefwerk/docs/guide/repositories.md
T
sharangandClaude Opus 5.5 f5697ff21d
CI / Check (push) Skipped
CI / Agent integration (push) Skipped
CI / Detect Changes (push) Successful in 4s
CI / Deploy MCP (push) Successful in 58s
CI / Deploy Docs (push) Successful in 1m29s
CI / Deploy Dashboard (push) Successful in 6m12s
CI / Deploy Agent (push) Successful in 8m13s
feat(scan): record which components each scan added, updated or removed (#974) (#975)
Before a stage replaces its part of a target's SBOM (the code SBOM, the
CODESYS libraries, the firmware components), the entries it replaces are
compared with the new ones and the changes are added to the scan run
(`component_changes`, at most 5000; `None` on runs from before). A
component is its package manager and name; one version before and one
after is an update, otherwise each new version an addition and each gone
one a removal.

The Verlauf API joins them with the scan's CVEs: a new CVE goes with the
component now at its version, a gone one with the component that was at
its version, and what no change explains is an advisory row. The scan's
drill-down shows the mockup's table (neu / aktualisiert / entfernt / neue
Advisory, version before → after, CVEs +n −m) above the CVE list; scans
from before say the components were not recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 10:18:01 +00:00

311 lines
16 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Adding Targets
A target (*Prüfobjekt*) is a product or component that Prüfwerk scans: a
firmware, a PLC program or an application. It holds one or more artifacts
(*Artefakte*): the git repository or uploaded files the scans work on. Findings,
the SBOM and the CRA status all belong to a target.
## The Targets List
**Prüfobjekte** (Targets) in the sidebar lists all targets:
| Column | Description |
|--------|-------------|
| **Name** | The target's name, with its type beneath. A click on the row or the name opens the target's page. |
| **Letzte Prüfung** (Last scan) | Status of the last scan and how long ago it was; for a running scan also its current step. **Noch nicht geprüft** before the first scan. |
| **CRA-Stand** (CRA status) | A bar showing how the target stands against the 40 CRA Annex I requirements. |
| **Befunde** (Findings) | The number of findings; a click opens the findings list filtered to this target. |
| *(actions)* | **Prüfung starten** (Run scan) |
The list refreshes on its own while a scan is running. **+ Prüfobjekt anlegen**
above the list opens the wizard. An empty list also offers the demo targets
(see [Demo-Prüfobjekte](/guide/demo-targets)).
## Adding a Target
Click **Neues Prüfobjekt** in the sidebar (or **+ Prüfobjekt anlegen** on the
**Prüfobjekte** page). The wizard **Prüfobjekt anlegen** has four steps:
**Typ**, **Artefakte**, **Prüfen**, **Fertig**.
### 1. Typ (Target type)
Enter a **Name** and answer **Um welche Art von Software handelt es sich?**
(What kind of software is this?).
Under **Maschine und Gerät** (Machine and device):
| Type | For |
|---|---|
| **SPS / PLC** | CODESYS, PLCopen XML, Structured Text (IEC 61131-3) |
| **Firmware — ohne Betriebssystem** | Microcontroller without an operating system, e.g. STM32 with HAL |
| **Firmware — RTOS** | FreeRTOS, Zephyr and other real-time operating systems |
| **Embedded Linux / Yocto** (preview) | BSP + image. Today a scan covers secrets, malware and SAST over patches and files; there is no recipe or image SBOM yet. See [Embedded Linux / Yocto](./yocto.md). |
Under **Weitere Software** (Other software): **Backend / API**,
**Webanwendung**, **Desktop-Anwendung**, **Android-App**, **iOS-App**.
### 2. Artefakte (Artifacts)
Under **Artefakte hinzufügen**, choose the **Art** (kind) of each artifact:
| Kind | How to add it |
|---|---|
| **Git-Repository** | Enter the HTTPS address under **Referenz (URL / Pfad / Text)** and, if needed, the **Branch**. For a private repository also fill in **Zugangstoken (nur für private Repositories)** and, if your host needs it, **Benutzername (optional)**. Then **+ Hinzufügen**. |
| **Quellcode-Archiv (zip, tar, tar.gz)** | Choose the **Datei** and click **+ Datei hinzufügen**. |
| **SPS-Projekt** | Choose the file and its **Format**: PLCopen XML, Structured Text or Project archive (`.projectarchive`), then **+ Datei hinzufügen**. The format is preselected from the file name. |
| **Firmware-Image** | Choose the file and click **+ Datei hinzufügen**. Images are not unpacked yet; scan the firmware's sources to get findings and components. |
| **Mobile-Paket (APK/IPA)** | Choose the file and click **+ Datei hinzufügen**. App packages are not analysed yet. |
| **Container-Image**, **Beschreibung (Text)** | Enter the reference or text under **Referenz (URL / Pfad / Text)**. |
| **Live-URL** | The address of a running device or web interface. Not available in a deployment that scans source code only. |
A target can have several artifacts, for example the firmware and the PLC
program of one machine. Files can be up to 512 MB.
**Archives:**
- zip, tar and tar.gz are accepted.
- **Password-protected zip archives** are accepted. After adding the file, enter
its password in the field **Archiv-Passwort (nur bei passwortgeschützten
Archiven)** next to it. If you do not have it at hand, the target is still
created; enter the password later under **Bearbeiten** on the target's page
(the archive shows **Passwort fehlt** until then).
- **7z and RAR archives are refused** when uploaded: "7z- und RAR-Archive werden
nicht unterstützt. Bitte als zip, tar oder tar.gz hochladen."
For a PLC project, the wizard explains which files to use; see
[SPS / PLC (CODESYS)](/guide/plc).
### 3. Prüfen (Review)
The step shows the name, type and artifacts once more. Click
**Anlegen und prüfen** (Create and scan): Prüfwerk creates the target, uploads
the files and starts the first scan.
### 4. Fertig (Done)
The last step says the target was created and shows the **Erkannter Typ**
(detected type), if detection suggests one. Below it:
- **Fortschritt** -- the running first scan.
- **Anwendbare Prüfungen** -- which scans apply to this target, and why the
others do not.
- **Optionale Prüfungen** -- scans that apply but are off by default because
they touch a running device. Not shown where only source code is scanned.
**Zu den Befunden**, **Zu den Prüfobjekten** and **Weiteres Prüfobjekt
anlegen** lead on.
If a file did not arrive, the wizard says **Hochladen fehlgeschlagen** and does
not start the scan; add the file again under **Bearbeiten** on the target's page.
## Private Repositories
**Public repositories** can be cloned using an HTTPS URL with no additional setup.
**Private repositories** are cloned over HTTPS with a token you supply. Enter the
repository's HTTPS URL and a read-only token in **Zugangstoken (nur für private
Repositories)**. The token is stored encrypted and never shown again.
### Creating a Token
1. Create a read-only token in your Git hosting provider, scoped to the repository you are onboarding:
- **GitHub**: Settings > Developer settings > Personal access tokens (fine-grained), repository access limited to that repository, *Contents: Read-only*
- **GitLab**: Repository Settings > Repository > Deploy tokens, scope `read_repository`
- **Gitea**: Settings > Applications > Access tokens, scope `read:repository`
2. Add the repository in Prüfwerk with its **HTTPS** URL
3. Paste the token into **Zugangstoken (nur für private Repositories)**
::: warning SSH URLs are not supported
`ssh://…` and `git@host:org/repo.git` URLs are rejected. Each tenant's token belongs to that tenant only; there is no shared platform deploy key, and adding one would mean every tenant's clones authenticating as the same identity. Per-tenant SSH keys are planned for a later release.
:::
::: tip
Scope the token to a single repository and to read-only access. That is the smallest credential that lets Prüfwerk clone your code.
:::
## Git Submodules
Yes: repositories with submodules are scanned **including their submodules**.
Firmware projects usually pull their HAL, RTOS or network stack in as
submodules, and without them the scan would miss code your product ships.
- **Checked out automatically.** After cloning, Prüfwerk checks out every
submodule listed in `.gitmodules`, and their submodules, up to **three
levels** deep. Relative URLs (`../lib.git`) are resolved against the
repository's own URL, as git does.
- **Same rules as the repository.** Each submodule URL must be HTTPS and on a
publicly reachable host. SSH URLs (`git@host:…`, `ssh://…`) are refused.
- **Your token stays on your host.** The repository's token is only sent to
submodules on the **same host** as the repository. Submodules elsewhere
(for example public GitHub projects) are fetched without credentials, so
a private submodule on another host cannot be fetched.
- **Nothing is skipped silently.** A submodule that is refused or cannot be
fetched is left out, and the scan run lists it under **Nicht
ausgeführt** (Not run) with its name and the reason.
- **Third-party code.** Vendor directories (for example `Middlewares/`,
`Drivers/`, `CMSIS/`, `third_party/`) and well-known libraries such as
FreeRTOS, lwIP, Mbed TLS or wolfSSL are left out of the static code
analysis, since that is not your code. They still appear in the
software bill of materials and are checked for known vulnerabilities.
A repository with many submodules can take several minutes to clone the first
time. While it does, the scan shows **Projekt erkennen · Submodule holen**.
Later scans reuse the checkout and only fetch what changed.
::: tip SSH submodule URLs
If your `.gitmodules` uses SSH URLs, change them to their HTTPS form, e.g.
`git@github.com:org/lib.git` becomes `https://github.com/org/lib.git`.
:::
## Large Repositories and Git LFS
A clone or fetch may take up to **30 minutes** and download up to **4 GB**.
A repository beyond that ends the scan with a message saying which limit it
hit; the operator can raise both (`GIT_CLONE_TIMEOUT_SECS`,
`GIT_CLONE_MAX_MB`). The full history is cloned, so the secret scan also finds
secrets in earlier commits.
Files kept in **Git LFS** (`filter=lfs` in `.gitattributes`) are not
downloaded: they are usually binary assets (graphics, 3D models, libraries)
that the scanners do not read. The scan run lists the LFS patterns under
**Nicht ausgeführt** as **Git-LFS-Dateien**, so it stays visible that their
content was not checked.
## The Target's Page
A click on a target in the **Prüfobjekte** list opens its page. Above it, the
breadcrumb leads back to **Überblick** and names the target's projects. At the
top are its name, type and artifacts, and two buttons:
- **Alle Ansichten** (All views) -- the target's views, see below.
- **N heute zu entscheiden** (N to decide today) -- opens **Heute** with this
target's decisions; it reads **Heute nichts zu entscheiden** when there are
none.
Below them, the tools:
- **Prüfung starten** (Run scan) -- starts a scan now.
- **Nachweispaket herunterladen** (Download evidence pack) -- a ZIP with the
OSCAL assessment (CRA Annex I), the SBOM (CycloneDX, SPDX), the findings
(JSON, CSV), the CVE alerts, the SBOM's quality score (`sbom-quality.json`,
once a scan has scored it) and a manifest with SHA-256 checksums.
- **Bearbeiten** (Edit) -- see below.
- **Löschen** (Delete) -- see below.
Below them:
- The target's open critical and high CVEs with a fix and its open critical and
high findings, each with a link to the list behind it, and a chart of the
open CVEs with a fix over the last 30 days (as on the
[overview](/features/overview)).
- **Wo handeln** (Where to act) -- the package updates that close the most open
CVEs with a fix: the package, its current version, the highest version the
advisories name as fixed, and how many CVEs (and critical ones) the update
closes.
- **CRA-Stand** -- the target's standing against the CRA; **Stand je
Anforderung** opens the status of each requirement.
- **Stückliste** -- the number of components and of known vulnerabilities (CVE);
the arrow opens the **Stückliste** filtered to this target.
- **Offene Befunde** -- the most severe open findings; **Alle Befunde dieses
Prüfobjekts** opens the full list.
- **Prüfläufe** -- the scan runs, see [Prüfungen](/guide/scanning).
- **Prüfumfang** (What is checked) -- the applicable scans and the
**Erkannte Merkmale** (detected facts) about the code.
- **Befunde aus manuellen Tests** -- findings from penetration tests or DAST
runs, entered by hand or imported; see
[Befunde aus manuellen Tests](/guide/manual-findings).
### The target's views
**Alle Ansichten** opens six tabs, each with a figure beside its name. Every
view starts with a chart; a click on a bar, a cell or a tile opens the list
behind it, already narrowed, and the address holds the selection, so a link
opens the same view.
| Tab | Chart | A click opens |
|-----|-------|---------------|
| **Befunde** (Findings) | Open findings by type, stacked by severity, and where they lie by folder | The findings list filtered to that type, severity or folder |
| **CVEs & VEX** | The CVEs by severity and VEX status | The CVEs of that cell |
| **Komponenten** (Components) | The updates that remove the most CVEs, and the components per ecosystem | The update's CVEs, or the **Stückliste** filtered to the ecosystem |
| **Lizenzen** (Licences) | The components per licence group | The licences of that group and the components using each |
| **CRA Annex I** | The 40 requirements as tiles, coloured by state and marked: **!** findings assigned, **?** not checked, **~** partly checked, **OK** checked without findings, **–** not checkable in code | The requirement with its state, the findings against it and the reason |
| **Verlauf** (History) | Per scan, the CVEs it found new above the line and those it found gone below it, and the scan's status | What the scan changed: the components it added, updated or removed with the CVEs each brought and took, and each CVE new or gone with component, version and severity |
The figure beside **CRA Annex I** counts the requirements checked without a
finding, of all 40.
In **Verlauf**, a scan's window runs from the end of the completed scan before
it to its own end: a CVE counts as new in the window it was found in, and as
gone in the window a complete scan no longer found it. The target's first
complete scan is marked **Start**; what it found is the starting point, not a
change. A scan that did not complete changes nothing, so CVEs found in the
meantime (by the daily CVE check, say) count for the next complete scan.
A scan's components are compared with the SBOM stored before it: one version
of a component before and another after is **aktualisiert** (updated), a new
component or version **neu**, one no longer there **entfernt** (removed). A
new CVE goes with the component now at its version, a gone one with the
component that was at its version. A CVE that came or went while its
component stayed the same reads **neue Advisory** or **Advisory entfällt**.
At most 5000 component changes are kept per scan. Scans from before
Prüfwerk recorded this show their CVEs only and say so.
## Editing a Target
**Bearbeiten** on the target's page opens **Prüfobjekt bearbeiten**. There you
can:
- change the **Name** and the **Typ**;
- add artifacts (for a repository with its **Branch**) or remove them;
- set a new access token (**Neues Token (leer lassen, um es zu behalten)**) or
remove it (**Token entfernen**);
- enter or change the password of a password-protected archive;
- upload another file under **Datei hinzufügen**: an archive (zip, tar, tar.gz),
a PLC project or a firmware image. It is uploaded at once and checked by the
next scan;
- leave directories or files out of every scan under **Von der Prüfung
ausgenommen** (see below).
Click **Speichern** (Save) to keep the changes. Changes take effect with the next
scan.
### Leaving Paths out of the Scan
Under **Von der Prüfung ausgenommen**, enter one directory or file per line,
relative to the root of the repository or archive, for example `docs/samples`
or `tools/legacy.py`. A directory is left out with everything in it. Wildcards
are not supported, and a path must stay inside the tree (no leading `/`, no
`..`, not `.git`); at most 50 paths.
What is left out produces nothing: no code findings, no SBOM components and no
CVEs. The scan run lists it under **Ausgenommene Pfade**, together with any
path that was not found in the tree. Findings an earlier scan reported there
are closed with the reason that the path is now excluded, and so are their
issues. Test data (`fixtures`, `testdata` and similar) is left out
automatically; see [Scanning](/guide/scanning).
Through the API, send the list as `scan_config.exclude_paths` with
`PATCH /api/v1/targets/{id}`. It replaces the stored list; an invalid path is
refused with 422 and a message naming it.
## Connecting an Issue Tracker
New findings can be created as issues in GitHub, GitLab, Gitea or Jira. The
dashboard has no settings for this yet: the tracker is configured per target
through the API, with `PATCH /api/v1/targets/{id}` and a
`scan_config.issue_tracker` object with `tracker_type` (`github`, `gitlab`,
`gitea` or `jira`), `owner`, `repo` and `token`. The token is stored encrypted
and never returned. Created issues appear under **Tickets** in the sidebar and
on each finding's page under **Verknüpftes Ticket**. See
[Issues & Tracking](/guide/issues).
## Deleting a Target
**Löschen** on the target's page asks for confirmation: "Damit werden das
Prüfobjekt und seine Befunde, SBOM-Einträge, Prüfläufe und CVE-Warnungen
endgültig entfernt." (This permanently removes the target and its findings,
SBOM entries, scan runs and CVE alerts.) Its uploaded files, tracker-issue
records and code graph are removed too.
This cannot be undone.