feat(help): readable assistant answers, German UI, and docs that match the pilot product (#424)
CI / Detect Changes (push) Successful in 3s
CI / Deploy Docs (push) Successful in 1m20s
CI / Deploy Dashboard (push) Successful in 5m34s
CI / Deploy MCP (push) Successful in 4m26s
CI / Deploy Agent (push) Successful in 7m24s
CI / Check (push) Skipped

This commit was merged in pull request #424.
This commit is contained in:
sharang committed 2026-09-28 22:39:06 +00:00
1 parent 99f0bb33e9
commit 6d8e63c226
26 files changed
+1255 -641

No files matched your search

+3 -2
View File
@@ -176,8 +176,9 @@ jobs:
echo "Changed files:"
echo "$CHANGED"
# Agent: core libs, agent code, agent Dockerfile
if echo "$CHANGED" | grep -qE '^(compliance-core/|compliance-agent/|compliance-graph/|compliance-dast/|Dockerfile\.agent|Cargo\.(toml|lock))'; then
# Agent: core libs, agent code, agent Dockerfile, and the docs and
# README the help assistant answers from (baked into the image)
if echo "$CHANGED" | grep -qE '^(compliance-core/|compliance-agent/|compliance-graph/|compliance-dast/|Dockerfile\.agent|Cargo\.(toml|lock)|docs/|README\.md)'; then
echo "agent=true" >> "$GITHUB_OUTPUT"
else
echo "agent=false" >> "$GITHUB_OUTPUT"
Generated
+19
View File
@@ -762,6 +762,7 @@ dependencies = [
"hex",
"js-sys",
"mongodb",
"pulldown-cmark",
"rand 0.9.2",
"reqwest",
"secrecy",
@@ -4367,6 +4368,24 @@ dependencies = [
"psl-types",
]
[[package]]
name = "pulldown-cmark"
version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9f068eba8e7071c5f9511831b44f32c740d5adf574e990f946ddb53db2f314e"
dependencies = [
"bitflags",
"memchr",
"pulldown-cmark-escape",
"unicase",
]
[[package]]
name = "pulldown-cmark-escape"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "007d8adb5ddab6f8e3f491ac63566a7d5002cc7ed73901f72057943fa71ae1ae"
[[package]]
name = "quinn"
version = "0.11.9"
+29 -17
View File
@@ -176,43 +176,55 @@ The agent exposes a REST API on port 3001:
|--------|----------|-------------|
| `GET` | `/api/v1/health` | Health check |
| `GET` | `/api/v1/stats/overview` | Summary statistics and trends |
| `GET` | `/api/v1/repositories` | List tracked repositories |
| `POST` | `/api/v1/repositories` | Add a repository to track |
| `POST` | `/api/v1/repositories/:id/scan` | Trigger a manual scan |
| `GET` | `/api/v1/targets` | List targets (Prüfobjekte), each with its newest scan run |
| `POST` | `/api/v1/targets` | Create a target |
| `GET` / `PATCH` / `DELETE` | `/api/v1/targets/{id}` | Read, update (name, type, artifacts, `scan_config` incl. `issue_tracker`) or delete a target |
| `POST` | `/api/v1/targets/{id}/artifacts` | Add a git repository, URL or text artifact |
| `POST` | `/api/v1/targets/{id}/artifacts/upload` | Upload a file artifact (multipart, up to 512 MiB) |
| `PUT` | `/api/v1/targets/{id}/artifacts/{artifact_id}/archive-password` | Set the password of a password-protected archive |
| `POST` | `/api/v1/targets/{id}/scan` | Trigger a manual scan |
| `GET` | `/api/v1/targets/{id}/compliance` | CRA Annex I status of a target |
| `GET` | `/api/v1/targets/{id}/evidence-pack` | Evidence pack (ZIP) |
| `POST` | `/api/v1/targets/{id}/findings` | Add a finding from a manual test |
| `POST` | `/api/v1/targets/{id}/findings/import` | Import SARIF 2.1.0 or ZAP JSON |
| `GET` | `/api/v1/findings` | List findings (filterable) |
| `GET` | `/api/v1/findings/:id` | Get finding with code evidence |
| `PATCH` | `/api/v1/findings/:id/status` | Update finding status |
| `GET` | `/api/v1/findings/{id}` | Get finding with code evidence |
| `PATCH` | `/api/v1/findings/{id}/status` | Update finding status (with `reason` where required) |
| `PATCH` | `/api/v1/findings/bulk-status` | Update the status of several findings |
| `GET` | `/api/v1/sbom` | List dependencies |
| `GET` | `/api/v1/sbom/export` | Export a target's SBOM (CycloneDX 1.5 or SPDX 2.3) |
| `GET` | `/api/v1/issues` | List cross-tracker issues |
| `GET` | `/api/v1/scan-runs` | Scan execution history |
| `GET` | `/api/v1/graph/:repo_id` | Code knowledge graph |
| `POST` | `/api/v1/graph/:repo_id/build` | Trigger graph build |
| `GET` | `/api/v1/graph/{repo_id}` | Code knowledge graph |
| `POST` | `/api/v1/graph/{repo_id}/build` | Trigger graph build |
| `GET` | `/api/v1/dast/targets` | List DAST targets |
| `POST` | `/api/v1/dast/targets` | Add DAST target |
| `GET` | `/api/v1/dast/findings` | List DAST findings |
| `POST` | `/api/v1/chat/:repo_id` | RAG-powered code chat |
| `POST` | `/api/v1/chat/{repo_id}` | RAG-powered code chat |
| `POST` | `/api/v1/help/chat` | Documentation-grounded help chat |
| `POST` | `/api/v1/pentest/sessions` | Create pentest session |
| `POST` | `/api/v1/pentest/sessions/:id/export` | Export encrypted pentest report |
| `POST` | `/webhook/github` | GitHub webhook (HMAC-SHA256) |
| `POST` | `/webhook/gitlab` | GitLab webhook (token verify) |
| `POST` | `/webhook/gitea` | Gitea webhook |
| `POST` | `/api/v1/pentest/sessions/{id}/export` | Export encrypted pentest report |
| `POST` | `/webhook/{tenant_id}/github/{repo_id}` | GitHub webhook (HMAC-SHA256) |
| `POST` | `/webhook/{tenant_id}/gitlab/{repo_id}` | GitLab webhook (token verify) |
| `POST` | `/webhook/{tenant_id}/gitea/{repo_id}` | Gitea webhook |
## Dashboard Pages
| Page | Description |
|------|-------------|
| **Overview** | Stat cards, severity distribution, AI chat cards, MCP status |
| **Repositories** | Add/manage tracked repos, trigger scans, webhook config |
| **Findings** | Filterable table by severity, type, status, scanner |
| **Finding Detail** | Code evidence, remediation, suggested fix, linked issue |
| **Übersicht** (Overview) | Figures, CRA status by target, most severe open findings; AI chat and MCP cards outside source-only deployments |
| **Prüfobjekte** (Targets) | Targets with last scan, CRA status and findings; **Prüfung starten** |
| **Neues Prüfobjekt** (Onboard) | Wizard: type, artifacts (git, zip/tar/tar.gz, PLC project, firmware image), review, first scan |
| **Target page** | CRA status, SBOM figures, open findings, scan runs, edit, evidence pack, manual findings |
| **Findings** | Filterable table by target, severity, type, status |
| **Finding Detail** | Code evidence, CRA refs, remediation, status with reason and history, linked issue |
| **SBOM** | Dependency inventory with vulnerability badges, license summary |
| **Issues** | Cross-tracker view (GitHub + GitLab + Jira + Gitea) |
| **Code Graph** | Interactive architecture visualization, impact analysis |
| **AI Chat** | RAG-powered Q&A about repository code |
| **DAST** | Dynamic scanning targets, findings, and scan history |
| **Pentest** | AI-driven pentest sessions, attack chain visualization |
| **MCP Servers** | Model Context Protocol server management |
| **MCP Servers** | Model Context Protocol server management (reached from the overview's MCP card; no sidebar entry) |
| **Help Chat** | Floating assistant (available on every page) for product Q&A |
## Project Structure
+46 -19
View File
@@ -47,7 +47,19 @@ fn find_project_root(start: &Path) -> Option<PathBuf> {
}
}
/// Read README.md + all docs/**/*.md (excluding node_modules).
/// Directories under `docs/` that are not customer documentation: internal
/// design notes (left out of the site by `srcExclude` too), the site's own
/// config, and dependencies.
const UNPUBLISHED_DOCS: &[&str] = &["design", ".vitepress", "node_modules"];
/// Whether `rel` (a path relative to `docs/`) is part of the published docs,
/// so the assistant answers only from what customers can read.
fn is_published(rel: &Path) -> bool {
!rel.components()
.any(|c| UNPUBLISHED_DOCS.iter().any(|dir| c.as_os_str() == *dir))
}
/// Read README.md + the published docs/**/*.md.
fn load_docs(root: &Path) -> String {
let mut parts: Vec<String> = Vec::new();
@@ -56,15 +68,12 @@ fn load_docs(root: &Path) -> String {
parts.push(format!("<!-- file: README.md -->\n{content}"));
}
// docs/**/*.md, skipping node_modules
for entry in WalkDir::new(root.join("docs"))
// docs/**/*.md as the docs site publishes them
let docs = root.join("docs");
for entry in WalkDir::new(&docs)
.follow_links(false)
.into_iter()
.filter_entry(|e| {
!e.path()
.components()
.any(|c| c.as_os_str() == "node_modules")
})
.filter_entry(|e| e.path().strip_prefix(&docs).is_ok_and(is_published))
.filter_map(|e| e.ok())
{
let path = entry.path();
@@ -171,21 +180,23 @@ pub async fn help_chat(
let context = doc_context();
let system_prompt = if context.is_empty() {
"You are a helpful assistant for the Compliance Scanner project. \
Answer questions about how to use and configure it. \
No documentation was loaded at startup, so rely on your general knowledge."
"You are the help assistant of Prüfwerk, BreakPilot's security and CRA \
compliance scanner. Answer questions about how to use it, in the language \
the question is asked in. No documentation was loaded, so say when you are \
unsure rather than guessing."
.to_string()
} else {
format!(
"You are a helpful assistant for the Compliance Scanner project. \
Answer questions about how to use, configure, and understand it \
using the documentation below as your primary source of truth.\n\n\
"You are the help assistant of Prüfwerk, BreakPilot's security and CRA \
compliance scanner. Answer questions about how to use, configure, and \
understand it using the documentation below as your source of truth.\n\n\
Rules:\n\
- Prefer information from the provided docs over general knowledge\n\
- Quote or reference the relevant doc section when it helps\n\
- If the docs do not cover the topic, say so clearly\n\
- Be concise — lead with the answer, then explain if needed\n\
- Use markdown formatting for readability\n\n\
- Answer in the language the question is asked in (usually German)\n\
- Lead with a direct answer (yes/no when the question allows), then the details\n\
- Prefer the docs over general knowledge; if they do not cover it, say so\n\
- Name the documentation page by its title, never by its file path\n\
- Keep it short: a few sentences or a short list, for a narrow chat panel\n\
- Use markdown (bold, lists, inline code); no tables, no HTML\n\n\
## Project Documentation\n\n{context}"
)
};
@@ -215,3 +226,19 @@ pub async fn help_chat(
page: None,
}))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn internal_design_notes_are_not_help_context() {
assert!(is_published(Path::new("guide/repositories.md")));
assert!(is_published(Path::new("")));
assert!(!is_published(Path::new(
"design/derive-checks-from-controls.md"
)));
assert!(!is_published(Path::new(".vitepress/theme/index.md")));
assert!(!is_published(Path::new("node_modules/x/README.md")));
}
}
@@ -150,8 +150,7 @@ fn build_sbom_blocking(
return Err(gap(
SkipCode::FirmwareUnresolved,
&format!(
"{} build detected, but no components could be resolved without building it; \
import a Firmwerk bundle for a complete firmware SBOM",
"{} build detected, but no components could be resolved without building it",
plan.provider
),
)
+4 -4
View File
@@ -16,13 +16,13 @@
use crate::models::{ArtifactKind, OnboardedTarget, ScanType, TargetType};
/// Why a firmware *image* is not analysed: the firmware path today is the source
/// tree (Firmwerk build-plan analysis) or an SBOM imported from a Firmwerk bundle.
/// tree (Firmwerk build-plan analysis).
const UNPACKING_IMAGES: &str =
"firmware images are not unpacked or analysed yet: scan the firmware sources, \
or import a Firmwerk bundle for the image";
"firmware images are not unpacked or analysed yet: scan the firmware sources \
instead";
const SBOM_FROM_IMAGE: &str =
"no SBOM is extracted from a firmware image yet: it comes from the firmware \
sources, or from an imported Firmwerk bundle";
sources";
const CVE_FROM_IMAGE: &str =
"CVE matching needs an SBOM, and none is extracted from a firmware image yet";
const CONTAINER_IMAGES: &str =
+2
View File
@@ -51,6 +51,8 @@ chrono = { workspace = true }
tracing = { workspace = true }
dioxus-logger = "0.6"
thiserror = { workspace = true }
# Renders the help assistant's markdown answers; no raw HTML passes through.
pulldown-cmark = { version = "0.13", default-features = false, features = ["html"] }
# Web-only
reqwest = { workspace = true, optional = true }
+93 -2
View File
@@ -3791,6 +3791,9 @@ tbody tr:last-child td {
font-size: 13px;
gap: 8px;
}
@media (max-width: 480px) {
.help-chat-panel { right: 16px; left: 16px; width: auto; bottom: 16px; height: 70vh; }
}
.help-chat-hint {
font-size: 12px;
color: var(--text-tertiary);
@@ -3829,14 +3832,102 @@ tbody tr:last-child td {
border: 1px solid var(--border);
border-bottom-left-radius: 4px;
}
.help-msg-assistant .help-msg-content code {
/* Markdown answers: compact prose that fits the narrow panel. */
.help-md > :first-child { margin-top: 0; }
.help-md > :last-child { margin-bottom: 0; }
.help-md p,
.help-md ul,
.help-md ol,
.help-md pre,
.help-md table { margin: 0 0 8px; }
.help-md ul,
.help-md ol { padding-left: 18px; }
.help-md li { margin: 2px 0; }
.help-md li::marker { color: var(--accent); }
.help-md h1,
.help-md h2,
.help-md h3,
.help-md h4 {
font-family: var(--font-display);
font-size: 13px;
font-weight: 600;
margin: 10px 0 4px;
}
.help-md strong { font-weight: 600; }
.help-md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.help-md code {
background: var(--accent-muted);
padding: 1px 5px;
border-radius: 3px;
border-radius: 4px;
font-family: var(--font-mono);
font-size: 12px;
word-break: break-word;
}
.help-md pre {
background: var(--bg-primary);
border: 1px solid var(--border);
border-radius: 8px;
padding: 8px 10px;
overflow-x: auto;
}
.help-md pre code { background: none; padding: 0; }
.help-md blockquote {
margin: 0 0 8px;
padding-left: 10px;
border-left: 3px solid var(--border-bright);
color: var(--text-secondary);
}
.help-md table { border-collapse: collapse; font-size: 12px; display: block; overflow-x: auto; }
.help-md th,
.help-md td { border: 1px solid var(--border); padding: 3px 6px; text-align: left; }
.help-msg-error {
color: var(--danger);
border-color: color-mix(in oklch, var(--danger) 40%, var(--border)) !important;
}
.help-chat-mark {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border-radius: 8px;
background: var(--accent-muted);
color: var(--accent);
}
.help-chat-suggestions {
display: flex;
flex-direction: column;
gap: 6px;
width: 100%;
margin-top: 6px;
}
.help-chat-suggestion {
text-align: left;
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 10px;
padding: 8px 12px;
font: inherit;
font-size: 13px;
color: var(--text-primary);
cursor: pointer;
transition: border-color 0.15s, background 0.15s;
}
.help-chat-suggestion:hover {
border-color: var(--accent);
background: var(--accent-muted);
}
.help-chat-disclaimer {
margin: 0;
padding: 0 14px 10px;
background: var(--bg-primary);
font-size: 11px;
color: var(--text-tertiary);
}
.help-msg-loading {
display: flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
border-radius: 12px;
background: var(--bg-elevated);
+139 -149
View File
@@ -1,198 +1,188 @@
//! The help assistant: a floating panel that answers questions about Prüfwerk
//! from its documentation.
use dioxus::prelude::*;
use dioxus_free_icons::icons::bs_icons::*;
use dioxus_free_icons::Icon;
use crate::components::markdown::render_markdown;
use crate::i18n::texts::help;
use crate::i18n::use_lang;
use crate::infrastructure::help_chat::{send_help_chat_message, HelpChatHistoryMessage};
// ── Message model ────────────────────────────────────────────────────────────
#[derive(Clone, Debug)]
struct ChatMsg {
role: String,
content: String,
/// Who wrote a message in the conversation.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum Role {
User,
Assistant,
/// A failed request, shown in the conversation but never sent back as
/// history.
Error,
}
// ── Component ────────────────────────────────────────────────────────────────
/// One message of the conversation. An assistant message keeps its rendered
/// HTML, so the markdown is parsed once rather than on every render.
#[derive(Clone, Debug, PartialEq)]
struct ChatMsg {
role: Role,
content: String,
html: String,
}
/// Floating help button and the conversation panel it opens.
#[component]
pub fn HelpChat() -> Element {
let lang = use_lang()();
let mut is_open = use_signal(|| false);
let mut messages = use_signal(Vec::<ChatMsg>::new);
let mut input_text = use_signal(String::new);
let mut is_loading = use_signal(|| false);
// Send message handler
let on_send = move |_| {
let text = input_text().trim().to_string();
// Send `text` with the conversation so far. The one path for the button,
// Enter, and the suggested questions.
let mut send = move |text: String| {
let text = text.trim().to_string();
if text.is_empty() || is_loading() {
return;
}
// Push user message
let history: Vec<HelpChatHistoryMessage> = messages
.read()
.iter()
.filter_map(|m| {
let role = match m.role {
Role::User => "user",
Role::Assistant => "assistant",
Role::Error => return None,
};
Some(HelpChatHistoryMessage {
role: role.to_string(),
content: m.content.clone(),
})
})
.collect();
messages.write().push(ChatMsg {
role: "user".into(),
role: Role::User,
content: text.clone(),
html: String::new(),
});
input_text.set(String::new());
is_loading.set(true);
// Build history for API call (exclude last user message, it goes as `message`)
let history: Vec<HelpChatHistoryMessage> = messages()
.iter()
.rev()
.skip(1) // skip the user message we just added
.rev()
.map(|m| HelpChatHistoryMessage {
role: m.role.clone(),
content: m.content.clone(),
})
.collect();
spawn(async move {
match send_help_chat_message(text, history).await {
Ok(resp) => {
messages.write().push(ChatMsg {
role: "assistant".into(),
content: resp.data.message,
});
}
Err(e) => {
messages.write().push(ChatMsg {
role: "assistant".into(),
content: format!("Error: {e}"),
});
}
}
let reply = match send_help_chat_message(text, history).await {
Ok(resp) => ChatMsg {
role: Role::Assistant,
html: render_markdown(&resp.data.message),
content: resp.data.message,
},
Err(e) => ChatMsg {
role: Role::Error,
content: format!("{}: {e}", help::FAILED.get(lang)),
html: String::new(),
},
};
messages.write().push(reply);
is_loading.set(false);
});
};
// Key handler for Enter to send
let on_keydown = move |e: KeyboardEvent| {
if e.key() == Key::Enter && !e.modifiers().shift() {
e.prevent_default();
let text = input_text().trim().to_string();
if text.is_empty() || is_loading() {
return;
}
messages.write().push(ChatMsg {
role: "user".into(),
content: text.clone(),
});
input_text.set(String::new());
is_loading.set(true);
let history: Vec<HelpChatHistoryMessage> = messages()
.iter()
.rev()
.skip(1)
.rev()
.map(|m| HelpChatHistoryMessage {
role: m.role.clone(),
content: m.content.clone(),
})
.collect();
spawn(async move {
match send_help_chat_message(text, history).await {
Ok(resp) => {
messages.write().push(ChatMsg {
role: "assistant".into(),
content: resp.data.message,
});
}
Err(e) => {
messages.write().push(ChatMsg {
role: "assistant".into(),
content: format!("Error: {e}"),
});
}
}
is_loading.set(false);
});
}
};
rsx! {
// Floating toggle button
if !is_open() {
if !is_open() {
return rsx! {
button {
class: "help-chat-toggle",
onclick: move |_| is_open.set(true),
title: "Help",
Icon { icon: BsQuestionCircle, width: 22, height: 22 }
title: help::OPEN.get(lang),
"aria-label": help::OPEN.get(lang),
Icon { icon: BsQuestionLg, width: 22, height: 22 }
}
}
};
}
// Chat panel
if is_open() {
div { class: "help-chat-panel",
// Header
div { class: "help-chat-header",
span { class: "help-chat-title",
Icon { icon: BsRobot, width: 16, height: 16 }
"Help Assistant"
}
button {
class: "help-chat-close",
onclick: move |_| is_open.set(false),
Icon { icon: BsX, width: 18, height: 18 }
}
rsx! {
div { class: "help-chat-panel", role: "dialog", "aria-label": help::TITLE.get(lang),
div { class: "help-chat-header",
span { class: "help-chat-title",
span { class: "help-chat-mark", Icon { icon: BsStars, width: 14, height: 14 } }
{help::TITLE.get(lang)}
}
button {
class: "help-chat-close",
title: help::CLOSE.get(lang),
"aria-label": help::CLOSE.get(lang),
onclick: move |_| is_open.set(false),
Icon { icon: BsX, width: 18, height: 18 }
}
}
// Messages area
div { class: "help-chat-messages",
if messages().is_empty() {
div { class: "help-chat-empty",
p { "Ask me anything about Prüfwerk." }
p { class: "help-chat-hint",
"e.g. \"How do I add a repository?\" or \"What is SBOM?\""
}
}
}
for (i, msg) in messages().iter().enumerate() {
div {
key: "{i}",
class: if msg.role == "user" { "help-msg help-msg-user" } else { "help-msg help-msg-assistant" },
div { class: "help-msg-content",
dangerous_inner_html: if msg.role == "assistant" {
// Basic markdown rendering: bold, code, newlines
msg.content
.replace("**", "<strong>")
.replace("\n\n", "<br><br>")
.replace("\n- ", "<br>- ")
.replace("`", "<code>")
} else {
msg.content.clone()
div { class: "help-chat-messages", "aria-live": "polite",
if messages.read().is_empty() {
div { class: "help-chat-empty",
p { {help::INTRO.get(lang)} }
div { class: "help-chat-suggestions",
for suggestion in help::SUGGESTIONS {
button {
class: "help-chat-suggestion",
onclick: move |_| send(suggestion.get(lang).to_string()),
{suggestion.get(lang)}
}
}
}
}
if is_loading() {
div { class: "help-msg help-msg-assistant",
div { class: "help-msg-loading", "Thinking..." }
}
for (i, msg) in messages.read().iter().enumerate() {
match msg.role {
Role::User => rsx! {
div { key: "{i}", class: "help-msg help-msg-user",
div { class: "help-msg-content", "{msg.content}" }
}
},
// Rendered by `render_markdown`, which escapes raw
// HTML and neutralises unsafe links.
Role::Assistant => rsx! {
div { key: "{i}", class: "help-msg help-msg-assistant",
div { class: "help-msg-content help-md", dangerous_inner_html: "{msg.html}" }
}
},
Role::Error => rsx! {
div { key: "{i}", class: "help-msg help-msg-assistant",
div { class: "help-msg-content help-msg-error", "{msg.content}" }
}
},
}
}
if is_loading() {
div { class: "help-msg help-msg-assistant",
div { class: "help-msg-loading",
span { class: "spinner" }
{help::THINKING.get(lang)}
}
}
}
}
// Input area
div { class: "help-chat-input",
input {
r#type: "text",
placeholder: "Ask a question...",
value: "{input_text}",
disabled: is_loading(),
oninput: move |e| input_text.set(e.value()),
onkeydown: on_keydown,
}
button {
class: "help-chat-send",
disabled: is_loading() || input_text().trim().is_empty(),
onclick: on_send,
Icon { icon: BsSend, width: 14, height: 14 }
}
div { class: "help-chat-input",
input {
r#type: "text",
placeholder: help::PLACEHOLDER.get(lang),
value: "{input_text}",
disabled: is_loading(),
oninput: move |e| input_text.set(e.value()),
onkeydown: move |e: KeyboardEvent| {
if e.key() == Key::Enter && !e.modifiers().shift() {
e.prevent_default();
send(input_text());
}
},
}
button {
class: "help-chat-send",
title: help::SEND.get(lang),
"aria-label": help::SEND.get(lang),
disabled: is_loading() || input_text().trim().is_empty(),
onclick: move |_| send(input_text()),
Icon { icon: BsSend, width: 14, height: 14 }
}
}
p { class: "help-chat-disclaimer", {help::DISCLAIMER.get(lang)} }
}
}
}
@@ -0,0 +1,108 @@
//! Markdown from the language model, made safe to show as HTML.
//!
//! The help assistant answers in markdown. It is model output, so nothing in
//! it may reach the page as markup of its own: raw HTML is shown as text, and
//! links keep only web and mail targets.
use pulldown_cmark::{CowStr, Event, Options, Parser, Tag};
/// Link targets kept as they are; anything else (`javascript:`, `data:`, …)
/// becomes an inert `#`.
const SAFE_SCHEMES: &[&str] = &["https://", "http://", "mailto:"];
/// Render `markdown` to HTML that is safe to insert into the page.
///
/// # Arguments
///
/// * `markdown` - Text in CommonMark (with tables and strikethrough)
///
/// # Returns
///
/// HTML with every raw HTML tag escaped and every link pointing at a web
/// address, a mail address, a relative path, or `#`.
///
/// # Examples
///
/// ```ignore
/// assert_eq!(render_markdown("**a** `b`"), "<p><strong>a</strong> <code>b</code></p>\n");
/// ```
pub fn render_markdown(markdown: &str) -> String {
let options = Options::ENABLE_TABLES | Options::ENABLE_STRIKETHROUGH;
let events = Parser::new_ext(markdown, options).map(|event| match event {
// Shown as the text it is; `push_html` escapes text.
Event::Html(html) | Event::InlineHtml(html) => Event::Text(html),
Event::Start(Tag::Link {
link_type,
dest_url,
title,
id,
}) => Event::Start(Tag::Link {
link_type,
dest_url: safe_url(dest_url),
title,
id,
}),
Event::Start(Tag::Image {
link_type,
dest_url,
title,
id,
}) => Event::Start(Tag::Image {
link_type,
dest_url: safe_url(dest_url),
title,
id,
}),
other => other,
});
let mut html = String::with_capacity(markdown.len() * 3 / 2);
pulldown_cmark::html::push_html(&mut html, events);
html
}
/// `url` when it is a web or mail address or a relative path, else `#`.
fn safe_url(url: CowStr<'_>) -> CowStr<'_> {
let lower = url.trim().to_ascii_lowercase();
let relative = !lower.contains(':');
if relative || SAFE_SCHEMES.iter().any(|scheme| lower.starts_with(scheme)) {
url
} else {
CowStr::Borrowed("#")
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn bold_and_code_are_closed() {
let html = render_markdown("**HTTPS only** and `ssh://` are rejected");
assert_eq!(
html,
"<p><strong>HTTPS only</strong> and <code>ssh://</code> are rejected</p>\n"
);
}
#[test]
fn lists_render_as_lists() {
let html = render_markdown("- one\n- two");
assert!(html.contains("<ul>") && html.contains("<li>two</li>"));
}
#[test]
fn raw_html_is_shown_as_text() {
let html = render_markdown("<img src=x onerror=alert(1)> hi");
assert!(!html.contains("<img"));
assert!(html.contains("&lt;img"));
}
#[test]
fn script_links_are_made_inert() {
let html = render_markdown("[x](javascript:alert(1)) [y](https://example.com) [z](/guide)");
assert!(!html.contains("javascript:"));
assert!(html.contains("href=\"#\""));
assert!(html.contains("href=\"https://example.com\""));
assert!(html.contains("href=\"/guide\""));
}
}
@@ -11,6 +11,7 @@ pub mod file_tree;
pub mod help_chat;
pub mod lang_toggle;
pub mod manual_findings;
pub mod markdown;
pub mod notification_bell;
pub mod page_header;
pub mod pagination;
+65 -12
View File
@@ -549,12 +549,10 @@ pub mod scans {
(Make, CMake, Zephyr, ESP-IDF, PlatformIO, Arduino, embedded Rust)."
.into(),
(SkipCode::FirmwareUnresolved, Lang::De) => format!(
"{subject}-Build erkannt, aber ohne Build lassen sich keine Komponenten auflösen. \
Ein Firmwerk-Paket liefert die vollständige Stückliste."
"{subject}-Build erkannt, aber ohne Build lassen sich keine Komponenten auflösen."
),
(SkipCode::FirmwareUnresolved, Lang::En) => format!(
"{subject} build detected, but no components resolve without building it. \
A Firmwerk bundle gives the complete SBOM."
"{subject} build detected, but no components resolve without building it."
),
(SkipCode::CveLookupIncomplete, Lang::De) => format!("Nicht abgeglichen: {subject}"),
(SkipCode::CveLookupIncomplete, Lang::En) => format!("Not matched: {subject}"),
@@ -2399,6 +2397,62 @@ pub mod demo {
}
/// What each scan does and why it cannot run, for the applicable-scans list.
/// The help assistant.
pub mod help {
use super::Text;
pub const OPEN: Text = Text {
de: "Hilfe",
en: "Help",
};
pub const TITLE: Text = Text {
de: "Hilfe-Assistent",
en: "Help assistant",
};
pub const CLOSE: Text = Text {
de: "Schließen",
en: "Close",
};
pub const INTRO: Text = Text {
de: "Fragen Sie alles zu Prüfwerk. Die Antworten stützen sich auf die Dokumentation.",
en: "Ask anything about Prüfwerk. Answers are based on the documentation.",
};
pub const SUGGESTIONS: [Text; 3] = [
Text {
de: "Werden Git-Submodule mitgeprüft?",
en: "Are git submodules scanned too?",
},
Text {
de: "Wie lade ich ein passwortgeschütztes Archiv hoch?",
en: "How do I upload a password-protected archive?",
},
Text {
de: "Was ist der Unterschied zwischen den beiden Fehlalarm-Arten?",
en: "What is the difference between the two kinds of false alarm?",
},
];
pub const PLACEHOLDER: Text = Text {
de: "Frage stellen …",
en: "Ask a question...",
};
pub const SEND: Text = Text {
de: "Senden",
en: "Send",
};
pub const THINKING: Text = Text {
de: "Sucht in der Dokumentation …",
en: "Searching the documentation...",
};
pub const FAILED: Text = Text {
de: "Die Frage konnte nicht beantwortet werden",
en: "The question could not be answered",
};
pub const DISCLAIMER: Text = Text {
de: "KI-generiert, bitte wichtige Angaben in der Dokumentation prüfen.",
en: "AI-generated; check important details in the documentation.",
};
}
pub mod coverage {
use super::Text;
use compliance_core::models::ScanType;
@@ -2484,10 +2538,9 @@ pub mod coverage {
en: "needs another artifact",
};
pub const IMAGE_NOT_ANALYSED: Text = Text {
de: "Firmware-Images werden noch nicht entpackt: Prüfen Sie die Firmware-Quellen \
oder importieren Sie ein Firmwerk-Paket",
en: "firmware images are not unpacked yet: scan the firmware sources or import \
a Firmwerk bundle",
de: "Firmware-Images werden noch nicht entpackt: Prüfen Sie stattdessen die \
Firmware-Quellen",
en: "firmware images are not unpacked yet: scan the firmware sources instead",
};
pub const CONTAINER_NOT_SCANNED: Text = Text {
de: "Container-Images werden noch nicht geprüft, nur die Quellen, aus denen sie entstehen",
@@ -2557,8 +2610,8 @@ mod coverage_tests {
("no live_url artifact provided", coverage::NEEDS_DEVICE),
("no git_repo artifact provided", coverage::NEEDS_CODE),
(
"firmware images are not unpacked or analysed yet: scan the firmware sources, \
or import a Firmwerk bundle for the image",
"firmware images are not unpacked or analysed yet: scan the firmware sources \
instead",
coverage::IMAGE_NOT_ANALYSED,
),
(
@@ -2608,8 +2661,8 @@ mod skipped_reason_tests {
let image = SkippedStage::new(
"firmware_static",
SkipCode::NotAnalysedYet,
"firmware images are not unpacked or analysed yet: scan the firmware sources, \
or import a Firmwerk bundle for the image",
"firmware images are not unpacked or analysed yet: scan the firmware sources \
instead",
);
assert!(skipped_reason(&image, Lang::De).starts_with("Firmware-Images werden noch nicht"));
}
+2
View File
@@ -62,6 +62,7 @@ export default withMermaid(defineConfig({
text: 'Oberfläche und Anbindung',
items: [
{ text: 'Übersicht', link: '/features/overview' },
{ text: 'Hilfe-Assistent', link: '/features/help-chat' },
{ text: 'MCP-Schnittstelle', link: '/features/mcp-server' },
{ text: 'Tickets', link: '/guide/issues' },
{ text: 'Webhooks und PR-Reviews', link: '/guide/webhooks' },
@@ -85,6 +86,7 @@ export default withMermaid(defineConfig({
{ text: 'Pentest Architecture', link: '/features/pentest-architecture' },
{ text: 'AI Chat', link: '/features/ai-chat' },
{ text: 'Code Knowledge Graph', link: '/features/graph' },
{ text: 'Finding Deduplication', link: '/features/deduplication' },
],
},
],
+8 -8
View File
@@ -1,17 +1,17 @@
# Finding Deduplication
The Compliance Scanner automatically deduplicates findings across all scanning surfaces to prevent noise and duplicate issues.
Prüfwerk automatically deduplicates findings across all scanning surfaces to prevent noise and duplicate issues.
## SAST Finding Dedup
## Scan Finding Dedup
Static analysis findings are deduplicated using SHA-256 fingerprints computed from:
Findings from a scan are deduplicated using SHA-256 fingerprints computed from:
- Repository ID
- Scanner rule ID (e.g., Semgrep check ID)
- File path
- Target ID
- Scanner rule ID (e.g., Semgrep check ID, gitleaks rule; for cppcheck the tool name and check ID)
- File path, relative to the scanned tree
- Line number
Before inserting a new finding, the pipeline checks if a finding with the same fingerprint already exists. If it does, the finding is skipped.
Before inserting a new finding, the pipeline checks if a finding with the same fingerprint already exists. If it does, the finding is skipped: the stored finding keeps its status, and only its CRA and control references are refreshed.
## DAST / Pentest Finding Dedup
@@ -56,6 +56,6 @@ Before creating an issue in GitHub, GitLab, Jira, or Gitea, the scanner:
Multi-pass LLM code reviews (logic, security, convention, complexity) are deduplicated across passes using proximity-aware keys:
- Findings within 3 lines of each other on the same file with similar normalized titles are considered duplicates
- Findings on the same file, in the same block of four lines, with the same normalized title words are considered duplicates
- The finding with the highest severity is kept
- CWE information is merged from duplicates
+20 -24
View File
@@ -1,27 +1,33 @@
# Help Chat Assistant
The Help Chat is a floating assistant available on every page of the dashboard. It answers questions about the Compliance Scanner using the project documentation as its knowledge base.
The help assistant (*Hilfe-Assistent*) is available on every page of Prüfwerk.
It answers questions about Prüfwerk from this documentation.
## How It Works
1. Click the **?** button in the bottom-right corner of any page
2. Type your question and press Enter
3. The assistant responds with answers grounded in the project documentation
1. Click **Hilfe** (the question-mark button in the bottom-right corner of any page)
2. Type your question and press Enter, or pick one of the suggested questions
3. The assistant answers from the documentation, in the language you asked in
The chat supports multi-turn conversations -- you can ask follow-up questions and the assistant will remember the context of your conversation.
The chat keeps the conversation, so you can ask follow-up questions. Answers are
AI-generated; check important details in the documentation.
## What You Can Ask
- **Getting started**: "How do I add a repository?" / "How do I trigger a scan?"
- **Features**: "What is SBOM?" / "How does the code knowledge graph work?"
- **Configuration**: "How do I set up webhooks?" / "What environment variables are needed?"
- **Scanning**: "What does the scan pipeline do?" / "How does LLM triage work?"
- **DAST & Pentesting**: "How do I run a pentest?" / "What DAST tools are available?"
- **Integrations**: "How do I connect to GitHub?" / "What is MCP?"
- **Getting started**: "Wie lege ich ein Prüfobjekt an?" / "Wie starte ich eine Prüfung?"
- **Scans**: "Werden Git-Submodule mitgeprüft?" / "Warum steht ein Schritt unter Nicht ausgeführt?"
- **Uploads**: "Wie lade ich ein passwortgeschütztes Archiv hoch?"
- **Findings**: "Was ist der Unterschied zwischen den beiden Fehlalarm-Arten?"
- **SBOM and CRA**: "Wie exportiere ich die Stückliste?" / "Was bedeutet Nicht bewertet?"
## Technical Details
The help chat loads all project documentation (README, guides, feature docs, reference) at startup and caches them in memory. When you ask a question, it sends your message along with the full documentation context to the LLM via LiteLLM, which generates a grounded response.
The assistant loads `README.md` and every published page under `docs/` once, at
startup (internal design notes are left out). For each question it sends the
question, the conversation so far and the documentation to the LLM, and asks it
to answer from the documentation and to say so when the documentation does not
cover a question. If no documentation was found at startup, it answers without
it and says when it is unsure.
### API Endpoint
@@ -30,7 +36,7 @@ POST /api/v1/help/chat
Content-Type: application/json
{
"message": "How do I add a repository?",
"message": "Wie lege ich ein Prüfobjekt an?",
"history": [
{ "role": "user", "content": "previous question" },
{ "role": "assistant", "content": "previous answer" }
@@ -47,14 +53,4 @@ The help chat uses the same LiteLLM configuration as other LLM features:
| `LITELLM_URL` | LiteLLM API base URL | `http://localhost:4000` |
| `LITELLM_MODEL` | Model for chat responses | `gpt-4o` |
| `LITELLM_API_KEY` | API key (optional) | -- |
### Documentation Sources
The assistant indexes the following documentation at startup:
- `README.md` -- Project overview and quick start
- `docs/guide/` -- Getting started, repositories, findings, SBOM, scanning, issues, webhooks
- `docs/features/` -- AI Chat, DAST, Code Graph, MCP Server, Pentesting, Help Chat
- `docs/reference/` -- Glossary, tools reference
If documentation files are not found at startup (e.g., in a minimal Docker deployment), the assistant falls back to general knowledge about the project.
| `HELP_DOCS_PATH` | Directory containing `README.md` and `docs/`, if it is not found next to the agent | -- |
+12 -5
View File
@@ -19,11 +19,18 @@ Without MCP, getting security data into an LLM conversation requires manual effo
## Managing MCP Servers
Navigate to **MCP Servers** in the sidebar to manage your MCP server instances.
There is no sidebar entry for MCP. The **Übersicht** (Overview) has an
**MCP-Server** card: **Verwalten** (Manage) opens the MCP server page, and
**MCP-Tokens** opens the bearer tokens an IDE or LLM client connects with.
![MCP servers management page](/screenshots/mcp-servers.png)
::: info Not in source-only deployments
In a deployment that scans source code only, such as the pilot, the MCP-Server
card is hidden, so these pages are not reachable from the dashboard. The
evidence the MCP tools return is also in the evidence pack on each target's
page.
:::
From this page you can:
From the MCP server page you can:
- **Register** new MCP server instances with their endpoint URL, transport type, and port
- **View** server configuration, enabled tools, and status
@@ -45,7 +52,7 @@ endpoint itself is reachable from your client.
## Available Tools
The MCP server exposes seven tools that LLM clients can discover and call:
The MCP server exposes these tools, among others (pentest tools are not listed here), which LLM clients can discover and call:
### Targets and Scans
@@ -95,7 +102,7 @@ manifest of sha256 checksums) is also served as one ZIP at
To connect an MCP-compatible tool (like Claude Desktop or Cursor) to your Prüfwerk MCP server:
1. Go to **MCP Servers** in Prüfwerk and note the server endpoint URL and access token
1. Open **Verwalten** or **MCP-Tokens** on the overview's MCP-Server card and note the server endpoint URL and access token
2. In your MCP client, add a new server connection with:
- **URL** -- the MCP server endpoint (e.g. `https://your-pruefwerk-instance/mcp`)
- **Transport** -- Streamable HTTP
+33 -32
View File
@@ -1,49 +1,50 @@
# Dashboard Overview
The Overview page is the landing page of the Compliance Scanner. It gives you a high-level view of your security posture across all tracked repositories.
**Übersicht** (Overview) is the first page of Prüfwerk. It shows where your
targets stand against the Cyber Resilience Act and what to look at next.
## Stats Cards
## Figures
The top section displays key metrics at a glance:
Four figures at the top, each a link:
| Metric | Description |
| Figure | Description |
|--------|-------------|
| **Repositories** | Total number of tracked repositories |
| **Total Findings** | Combined count of all security findings |
| **Critical** | Findings with critical severity |
| **High** | Findings with high severity |
| **Medium** | Findings with medium severity |
| **Low** | Findings with low severity |
| **Dependencies** | Total SBOM packages across all repositories |
| **CVE Alerts** | Active CVE alerts from dependency monitoring |
| **Tracker Issues** | Issues created in external trackers (GitHub, GitLab, Gitea, Jira) |
| **Prüfobjekte** (Targets) | Number of targets; opens the **Prüfobjekte** list |
| **Offene Befunde** (Open findings) | Findings with the status **Offen**, **Bewertet** or **Zu prüfen**, with how many of them are critical (**kritisch**) and high (**hoch**); opens **Befunde** |
| **Komponenten** (Components) | Number of components **in der Stückliste** (in the SBOM); opens **Stückliste** |
| **Bekannte Schwachstellen** (Known vulnerabilities) | Number of **CVE in Komponenten** (CVEs in components); opens **Stückliste** |
These cards update after each scan completes, so you always see the current state.
## CRA-Stand je Prüfobjekt (CRA status by target)
## Severity Distribution
Each target with a bar for the 40 requirements of CRA Annex I and its last
scan. A click on a target's name opens its CRA status, requirement by
requirement. **Alle Prüfobjekte** opens the full list when there are more
targets than fit.
A visual chart shows the distribution of findings by severity level across all your repositories. This gives you an immediate sense of your risk profile -- whether your findings are mostly informational or if there are critical issues that need attention.
## Als Nächstes (Next up)
## AI Chat Cards
The most severe open findings across all targets, each with its target and
location. A click opens the finding; **Alle Befunde** opens the findings list.
**Keine offenen Befunde.** means there is nothing open.
The overview includes quick-access cards for the AI Chat feature. Each card represents a repository that has embeddings built, letting you jump directly into a conversation about that codebase. See [AI Chat](/features/ai-chat) for details.
## Empty workspace
## MCP Server Cards
Without targets, the page shows **Noch keine Prüfobjekte** and the button
**Prüfobjekt anlegen**, which opens the wizard (see
[Adding Targets](/guide/repositories)).
If you have MCP servers registered, they appear on the overview page with their status and connection details. This lets you quickly check that your MCP integrations are running. See [MCP Integration](/features/mcp-server) for details.
## AI chat and MCP servers
## Help Chat Assistant
Outside a source-only deployment, the overview also has a **KI-Chat** card with
one entry per target (see [AI Chat](/features/ai-chat)) and an **MCP-Server**
card with the registered servers, **Verwalten** (Manage) and **MCP-Tokens** (see
[MCP Integration](/features/mcp-server)). In a deployment that scans source code
only, such as the pilot, both cards are hidden.
A floating help chat button is available in the bottom-right corner of every page. Click it to ask questions about the Compliance Scanner -- how to configure repositories, understand findings, set up webhooks, or use any feature. The assistant is grounded in the project documentation and uses LiteLLM for responses.
## Help assistant
## Recent Scan Runs
The **Hilfe** button (a question mark, bottom right) is on every page. It opens
the help assistant, which answers from this documentation; see
[Help Chat Assistant](/features/help-chat).
The bottom section lists the most recent scan runs across all repositories, showing:
- Repository name
- Scan status (queued, running, completed, failed)
- Current phase
- Number of findings discovered
- Timestamp and duration
This helps you monitor scanning activity and quickly spot failures or long-running scans.
Scan runs are shown on each target's page, not on the overview.
+124 -100
View File
@@ -1,143 +1,167 @@
# Understanding Findings
Findings are security issues discovered during scans. The findings workflow lets you triage, track, and resolve vulnerabilities across all your repositories.
A finding (*Befund*) is one issue a scan found in a target: a weakness in the
code, a committed secret, a component with a known vulnerability, and so on.
This page explains the findings list, the finding page and the statuses you
use to record what you decided.
## Findings List
Navigate to **Findings** in the sidebar to see all findings across your repositories.
![Findings list with severity badges, types, and filter controls](/screenshots/findings-list.png)
Open **Befunde** (Findings) in the sidebar to see the findings of all your
targets. The number in the **Befunde** column of the **Prüfobjekte** list opens
the same page filtered to that target.
### Filtering
Use the filter bar to narrow results:
The filter bar has a search field (**Befunde durchsuchen …**) and four filters:
- **Repository** -- filter to a specific repository or view all
- **Severity** -- Critical, High, Medium, Low, or Info
- **Type** -- SAST, SBOM, CVE, GDPR, OAuth, Secrets, Code Review
- **Status** -- Open, Triaged, Resolved, False Positive, Ignored
- **Alle Prüfobjekte** -- one target, or all
- **Alle Schweregrade** -- **Kritisch**, **Hoch**, **Mittel**, **Niedrig** or **Info**
- **Alle Arten** -- the kind of finding, e.g. **Codeanalyse (SAST)**,
**Zugangsdaten im Code**, **Bekannte Schwachstelle (CVE)**,
**SPS-Steuerungslogik**
- **Alle Status** -- one of the statuses below
Filters can be combined. Results are paginated with 20 findings per page.
Filters can be combined. The list shows 20 findings per page.
### Columns
| Column | Description |
|--------|-------------|
| Severity | Color-coded badge: Critical (red), High (orange), Medium (yellow), Low (green), Info (blue) |
| Title | Short description of the vulnerability (clickable) |
| Type | SAST, SBOM, CVE, GDPR, OAuth, Secrets, or Code Review |
| Scanner | Tool that found the issue (e.g. Semgrep, Syft/OSV) |
| File | Source file path where the issue was found |
| Status | Current triage status |
| **Schweregrad** (Severity) | Kritisch, Hoch, Mittel, Niedrig or Info |
| **Titel** (Title) | What was found; a click opens the finding. The tool that found it is shown beneath. |
| **Art** (Type) | The kind of finding |
| **Prüfobjekt** (Target) | Only when the list shows all targets |
| **Fundstelle** (Location) | File and line |
| **CRA** | The CRA Annex I requirements the finding is evidence for, plus "+N **weitere Kontrollen**" for controls from the BreakPilot catalog. Shown only when a finding in view is mapped. |
| **Status** | The current status |
The **Schweregrad**, **Titel**, **Art** and **Status** headers sort the list.
### Changing several findings at once
Tick the findings (or the box in the header for the whole page) and choose a
status under **Markieren als** (Mark as). Statuses that need a reason
(**Risiko akzeptiert** and **Fehlalarm – Zuordnung**) are not offered here; set
them on each finding's page.
## Finding Detail
Click any finding title to view its full detail page.
A click on a finding's title opens its page. At the top: the title, the tool,
the type and the status, and badges for severity, CWE, CVE, CVSS score and the
**Konfidenz** (confidence) of the automated review, where present. Below that,
in this order:
![Finding detail page showing description, triage rationale, code evidence, remediation, and status controls](/screenshots/finding-detail.png)
The detail page is organized into these sections:
### Description
A full explanation of the vulnerability: what it is, why it is a risk, and what conditions trigger it.
### AI Triage Rationale
The LLM's assessment of the finding, including why it assigned a particular severity and confidence score. This rationale considers the code context, the type of vulnerability, and the blast radius based on the code knowledge graph.
### Code Evidence
The source code snippet where the issue was found, with syntax highlighting and the file path with line number.
### Remediation
Step-by-step guidance on how to fix the vulnerability, often including a suggested code fix showing the corrected implementation.
### Linked Issue
If the finding has been pushed to an issue tracker (GitHub, GitLab, Gitea, Jira), a direct link to the external issue appears here.
- **Beschreibung** (Description) -- what the issue is.
- **Fundstelle** (Location) -- the **Prüfobjekt** (a click opens its CRA
status), **Datei** (file and line), **Werkzeug** (tool), **Regel** (rule) and
**CRA-Anforderungen (Anhang I)**: the CRA Annex I requirements the finding is
mapped to, each with its title. Controls from the BreakPilot catalog are
folded under **+N Kontrollen aus dem BreakPilot-Katalog**; click it to see
each control with what it requires.
- **Einschätzung** (Triage rationale) -- the automated review's reasoning, where
there is one.
- **Code** (Code evidence) -- the lines where the issue was found. A committed
secret is shown shortened.
- **Reproduktion** -- steps to reproduce, for findings from manual tests.
- **Behebung** (Remediation) and **Vorgeschlagene Korrektur** (Suggested fix),
where present.
- **Verknüpftes Ticket** (Linked issue) -- the ticket in your issue tracker, if
one was created.
- **Status ändern** (Update status) -- one button per status.
- **Verlauf** (History) -- every status change.
- **Ihre Einschätzung** (Developer feedback) -- a free-text note, saved when you
leave the field.
## Severity Levels
| Severity | Description | Typical Examples |
|----------|-------------|-----------------|
| **Critical** | Immediate exploitation risk, data breach likely | SQL injection, RCE, hardcoded secrets |
| **High** | Serious vulnerability, exploitation probable | XSS, authentication bypass, SSRF |
| **Medium** | Moderate risk, exploitation requires specific conditions | Insecure deserialization, weak crypto |
| **Low** | Minor risk, limited impact | Information disclosure, verbose errors |
| **Info** | Informational, no direct security impact | Best practice recommendations |
| **Kritisch** (Critical) | Immediate exploitation risk | SQL injection, remote code execution, hardcoded secrets |
| **Hoch** (High) | Serious weakness, exploitation probable | XSS, authentication bypass, SSRF |
| **Mittel** (Medium) | Exploitation requires specific conditions | Insecure deserialization, weak crypto |
| **Niedrig** (Low) | Limited impact | Information disclosure, verbose errors |
| **Info** | No direct security impact | Best-practice notes |
## Finding Types
| Type | Source | Description |
|------|--------|-------------|
| **SAST** | Semgrep | Code-level vulnerabilities found through static analysis |
| **SBOM** | Syft + OSV.dev/NVD | Vulnerable dependencies identified in your software bill of materials |
| **CVE** | NVD | Known CVEs matching your dependency versions |
| **GDPR** | Custom rules | Personal data handling and consent issues |
| **OAuth** | Custom rules | OAuth/OIDC misconfigurations and insecure token handling |
| **Secrets** | Custom rules | Hardcoded credentials, API keys, and tokens |
| **Code Review** | LLM | Architecture and security patterns reviewed by the AI engine |
The most common types in a scan of source code:
## Triage Workflow
| Type | Source |
|------|--------|
| **Codeanalyse (SAST)** | Semgrep; for C and C++ also cppcheck |
| **Zugangsdaten im Code** (Secrets) | gitleaks |
| **Bekannte Schwachstelle (CVE)** | Components of the SBOM matched against OSV.dev and NVD |
| **Datenschutz** (Privacy / GDPR) | Prüfwerk's own pattern rules |
| **OAuth** | Prüfwerk's own pattern rules |
| **Code-Qualität** (Lint) | Linters, where the deployment runs them |
| **SPS-Steuerungslogik** (PLC control logic) | Prüfwerk's PLC analyser, see [SPS / PLC (CODESYS)](/guide/plc) |
| **Penetrationstest**, **Dynamische Prüfung (DAST)** | Entered or imported by hand, see [Befunde aus manuellen Tests](/guide/manual-findings) |
Every finding follows a lifecycle from discovery to resolution. The status indicates where a finding is in this process:
## Statuses
The status records what you decided about a finding. Change it with the buttons
under **Status ändern**; the change takes effect at once.
| Status | Meaning |
|--------|---------|
| **Open** | Newly discovered, not yet reviewed |
| **Triaged** | Reviewed and confirmed as a real issue, pending fix |
| **Resolved** | A fix has been applied |
| **False Positive** | Not a real vulnerability in this context |
| **Ignored** | Known issue that will not be fixed (accepted risk) |
| **Offen** (Open) | New, not yet decided. |
| **Zu prüfen** (Needs review) | The automated review doubts the finding: the AI triage dismissed it or was not confident, or the control check did not confirm the CRA requirements it was mapped to. It stays in the list until a person decides; no finding is ever hidden automatically. |
| **Bewertet** (Triaged) | Reviewed and confirmed as a real issue, still to be fixed. The AI triage also sets this when it confirms a finding. |
| **Behoben** (Resolved) | Fixed. |
| **Fehlalarm – Regel** (False positive – rule) | The rule fired on code that is not a problem. The finding is not real. |
| **Fehlalarm – Zuordnung** (False positive – mapping) | The finding may be real, but it does not violate the CRA requirement it was mapped to. **Needs a reason.** The finding keeps its CRA references, so it stays on record which mapping was wrong. |
| **Risiko akzeptiert** (Accepted risk) | Known and deliberately not fixed, e.g. because the device runs only on an isolated network. **Needs a reason.** |
| **Ignoriert** (Ignored) | Set aside without a reason. |
On the finding detail page, use the status buttons to move a finding through this workflow. Status changes take effect immediately.
### The two kinds of false alarm
- **Fehlalarm – Regel**: the tool was wrong. The flagged code is fine.
- **Fehlalarm – Zuordnung**: the tool may be right about the code, but the
finding was assigned to the wrong CRA requirement. You are asked *why* the
finding does not violate that requirement before the status is saved.
### How statuses affect the CRA status and counts
- A finding with **Fehlalarm – Regel**, **Fehlalarm – Zuordnung** or
**Behoben** no longer counts against its CRA requirements.
- **Risiko akzeptiert** and **Ignoriert** still count against them: the issue is
still in the product.
- The **Offene Befunde** (open findings) figures count findings that are
**Offen**, **Bewertet** or **Zu prüfen**.
### Reasons and history
**Risiko akzeptiert** and **Fehlalarm – Zuordnung** ask for a **Begründung**
(reason) before they are saved; the button stays disabled until you enter one.
Every status change, with or without a reason, is added to the finding's
**Verlauf** (history): the status, who set it, when, and the reason.
### Recommended Flow
1. A scan discovers a new finding -- it starts as **Open**
2. You review the AI triage rationale and code evidence
3. If it is a real issue, mark it as **Triaged** to signal that it needs a fix
4. Once the fix is deployed and a new scan confirms it, mark it as **Resolved**
5. If the AI got it wrong, mark it as **False Positive** (see below)
## False Positives
Not every finding is a real vulnerability. Static analysis tools can flag code that looks suspicious but is actually safe in context. When this happens:
1. Open the finding detail page
2. Review the code evidence and the AI triage rationale
3. If you determine the finding is not a real issue, click **False Positive**
::: tip
When you mark a finding as a false positive, you are providing training signal to the AI. Over time, the LLM learns from your feedback and becomes better at distinguishing real vulnerabilities from false alarms in your codebase.
:::
1. A scan finds something new. It starts as **Offen**, or as **Bewertet** or
**Zu prüfen** after the automated review.
2. Read the **Einschätzung** and the **Code**.
3. Decide: **Bewertet** if it needs fixing, one of the two false-alarm statuses
if it does not apply, **Risiko akzeptiert** if you will not fix it.
4. After the fix, set **Behoben**. A later scan does not change the status of a
finding it already knows, and does not close a finding on its own.
## Human in the Loop
Prüfwerk uses AI to triage findings, but humans make the final decisions. Here is how the process works:
Prüfwerk uses AI to review findings, but people make the decisions:
1. **AI triages** -- the LLM reviews each finding, assigns a severity, generates a confidence score, and writes a rationale explaining its assessment
2. **You review** -- you read the AI's analysis alongside the code evidence and decide whether to act on it
3. **You decide** -- you set the final status (Triaged, Resolved, False Positive, or Ignored)
4. **AI learns** -- your feedback on false positives and status changes helps improve future triage accuracy
1. **The AI reviews** -- each new finding gets a confidence, a short rationale
and, where possible, a remediation. Findings it doubts become **Zu prüfen**.
2. **You review** -- read the rationale next to the code.
3. **You decide** -- you set the status, with a reason where one is required.
The AI provides the analysis; you provide the judgment. This approach gives you the speed of automated scanning with the accuracy of human review.
The AI does not learn from your statuses or notes; they are records for your
team.
## Developer Feedback
## Confidence
On the finding detail page, you can provide feedback on the AI's triage. This feedback loop serves two purposes:
- **Accuracy** -- helps the platform understand which findings are actionable in your specific codebase and context
- **Context** -- lets you add notes explaining why a finding is or is not relevant, which benefits other team members reviewing the same finding
## Confidence Scores
Each AI-triaged finding includes a confidence score from 0.0 to 1.0, indicating how certain the LLM is about its assessment:
- **0.8 -- 1.0** -- High confidence. The AI is very certain this is (or is not) a real vulnerability.
- **0.5 -- 0.8** -- Moderate confidence. The finding likely warrants human review.
- **Below 0.5** -- Low confidence. The AI is uncertain and recommends manual inspection.
Use confidence scores to prioritize your review queue: start with high-severity, high-confidence findings for the greatest impact.
The automated review rates its confidence from 0 to 10. The value is lowered
for findings in test, example, generated or vendored files. A finding the review
does not confirm with a confidence of at least 3 becomes **Zu prüfen**. Use the
confidence to order your review; it is not a verdict.
+47 -38
View File
@@ -1,61 +1,69 @@
# Getting Started (English)
Prüfwerk is an AI-powered security compliance platform that scans your Git repositories for vulnerabilities, builds software bills of materials, performs dynamic application testing, and provides code intelligence through an interactive knowledge graph and AI chat.
Prüfwerk scans the source code of your products (firmware, PLC programs and
applications) for security weaknesses, builds their software bill of materials
(SBOM), matches the components against known vulnerabilities, and shows where
each product stands against the essential requirements of the Cyber Resilience
Act (CRA, Annex I). The interface is in German by default; the language toggle
in the sidebar switches it to English.
## What You Get
## What a scan covers
When you connect a repository, Prüfwerk runs a comprehensive scan pipeline that covers:
- **Static analysis (SAST)** -- Semgrep, and cppcheck for C and C++
- **Secrets** -- credentials committed to the code (gitleaks)
- **SBOM** -- the components, their versions and licenses, including libraries
copied into a firmware tree and the libraries of a CODESYS project
- **Known vulnerabilities (CVE)** -- the components matched against OSV.dev and NVD
- **PLC control logic** -- security rules for IEC 61131-3 programs
- **AI triage** -- an LLM reviews each new finding and gives a confidence,
a rationale and a remediation; findings it doubts are marked for review
- **CRA mapping** -- findings are assigned to the CRA Annex I requirements they
are evidence for
- **Static Analysis (SAST)** -- finds code-level vulnerabilities like injection flaws, insecure crypto, and misconfigurations
- **Software Bill of Materials (SBOM)** -- inventories every dependency, its version, and its license
- **CVE Monitoring** -- cross-references your dependencies against known vulnerabilities
- **Code Knowledge Graph** -- maps the structure of your codebase for impact analysis
- **AI Triage** -- every finding is reviewed by an LLM that provides severity assessment, confidence scores, and remediation guidance
- **Issue Tracking** -- automatically creates issues in your tracker for new findings
## The Overview
## Dashboard Overview
After logging in, you land on the Overview page, which gives you a snapshot of your security posture across all repositories.
![Dashboard overview showing stats cards, severity distribution, and recent scan activity](/screenshots/dashboard-overview.png)
The overview shows key metrics at a glance: total repositories, findings broken down by severity, dependency counts, CVE alerts, and tracker issues. A severity distribution chart visualizes your risk profile, and recent scan runs let you monitor scanning activity.
After signing in you land on **Übersicht** (Overview): the number of targets,
open findings (with how many are critical and high), components and known
vulnerabilities; **CRA-Stand je Prüfobjekt** (CRA status by target); and
**Als Nächstes** (Next up), the most severe open findings. See
[Dashboard Overview](/features/overview).
## Quick Walkthrough
Here is the fastest path from zero to your first scan results:
### 0. Or start with the demo targets
An empty workspace offers **Add demo targets** on the Targets page and in the
onboarding wizard. It creates a small curated set — two PLC projects, a
deliberately vulnerable web service and a Zephyr firmware sample — attaches
their files, detects each type and starts the first scans, so there are real
**Demo-Prüfobjekte hinzufügen** (Add demo targets) is offered on the
**Prüfobjekte** page while it is empty, and in the first step of the wizard. It creates a small
curated set — two PLC projects, a deliberately vulnerable web service and a
Zephyr firmware sample — and queues their first scans, so there are real
findings to look at within minutes. See [Demo targets](/guide/demo-targets).
### 1. Add a repository
### 1. Add a target
Navigate to **Repositories** in the sidebar and click **Add Repository**. Enter a name, the Git clone URL, and the default branch to scan.
Click **Neues Prüfobjekt** (Onboard) in the sidebar. Give the target a name,
choose its type, then attach its code: a git repository (HTTPS address, plus an
access token for a private one) or an archive (zip, tar, tar.gz). Click
**Anlegen und prüfen** (Create and scan). See [Adding Targets](/guide/repositories).
![Add repository dialog](/screenshots/add-repository.png)
### 2. The first scan
### 2. Trigger a scan
Click the **Scan** button on your repository row. The scan runs in the background through all phases: cloning, static analysis, SBOM extraction, CVE checking, graph building, and issue sync.
The first scan starts on its own, and the wizard shows its progress. To scan
again later, click **Prüfung starten** (Run scan) in the target's row on the
**Prüfobjekte** page or on the target's page.
### 3. View findings
Once the scan completes, navigate to **Findings** to see everything that was discovered. Each finding includes a severity level, description, code evidence, and AI-generated remediation guidance.
![Findings list with filters](/screenshots/findings-list.png)
Open **Befunde** (Findings) in the sidebar. Each finding has a severity, a
description, the code where it was found, the CRA requirements it concerns and,
where available, a remediation. Record your decision with the status buttons.
## Next Steps
- [Add and configure repositories](/guide/repositories) -- including private repos and issue tracker setup
- [Understand how scans work](/guide/scanning) -- phases, triggers, and deduplication
- [Work with findings](/guide/findings) -- triage, false positives, and developer feedback
- [Explore your SBOM](/guide/sbom) -- dependencies, licenses, and exports
- [Connect your IDE](/features/mcp-server) -- query findings from an LLM client over MCP
- [Add and configure targets](/guide/repositories) -- private repositories, archives, submodules
- [Understand how scans work](/guide/scanning) -- steps, triggers, and why a step did not run
- [Work with findings](/guide/findings) -- statuses, the two kinds of false alarm, history
- [Explore your SBOM](/guide/sbom) -- components, licenses, and exports
- [Connect an LLM client](/features/mcp-server) -- query findings over MCP
## Deployment modes (`APP_ENV`)
@@ -83,6 +91,7 @@ Some deployments run with `PW_FEATURES=source_only` — the shared staging
environment does. Dynamic testing needs infrastructure (a browser, a soft-PLC,
network access to a running target) that is not deployed there, so dynamic
application testing, pentest sessions, the ICS probe and the ephemeral PLC
runtime are hidden in the interface, and a scan records those stages as
*skipped* rather than failed. Everything static — SAST, SBOM, CVE, the graph,
runtime are unavailable: **DAST** and **Pentest** are greyed out in the sidebar
(**n. v.**), and a scan lists those stages under **Nicht ausgeführt** (Not run)
rather than failing. Everything static — SAST, SBOM, CVE, the graph,
AI triage, control mapping — works as documented.
+28 -17
View File
@@ -87,19 +87,25 @@ und startet die erste Prüfung.
Die erste Prüfung startet automatisch. Im Schritt **Fertig** steht
„Die erste Prüfung läuft. Der Fortschritt erscheint unten.“ Darunter sehen Sie
die einzelnen Schritte, zum Beispiel **Statische Codeanalyse (Semgrep)**,
**C/C++-Analyse (cppcheck)**, **Firmware-SBOM** oder
**SPS-Bibliotheken (SBOM)**, und die **Laufzeit**. Prüfungen, die ein
laufendes System brauchen, etwa **Dynamische Prüfung (DAST)**, stehen in der
Testphase unter **Nicht ausgeführt**.
einen Fortschrittsbalken mit den einzelnen Schritten, zum Beispiel
**Projekt erkennen**, **Statische Codeanalyse**, **SBOM erstellen** und
**Bekannte Schwachstellen (CVE)**, den aktuellen Schritt (**Aktueller Schritt**) und die
**Laufzeit**. Schritte, die nicht gelaufen sind, stehen mit Grund unter
**Nicht ausgeführt**; Prüfungen, die ein laufendes System brauchen, etwa
**Dynamische Prüfung (DAST)**, stehen in der Testphase dort.
Je nach Umfang des Codes dauert eine Prüfung einige Minuten. Sie können die
Seite verlassen; die Prüfung läuft weiter. Mit **Zu den Befunden** oder
**Zu den Prüfobjekten** geht es weiter.
Eine neue Prüfung, etwa nach einer Änderung am Code, starten Sie unter
**Prüfobjekte** mit **Prüfung starten**. Unter **Details** finden Sie den
**Prüfverlauf** aller Prüfungen.
**Prüfobjekte** mit **Prüfung starten**. Ein Klick auf die Zeile oder den Namen
eines Prüfobjekts öffnet seine Seite; dort stehen unter **Prüfläufe** alle
Prüfungen.
Findet eine abgeschlossene Prüfung neue Befunde, schickt die Plattform eine E-Mail an die
Verantwortlichen Ihres Arbeitsbereichs, mit der Zahl der neuen Befunde je
Schweregrad und einem Link zu Prüfwerk.
## 4. Befunde
@@ -112,13 +118,17 @@ Anforderungen, für die er relevant ist.
Ein Klick auf einen Befund öffnet die Einzelheiten: **Beschreibung**,
**Fundstelle**, den betroffenen **Code**, die **CRA-Anforderungen (Anhang I)**
und, wo vorhanden, eine **Behebung**. Mit **Status ändern** halten Sie fest, wie
Sie mit dem Befund umgehen, zum Beispiel **Behoben**, **Fehlalarm** oder
**Risiko akzeptiert** mit einer **Begründung**. Mehr dazu unter
Sie mit dem Befund umgehen, zum Beispiel **Behoben**, **Fehlalarm – Regel**
(die Regel hat bei unproblematischem Code angeschlagen),
**Fehlalarm – Zuordnung** (der Befund verletzt die zugeordnete CRA-Anforderung
nicht; mit **Begründung**) oder **Risiko akzeptiert** (mit **Begründung**).
Befunde, die die automatische Bewertung anzweifelt, stehen auf **Zu prüfen**.
Jede Änderung steht mit Person, Zeitpunkt und Begründung im **Verlauf**. Mehr dazu unter
[Befunde](/guide/findings).
## 5. Stückliste (SBOM)
Unter **SBOM** steht die Stückliste (SBOM) aller Prüfobjekte: welche
Unter **Stückliste** in der Seitenleiste steht die Stückliste (SBOM) aller Prüfobjekte: welche
Komponenten in welcher Version enthalten sind, unter welcher Lizenz sie stehen
und welche bekannten Schwachstellen (CVE) für sie gemeldet sind. Dazu gehören
auch Firmware-Komponenten wie FreeRTOS, lwIP, Mbed TLS oder FatFs und die
@@ -131,13 +141,14 @@ Bibliotheken eines CODESYS-Projekts.
Firmware-Stände.
Mit **Exportieren** laden Sie die Stückliste eines Prüfobjekts als
CycloneDX 1.5 oder SPDX 2.3 herunter. Mehr dazu unter
CycloneDX 1.5 oder SPDX 2.3 herunter; dazu wählen Sie zuerst das Prüfobjekt. Mehr dazu unter
[Stückliste (SBOM) und Lizenzen](/guide/sbom).
## 6. CRA-Status
Unter **Prüfobjekte** öffnen Sie mit **Details** ein Prüfobjekt und klicken
auf **CRA-Status anzeigen**. Der **CRA-Status** zeigt für jede der 40
Unter **Prüfobjekte** öffnen Sie ein Prüfobjekt mit einem Klick auf seine Zeile
und klicken im Abschnitt **CRA-Stand** auf **Stand je Anforderung**. Auch die
Übersicht führt unter **CRA-Stand je Prüfobjekt** dorthin. Der **CRA-Status** zeigt für jede der 40
grundlegenden Anforderungen aus Anhang I des Cyber Resilience Act den Stand
dieses Prüfobjekts:
@@ -155,8 +166,8 @@ keine Konformitätsbewertung.
## 7. Nachweispaket
Mit **Nachweispaket herunterladen** (auf der Seite **CRA-Status** und unter
**Details** eines Prüfobjekts) erhalten Sie ein ZIP mit:
Mit **Nachweispaket herunterladen** (auf der Seite **CRA-Status** und auf der
Seite eines Prüfobjekts) erhalten Sie ein ZIP mit:
- der Bewertung gegen CRA Anhang I im Format OSCAL,
- der Stückliste als CycloneDX und SPDX,
@@ -170,8 +181,8 @@ MCP zur Verfügung.
## Befunde aus Pentests und manuellen Tests
Ergebnisse eines externen Penetrationstests oder eines DAST-Laufs gehören zum
selben Prüfobjekt. Unter **Prüfobjekte** → **Details** →
**Befunde aus manuellen Tests** können Sie einen **Befund erfassen** oder mit
selben Prüfobjekt. Auf der Seite des Prüfobjekts können Sie unter
**Befunde aus manuellen Tests** einen **Befund erfassen** oder mit
**Bericht importieren** eine Datei im Format SARIF 2.1.0 oder ZAP-JSON
übernehmen. Mehr dazu unter
[Befunde aus manuellen Tests](/guide/manual-findings).
+10 -15
View File
@@ -15,16 +15,14 @@ This means every actionable finding gets tracked in the same system your develop
## Issues List
Navigate to **Issues** in the sidebar to see all tracker issues across your repositories.
![Issues list showing tracker issues](/screenshots/issues-list.png)
Open **Tickets** (Issues) in the sidebar to see all tracker issues across your targets.
The issues table shows:
| Column | Description |
|--------|-------------|
| Tracker | Badge showing GitHub, GitLab, Gitea, or Jira |
| External ID | Issue number in the external system |
| ID | Issue number in the external system |
| Title | Issue title |
| Status | Open, Closed, or tracker-specific status |
| Created | When the issue was created |
@@ -34,23 +32,20 @@ Click the link to go directly to the issue in your tracker.
## Supported Trackers
| Tracker | How to Configure |
|---------|-----------------|
| **GitHub Issues** | Set up in the repository's issue tracker settings with your GitHub API token |
| **GitLab Issues** | Set up with your GitLab project ID, instance URL, and API token |
| **Gitea Issues** | Set up with your Gitea repository details, instance URL, and API token |
| **Jira** | Set up with your Jira project key, instance URL, email, and API token |
GitHub Issues, GitLab Issues, Gitea Issues and Jira.
Issue tracker configuration is per-repository. You set it up when [adding or editing a repository](/guide/repositories#configuring-an-issue-tracker).
The tracker is configured per target. The dashboard has no settings for it yet;
it is set through the API. See
[Connecting an Issue Tracker](/guide/repositories#connecting-an-issue-tracker).
## Deduplication
Issues are deduplicated using the same fingerprint hash that deduplicates findings. This means:
- If the same vulnerability appears in consecutive scans, only one issue is created
- If a finding is resolved and then reappears, the platform recognizes it and can reopen the existing issue rather than creating a duplicate
- Different findings (even if similar) get separate issues because their fingerprints differ based on file path, line number, and vulnerability type
- If the same vulnerability appears in consecutive scans, only one issue is created: issues are created only for new findings
- Before creating an issue, Prüfwerk searches the tracker by fingerprint and then by title, and does not create a second one
- Different findings (even if similar) get separate issues because their fingerprints differ based on rule, file path and line
## Linked Issues in Finding Detail
When viewing a [finding's detail page](/guide/findings#finding-detail), you will see a **Linked Issue** section if an issue was created for that finding. This provides a direct link to the external tracker issue, making it easy to jump between the security context in Prüfwerk and the development workflow in your tracker.
When viewing a [finding's detail page](/guide/findings#finding-detail), you will see a **Verknüpftes Ticket** (Linked issue) section if an issue was created for that finding. This provides a direct link to the external tracker issue, making it easy to jump between the security context in Prüfwerk and the development workflow in your tracker.
+13 -5
View File
@@ -8,8 +8,8 @@ the control application *and* the device it runs on.
| --- | --- |
| PLC project (PLCopen XML / ST, or a `.projectarchive`) | **Control-logic SAST** — semantic security rules over ST **and** graphical FBD/LD |
| A `.projectarchive` | **Control-app SBOM** — the referenced CODESYS libraries + the runtime version, matched against known CVEs |
| A device firmware image | *Not analysed yet* — the run records it as skipped, and says so. Firmware is covered from its **sources**, or from an imported Firmwerk bundle |
| A reachable endpoint (WebVisu, OPC UA) | DAST / pentest (opt-in) |
| A device firmware image | *Not analysed yet* — the run lists it under **Nicht ausgeführt**, and says so. Firmware is covered from its **sources** |
| A reachable endpoint (WebVisu, OPC UA) | DAST / pentest / ICS probe (opt-in; not available in a source-only deployment such as the pilot) |
## Anatomy: a soft PLC is a SoC + Linux + runtime
@@ -74,7 +74,7 @@ layer**, entirely separate from the control application. Hand it to Prüfwerk as
its own **firmware image** artifact. Nothing unpacks an image yet: the scan run
records that layer as skipped and names the reason, so an unanalysed image is
never mistaken for a clean one. Until it lands, the firmware layer is covered
from its **sources** or from an SBOM imported out of a Firmwerk bundle. The device OS need not be Yocto — Raspbian/Debian/Buildroot, or
from its **sources**: its components are derived from the source tree. The device OS need not be Yocto — Raspbian/Debian/Buildroot, or
even an RTOS / bare-metal, are all possible — but Yocto is the common,
product-grade industrial choice.
:::
@@ -148,8 +148,16 @@ surface real CODESYS advisories as CVE alerts.
## Dynamic testing — ICS protocol probe
Beyond the static analysis, Prüfwerk can **probe the running device** over
industrial protocols. Attach a **Live URL** artifact (the device host / WebVisu
URL) to the PLC/SPS target and enable the **ICS Probe** scan.
industrial protocols. Attach a **Live-URL** artifact (the device host / WebVisu
URL) to the PLC/SPS target and enable the probe under **Optionale Prüfungen**
(opt-in scans) in the last step of the wizard.
::: info Not in source-only deployments
A deployment that scans source code only, such as the cloud pilot, does not run
the ICS probe: the **Live-URL** artifact kind cannot be chosen, and where a
scan would have run it, it lists **Industrieprotokolle (ICS)** under
**Nicht ausgeführt** with „In dieser Umgebung nicht aktiviert.“
:::
The probe is **read-only** — it never writes to the live process. It currently
speaks **Modbus/TCP** (port 502): it confirms whether the device answers
+178 -58
View File
@@ -1,26 +1,110 @@
# Adding Repositories
# Adding Targets
Repositories are the core resource in Prüfwerk. Each tracked repository is scanned on a schedule, and its results are available across all features -- findings, SBOM, code graph, AI chat, and issue tracking.
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.
## Adding a Repository
## The Targets List
1. Navigate to **Repositories** in the sidebar
2. Click **Add Repository**
3. Fill in the form:
- **Name** -- a display name for the repository
- **Git URL** -- the HTTPS clone URL, e.g. `https://github.com/org/repo.git`
- **Default Branch** -- the branch to scan, e.g. `main` or `master`
4. Click **Add**
**Prüfobjekte** (Targets) in the sidebar lists all targets:
![Add repository dialog](/screenshots/add-repository.png)
| 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 repository appears in the list immediately. It will not be scanned until you trigger a scan manually or the next scheduled scan runs.
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)).
## Public vs Private Repositories
## 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** | BSP + image |
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. Add the repository's HTTPS URL and, in the credentials section, a read-only access token for it.
**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
@@ -29,7 +113,7 @@ The repository appears in the list immediately. It will not be scanned until you
- **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 the repository's credentials
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.
@@ -39,64 +123,100 @@ The repository appears in the list immediately. It will not be scanned until you
Scope the token to a single repository and to read-only access. That is the smallest credential that lets Prüfwerk clone your code.
:::
## Configuring an Issue Tracker
## Git Submodules
You can connect an issue tracker so that new findings are automatically created as issues in your existing workflow.
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.
When adding or editing a repository, expand the **Issue Tracker** section to configure:
- **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.
![Add repository dialog with issue tracker options](/screenshots/add-repository-tracker.png)
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.
### Supported Trackers
::: 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`.
:::
| Tracker | Required Fields |
|---------|----------------|
| **GitHub Issues** | Repository owner, repository name, API token |
| **GitLab Issues** | Project ID, GitLab URL, API token |
| **Gitea Issues** | Repository owner, repository name, Gitea URL, API token |
| **Jira** | Project key, Jira URL, email, API token |
## The Target's Page
Each tracker is configured per-repository, so different repositories can use different trackers.
A click on a target in the **Prüfobjekte** list opens its page. At the top are
its name, type and artifacts, and the buttons:
## Editing Repository Settings
- **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 and a manifest with SHA-256 checksums.
- **Bearbeiten** (Edit) -- see below.
- **Löschen** (Delete) -- see below.
Click the **Edit** button on any repository row to modify its settings, including the issue tracker configuration.
Below them:
![Edit repository modal with tracker configuration](/screenshots/edit-repository.png)
- **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).
- **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).
From the edit modal you can:
## Editing a Target
- Change the repository name, Git URL, or default branch
- Add, modify, or remove issue tracker configuration
**Bearbeiten** on the target's page opens **Prüfobjekt bearbeiten**. There you
can:
## Repository List
- 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.
The repositories page shows all tracked repositories in a table.
Click **Speichern** (Save) to keep the changes. Changes take effect with the next
scan.
![Repository list table](/screenshots/repositories-list.png)
## Connecting an Issue Tracker
| Column | Description |
|--------|-------------|
| Name | Repository display name |
| Git URL | Clone URL |
| Branch | Default branch being scanned |
| Findings | Total number of security findings |
| Last Scanned | Relative timestamp of the most recent scan |
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).
## Triggering a Scan
## Deleting a Target
Click the **Scan** button on any repository row to trigger an immediate scan. The scan runs in the background through all phases (clone, SAST, SBOM, CVE, graph, issue sync). You can monitor progress on the Overview page under recent scan runs.
**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.
## Deleting a Repository
Click the **Delete** button on a repository row. A confirmation dialog appears warning that this action permanently removes:
- All security findings
- SBOM entries and vulnerability data
- Scan run history
- Code graph data
- Embedding vectors (for AI chat)
- CVE alerts
- Tracker issues
This action cannot be undone.
This cannot be undone.
+81 -65
View File
@@ -1,59 +1,84 @@
# SBOM & Licenses
The SBOM (Software Bill of Materials) feature provides a complete inventory of all dependencies across your repositories, with vulnerability tracking and license compliance analysis.
The SBOM (software bill of materials, *Stückliste*) lists the components of
each target, with their versions, licenses and known vulnerabilities.
## What is an SBOM?
A Software Bill of Materials is a list of every component (library, package, framework) that your software depends on, along with version numbers, licenses, and known vulnerabilities. SBOMs are increasingly required for compliance audits, customer security questionnaires, and supply chain transparency.
A Software Bill of Materials is a list of every component (library, package, framework) that your software depends on, along with version numbers, licenses, and known vulnerabilities. The CRA expects manufacturers to know the components of their products; SBOMs are also asked for in customer security questionnaires and audits.
Prüfwerk generates SBOMs automatically during each scan using Syft for dependency extraction and OSV.dev + NVD for vulnerability matching.
## Where the components come from
Prüfwerk builds the SBOM during each scan:
- **Package dependencies** -- read with Syft from the lockfiles in the code
(`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lock`, `Cargo.lock`,
`requirements.txt`, `poetry.lock`, `Pipfile.lock`, `uv.lock`). A manifest
without a lockfile gives no versions; the scan lists it under **Nicht
ausgeführt** (see [Prüfungen](/guide/scanning#what-the-scanner-runs-on-your-code)).
- **Libraries copied into a firmware tree** -- microcontroller projects carry
their RTOS, TCP/IP stack and TLS library as source, with no manifest. Prüfwerk
recognises **FreeRTOS**, **FreeRTOS+TCP**, **lwIP**, **Mbed TLS**, **wolfSSL**
and **FatFs** and reads each one's version from its header. They appear with
the package source `embedded`.
- **Firmware builds** -- for a firmware target, the libraries and toolchain
named by the build files in the source tree (Make, CMake, Zephyr, ESP-IDF,
PlatformIO, Arduino, embedded Rust).
- **CODESYS projects** -- the referenced libraries and the runtime version from
a `.projectarchive`; see [SPS / PLC (CODESYS)](/guide/plc).
Firmware images, container images and app packages are not unpacked yet; their
components come from the source code.
## Known vulnerabilities
Package dependencies are matched against [OSV.dev](https://osv.dev/). Libraries
copied into a firmware tree and the CODESYS runtime have no package identifier
OSV could look up, so they are matched against [NVD](https://nvd.nist.gov/) by
CPE: all CVEs of the product are fetched and their affected version ranges are
compared with the version in use. Components that could not be matched are
listed on the scan run under **CVE-Abgleich unvollständig**.
Known components are re-checked hourly, so a CVE published against an unchanged
component still raises an alert.
## Packages Tab
Navigate to **SBOM** in the sidebar to see the packages tab, which lists all dependencies discovered during scans.
![SBOM packages tab with filters and export options](/screenshots/sbom-packages.png)
Open **Stückliste** in the sidebar. The **Pakete** (Packages) tab lists the
components of all targets, 50 per page.
### Filtering
Use the filter bar to narrow results:
- **Alle Prüfobjekte** -- one target, or all
- **Alle Paketquellen** (All managers) -- the package source, e.g. npm, cargo,
pip, or `embedded` for libraries found in a firmware tree
- **Pakete durchsuchen …** -- search by package name
- **Alle Pakete** / **Mit Schwachstellen** / **Ohne Schwachstellen**
- **Alle Lizenzen** -- one license
- **Repository** -- select a specific repository or view all
- **Package Manager** -- npm, cargo, pip, go, maven, nuget, composer, gem
- **Search** -- filter by package name
- **Vulnerabilities** -- show all packages, only those with vulnerabilities, or only clean packages
- **License** -- filter by specific license (MIT, Apache-2.0, BSD-3-Clause, GPL-3.0, etc.)
### Package Details
Each package row shows:
### Columns
| Column | Description |
|--------|-------------|
| Package | Package name |
| Version | Installed version |
| Manager | Package manager (npm, cargo, pip, etc.) |
| License | License identifier with color-coded badge |
| Vulnerabilities | Count of known vulnerabilities (click to expand) |
| **Paket** (Package) | Package name |
| **Version** | The version in use |
| **Paketquelle** (Manager) | Where the component comes from (npm, cargo, pip, embedded, …) |
| **Lizenz** (License) | License identifier |
| **Schwachstellen** (Vulnerabilities) | **Keine**, or the number of CVEs |
### Vulnerability Details
Click the CVE count to expand the details: the vulnerability ID, the source
database, the severity where known, and **Hinweis ansehen →** (View advisory).
Click the vulnerability count on any package to expand inline details showing:
## Licenses Tab
- Vulnerability ID (e.g. CVE-2024-1234)
- Source database
- Severity level
- Link to the advisory
## License Compliance Tab
The license compliance tab helps you understand your licensing obligations across all dependencies.
![License compliance tab with copyleft warnings and distribution chart](/screenshots/sbom-licenses.png)
The **Lizenzen** tab summarises the licenses.
### Copyleft Warnings
If any dependencies use copyleft licenses (GPL, AGPL, LGPL, MPL), a warning banner appears listing the affected packages. Copyleft licenses may impose distribution requirements on your software.
If any component uses a copyleft license (GPL, AGPL, LGPL, MPL and their
variants), the banner **Copyleft-Lizenzen gefunden** lists the affected
packages. Copyleft licenses may impose obligations when you distribute your
software.
::: warning
Copyleft-licensed dependencies can require you to release your source code under the same license. Review flagged packages carefully with your legal team if you distribute proprietary software.
@@ -61,51 +86,42 @@ Copyleft-licensed dependencies can require you to release your source code under
### License Distribution
A horizontal bar chart visualizes the percentage breakdown of licenses across your dependencies, giving you a quick overview of your licensing profile.
**Lizenzverteilung** shows the share of each license across the components.
### License Table
A detailed table lists every license found:
**Alle Lizenzen** lists every license:
| Column | Description |
|--------|-------------|
| License | License identifier |
| Type | **Copyleft** or **Permissive** badge |
| Packages | List of packages using this license |
| Count | Number of packages |
**Copyleft licenses** (flagged as potentially restrictive): GPL-2.0, GPL-3.0, AGPL-3.0, LGPL-2.1, LGPL-3.0, MPL-2.0
**Permissive licenses** (generally safe for commercial use): MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, and others
| **Lizenz** | License identifier |
| **Art** | **Copyleft** or **Freizügig** (permissive) |
| **Pakete** | The packages using it |
| **Anzahl** | Number of packages |
## Export
You can export your SBOM in industry-standard formats:
1. On the **Pakete** tab, select a target under **Alle Prüfobjekte**. Export
works for one target at a time; without a selection the export says
**Zuerst ein Prüfobjekt wählen**.
2. Click **Exportieren** and choose a format:
- **CycloneDX 1.5** -- JSON, widely supported by security tools
- **SPDX 2.3** -- the Linux Foundation standard, common for license compliance
3. Click **Herunterladen**. The SBOM downloads as a JSON file.
1. Select a repository (or export across all repositories)
2. Choose a format:
- **CycloneDX 1.5** -- JSON format widely supported by security tools
- **SPDX 2.3** -- Linux Foundation standard for license compliance
3. Click **Export**
4. The SBOM downloads as a JSON file
::: tip
SBOM exports are useful for compliance audits, customer security questionnaires, government procurement requirements, and supply chain transparency.
:::
The evidence pack on the target's page also contains both formats.
## Compare Tab
Compare the dependency profiles of two repositories side by side:
**Vergleich** compares the SBOMs of two targets, for example two firmware
releases:
1. Select **Repository A** from the first dropdown
2. Select **Repository B** from the second dropdown
3. View the comparison results:
1. Select **Prüfobjekt A** and **Prüfobjekt B**.
2. The result shows:
| Section | Description |
|---------|-------------|
| **Only in A** | Packages present in repo A but not in repo B |
| **Only in B** | Packages present in repo B but not in repo A |
| **Version Diffs** | Same package with different versions between repos |
| **Common** | Count of packages that match exactly |
This is useful for auditing consistency across microservices, identifying dependency drift, and planning coordinated upgrades.
| **Nur in A** | Packages only in target A |
| **Nur in B** | Packages only in target B |
| **Versionsunterschiede** | The same package in different versions |
| **Gemeinsam** | Number of packages that match exactly |
+131 -46
View File
@@ -1,32 +1,79 @@
# Running Scans
Scans are the primary workflow in Prüfwerk. Each scan analyzes a repository for security vulnerabilities, dependency risks, and code structure.
A scan (*Prüfung*) examines one target: its source code, its components and,
for a PLC project, its control logic. Each scan is recorded as a scan run
(*Prüflauf*) on the target's page.
## What Happens During a Scan
When a scan is triggered, Prüfwerk runs through these phases in order:
For a target with source code (a git repository or an uploaded archive), a scan
runs through these steps in order. The dashboard shows them with their German
names while the scan runs.
1. **Clone** -- pulls the latest code from the Git remote (or clones it for the first time)
2. **SAST** -- runs static analysis using Semgrep with rules covering OWASP, GDPR, OAuth, secrets, and general security patterns
3. **SBOM** -- extracts all dependencies using Syft, identifying packages, versions, licenses, and known vulnerabilities via OSV.dev + NVD
4. **CVE Check** -- cross-references dependencies against the NVD database for known CVEs
5. **Graph Build** -- parses the codebase to construct a code knowledge graph of functions, classes, and their relationships
6. **AI Triage** -- new findings are reviewed by an LLM that assesses severity, considers blast radius using the code graph, and generates remediation guidance
7. **Issue Sync** -- creates or updates issues in connected trackers (GitHub, GitLab, Gitea, Jira) for new findings
1. **Detect the project** (*Projekt erkennen*) -- gets the code and works out what it is. The dashboard shows which step it is on:
- *Repository klonen* -- clones the repository the first time, later only fetches what changed. Every later step reuses this one checkout.
- *Submodule holen* -- checks out the repository's submodules (see [Git Submodules](/guide/repositories#git-submodules)). With many submodules this is the longest step of the first scan.
- *Archiv entpacken* -- for an uploaded archive instead of a repository.
- *Projekttyp bestimmen* -- firmware, PLC project, backend service, and so on.
- *Firmware analysieren* -- for firmware, lists the libraries and toolchain the build uses.
2. **Static code analysis** (*Statische Codeanalyse*) -- Semgrep over the whole
tree; for C and C++ also cppcheck, which follows values through the code
(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.
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.
4. **Known vulnerabilities** (*Bekannte Schwachstellen (CVE)*) -- the components
are matched against OSV.dev; the firmware libraries against NVD by CPE.
5. **Privacy patterns** (*Datenschutz-Muster*) -- Prüfwerk's own GDPR and OAuth
pattern rules.
6. **Secrets in the code** (*Zugangsdaten im Code*) -- gitleaks.
7. **Code quality** (*Code-Qualität*) -- linters; those that have to run the
project's own code only where the deployment allows it (see
[What the scanner runs on your code](#what-the-scanner-runs-on-your-code)).
8. **Code graph** (*Code-Graph*) -- a map of functions and calls, used by the
AI triage.
9. **AI triage** (*Befunde bewerten*) -- an LLM reviews each new finding, gives
a confidence and a rationale and, where possible, a remediation. Findings it
doubts are set to **Zu prüfen** (see [Understanding Findings](/guide/findings#statuses)).
10. **Control mapping** (*CRA-Anforderungen zuordnen*, *Controls zuordnen*) --
findings are assigned to the CRA Annex I requirements and to the controls of
the BreakPilot catalog they are evidence for. The mapping is checked against
the code first. It asks the model about each finding, so it can take several
minutes.
11. **Checking controls in code** (*Controls im Code prüfen*) -- requirements
that are about something missing (no rate limiting, no security logging, no
signature check on updates) have no pattern to match; the code that should
implement them is looked up and judged, which can add findings.
12. **Creating issues** (*Tickets anlegen*) -- new findings become tickets in a
connected issue tracker, if one is configured.
Each phase produces results that are visible in the dashboard as soon as they complete.
A **PLC project** runs *Projekt erkennen*, then **PLC analysis**
(*SPS-Analyse*: the control-logic rules and, from a `.projectarchive`, the
library SBOM), then *Controls zuordnen*. See [SPS / PLC (CODESYS)](/guide/plc).
New findings appear on the target's page while the scan is still running.
## How Scans Are Triggered
### Manual Scan
1. Go to **Repositories**
2. Click **Scan** on the repository you want to scan
3. The scan starts immediately in the background
Click **Prüfung starten** (Run scan), either in the row of the target in the
**Prüfobjekte** list or at the top of the target's page. The scan starts in the
background and the message "Prüfung gestartet. Den Fortschritt sehen Sie unter
Prüfläufe." appears. A new target is scanned once as soon as you create it in
the **Neues Prüfobjekt** wizard.
A manual scan always scans in full, even if nothing changed.
### Scheduled Scans
Repositories are scanned automatically on a recurring schedule. By default, scans run every 6 hours and CVE monitoring runs daily. Your administrator controls these schedules.
Targets are scanned automatically on a recurring schedule: by default every 6
hours, with an hourly check of known components for newly published CVEs. Your
administrator controls these schedules. A scheduled scan of a git repository
with no new commits since the last scan does not scan again; the run says so
under **Nicht ausgeführt**.
### Webhook-Triggered Scans
@@ -42,33 +89,64 @@ follow-up is waiting are dropped — the follow-up will scan the latest code
anyway. Ten pushes during one long scan therefore cost two scans, and only scans
that actually run are counted towards your plan.
## Scan Phases and Statuses
## Scan Statuses
Each scan progresses through these statuses:
The **Prüfläufe** (Scan runs) section of a target's page lists its scans, newest
first. Each run has one of these statuses:
| Status | Meaning |
|--------|---------|
| **Queued** | Scan is waiting to start |
| **Running** | Currently executing scan phases |
| **Completed** | All phases finished successfully |
| **Failed** | Stopped due to an error |
| **Interrupted** | The scanner was restarted (for example by an update) while the scan was running. Nothing in your code caused it; start the scan again. |
| **Läuft** (Running) | The scan is running. The run shows the current step, the elapsed time (**Laufzeit**), a progress bar and the new findings so far. |
| **Abgeschlossen** (Completed) | The scan finished. Some steps may still be listed under **Nicht ausgeführt**. |
| **Fehlgeschlagen** (Failed) | The scan stopped because of an error; the reason is shown under **Fehler**. |
| **Unterbrochen** (Interrupted) | The service was restarted (for example by an update) while the scan was running. Nothing in your code caused it; start the scan again. |
You can monitor scan progress on the Overview page, which shows the most recent scan runs across all repositories, including the current phase, finding count, and duration.
The **Prüfobjekte** list shows each target's last scan, and the step a running
scan is at.
## Scan Types
## E-mail when a scan finds something new
A full scan runs multiple analysis engines, each producing different types of findings:
When a scan completes and has found findings that were not there before, the
platform sends an e-mail to the people who run your workspace. It names the
target, the number of new findings and how many are critical, high, medium and
low (low and info together), and links to the dashboard. A scan that only finds
what earlier scans already found sends no mail; neither does a failed scan.
| Scan Type | What It Detects | Scanner |
|-----------|----------------|---------|
| **SAST** | Code-level vulnerabilities (injection, XSS, insecure crypto, etc.) | Semgrep |
| **SBOM** | Dependency inventory, outdated packages, known vulnerabilities | Syft + OSV.dev/NVD |
| **CVE** | Known CVEs in dependencies cross-referenced against NVD | NVD API |
| **GDPR** | Personal data handling issues, consent violations | Custom rules |
| **OAuth** | OAuth/OIDC misconfigurations, insecure token handling | Custom rules |
| **Secrets** | Hardcoded credentials, API keys, tokens in source code | Custom rules |
| **Code Review** | Architecture and security patterns reviewed by AI | LLM-powered |
## Why a scan failed
A failed run shows one of these reasons under **Fehler**:
| Reason shown | What to do |
|---|---|
| Das Repository ließ sich nicht klonen. Bitte Adresse und Zugangstoken beim Prüfobjekt unter „Bearbeiten“ prüfen. | Check the repository's HTTPS address and access token under **Bearbeiten** on the target's page. |
| Das Archiv ist passwortgeschützt. Bitte das Passwort beim Prüfobjekt unter „Bearbeiten“ eingeben. | Enter the archive's password under **Bearbeiten**, then start the scan again. |
| Das gespeicherte Passwort öffnet das Archiv nicht. | Change the password under **Bearbeiten**. |
| Durch einen Neustart des Dienstes unterbrochen. Bitte die Prüfung erneut starten. | Start the scan again. |
| Die Prüfung wurde wegen eines internen Fehlers abgebrochen. Wir sehen ihn im Protokoll; eine erneute Prüfung hilft oft. | Start the scan again; if it keeps failing, contact support. |
## Steps not run (*Nicht ausgeführt*)
A run can complete and still list steps under **Nicht ausgeführt** (Not run),
each with its name and the reason. A tool that did not complete is not counted
as a clean result: the CRA requirements it checks show as **Nicht bewertet**.
| Step | Reason shown | What to do |
|---|---|---|
| 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. |
| 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. |
| **SPS-Bibliotheken (SBOM)** | *(file)* ist kein lesbares CODESYS-Projektarchiv. | Export the archive again with *File → Project Archive*, with the referenced libraries ticked. |
| **Einlesen der Dateien** | *(file)* konnte nicht gelesen werden. | Check the file and upload it again under **Bearbeiten**. |
| **Archiv-Passwort fehlt (beim Prüfobjekt unter „Bearbeiten“ eingeben)** | *(file)* ist passwortgeschützt. | Enter the password under **Bearbeiten**. |
| **Archiv-Passwort falsch (beim Prüfobjekt unter „Bearbeiten“ ändern)** | Das gespeicherte Passwort öffnet *(file)* nicht. | Change the password under **Bearbeiten**. |
| **Firmware-SBOM** | Die Firmware-Stückliste konnte nicht erstellt werden. | Start the scan again. |
| **Firmware-SBOM** | Kein unterstütztes Build-System gefunden (Make, CMake, Zephyr, ESP-IDF, PlatformIO, Arduino, Embedded Rust). | The firmware components come from the build files in the source tree; include them in the repository or archive. |
| **Firmware-SBOM** | *(build system)*-Build erkannt, aber ohne Build lassen sich keine Komponenten auflösen. | The components could not be read from the sources without building. Importing a Firmwerk bundle, which the message mentions, is not available yet. |
| **CVE-Abgleich unvollständig** | Nicht abgeglichen: *(lookup and components)* | Start the scan again later; the lookup service may have been unavailable. |
| **Änderungserkennung** | Keine neuen Commits seit der letzten Prüfung, daher nicht erneut geprüft. „Prüfung starten“ prüft trotzdem vollständig. | Nothing; click **Prüfung starten** for a full scan. |
## Where a scan may connect
@@ -139,35 +217,42 @@ from the directory it runs in, so it runs from an empty one: a committed
`.cargo/audit.toml` can neither point it at another advisory database nor
silence advisories.
For a complete firmware SBOM, build with Firmwerk on your side and import the bundle.
Firmware components are derived from the source tree: the build files name the
libraries and toolchain, and libraries copied into the tree are recognised by
their headers. There is no import of a Firmwerk bundle yet.
A single-tenant or sandboxed deployment can turn them on with
`PW_ALLOW_UNTRUSTED_CODE_EXEC=1`; a hardened deployment ignores it. The stages
return later as sandboxed Werkbank jobs. The agent image does not ship Nix, so
the firmware build only runs where the agent itself runs next to a Nix
installation; everywhere else firmware SBOMs stop at analysis unless you
import a Firmwerk bundle.
installation; everywhere else the firmware SBOM is what the analysis of the
sources finds.
Every external tool also runs with an empty environment apart from a short
allowlist (`PATH`, `HOME`, `TMPDIR`, and its own cache variables), so the
agent's credentials are not visible to it, and it is killed when its timeout
expires.
## Deduplication and Fingerprinting
Findings are deduplicated using a fingerprint hash based on the scanner, file path, line number, and vulnerability type. This means:
Every finding has a fingerprint built from the target, the tool's rule, the file
path and the line. A scan stores only findings whose fingerprint is new, so:
- **Repeated scans** will not create duplicate findings for the same issue
- **Tracker issues** are only created once per unique finding
- **Resolved findings** that reappear in a new scan are flagged for re-review
The fingerprint is also used to match findings to existing tracker issues, preventing duplicate issues from being created in GitHub, GitLab, Gitea, or Jira.
- **Repeated scans** do not create duplicate findings for the same issue.
- **Your decisions stay.** A later scan does not change the status of a finding
it already knows. It does not reopen a **Behoben** finding that is found
again, and it does not close a finding that is no longer found; set the
status yourself.
- **Tracker issues** are only created for new findings. Before creating one,
Prüfwerk searches the tracker by fingerprint and then by title, so an existing
issue is not created twice.
## Interpreting Results
After a scan completes, you can explore results in several ways:
- **Findings** -- browse all discovered vulnerabilities with filters for severity, type, and status. See [Understanding Findings](/guide/findings).
- **SBOM** -- review your dependency inventory, check for vulnerable packages, and audit license compliance. See [SBOM & Licenses](/guide/sbom).
- **Overview** -- check the dashboard for a high-level summary of your security posture across all repositories.
- **Issues** -- see which findings have been pushed to your issue tracker. See [Issues & Tracking](/guide/issues).
- **Befunde** -- all findings with filters for target, severity, type and status. See [Understanding Findings](/guide/findings).
- **Stückliste** -- the components, their licenses and known vulnerabilities. See [SBOM & Licenses](/guide/sbom).
- **Übersicht** -- where each target stands against the CRA, and the most severe open findings.
- The target's page -- its CRA status, SBOM figures, open findings and scan runs.
+58 -21
View File
@@ -6,13 +6,37 @@ Prüfwerk uses a combination of open-source scanners and AI-powered analysis to
[Semgrep](https://semgrep.dev/) is an open-source static analysis tool that finds vulnerabilities by matching patterns in source code. It supports many languages and has an extensive rule library.
Prüfwerk runs Semgrep with rules covering:
Prüfwerk runs Semgrep with its public `auto` ruleset plus its own CRA rules
for controls no off-the-shelf rule covers (secure defaults, weak password
hashing, insecure session cookies, weak ciphers for data at rest).
- **OWASP Top 10** -- injection, broken authentication, XSS, insecure deserialization, and more
- **General security** -- insecure cryptography, hardcoded credentials, path traversal
- **Language-specific** -- patterns unique to Python, JavaScript, TypeScript, Rust, Go, Java, and others
Semgrep produces **Codeanalyse (SAST)** findings with file paths, line numbers, and rule descriptions.
Semgrep produces SAST-type findings with file paths, line numbers, and rule descriptions.
## cppcheck -- C and C++ Analysis
[cppcheck](https://cppcheck.sourceforge.io/) runs on trees with C or C++ code.
Where Semgrep matches patterns, cppcheck follows values through the code, which
finds the defects that matter in firmware: out-of-bounds writes, uninitialised
reads, null dereferences and leaks. It parses the code and never runs it. Its
findings are **Codeanalyse (SAST)** findings with the tool name `cppcheck`.
## Vendor Code Exclusion
Firmware projects carry their silicon vendor's SDK (HAL, CMSIS, board support)
and third-party middleware next to their own code. Findings in that code are not
yours to fix, so it is left out of the code findings (SAST, patterns, secrets,
lint). What counts as vendor code:
- directories named `CMSIS`, `Third_Party`, `vendor` (and similar), or ending in
`_HAL_Driver` / `_StdPeriph_Driver`;
- ST's generated layouts (`Drivers/` next to `Core/`, `Middlewares/`);
- a vendored library wherever it sits, recognised by the files it always ships
(Mbed TLS, lwIP, the FreeRTOS kernel, wolfSSL, FatFs).
Your own `src/drivers/` is not excluded. The scan run lists the excluded
directories under **Nicht ausgeführt** as **Herstellercode (HAL, CMSIS,
Drittanbieter)**. The excluded code stays in the SBOM and is checked for known
vulnerabilities.
## Syft -- SBOM Generation
@@ -24,12 +48,20 @@ Semgrep produces SAST-type findings with file paths, line numbers, and rule desc
Syft output feeds into both the SBOM feature and the vulnerability scanning pipeline.
## Embedded Library Versions
Libraries copied into a firmware tree have no manifest Syft could read.
Prüfwerk recognises **FreeRTOS**, **FreeRTOS+TCP**, **lwIP**, **Mbed TLS**,
**wolfSSL** and **FatFs** and reads each version from the library's own header
(for example `task.h`, `FreeRTOS_IP.h`, lwIP's `init.h`, `ff.h`). They are added
to the SBOM with the package source `embedded` and matched against NVD by CPE.
## OSV.dev + NVD -- Vulnerability Matching
Prüfwerk matches every SBOM component directly against two public vulnerability sources (no separate scanner binary):
- [OSV.dev](https://osv.dev/) -- batch queried by package URL (purl) for ecosystem advisories (npm, PyPI, crates.io, Go, Maven, ...)
- [NVD](https://nvd.nist.gov/) -- queried per CVE for the CVSS v3.1 base score, and by CPE for CODESYS runtime versions found in PLC projects
- [NVD](https://nvd.nist.gov/) -- queried per CVE for the CVSS v3.1 base score, and by CPE for components outside a package ecosystem: the CODESYS runtime found in PLC projects and the embedded libraries above. All CVEs of the product are fetched and their affected version ranges compared with the version in use.
Matches are stored as CVE alerts with CVSS scores and re-checked hourly, so newly published CVEs against an unchanged dependency still raise a notification.
@@ -52,18 +84,27 @@ A scanner focused on data protection compliance, detecting:
- Unencrypted PII storage
- Cross-border data transfer issues
## Custom Secrets Scanner
## gitleaks -- Secrets
Detects hardcoded secrets and credentials in source code:
[gitleaks](https://github.com/gitleaks/gitleaks) finds hardcoded secrets and
credentials: API keys, tokens, private keys, passwords. On a git checkout it
runs `gitleaks detect`, which also looks through the repository's history; on an
uploaded archive, which has no history, it scans the files with `gitleaks dir`.
Its findings have the type **Zugangsdaten im Code** (Secrets); the dashboard
shows the secret shortened.
- API keys and tokens
- Database connection strings with embedded passwords
- Private keys and certificates
- Cloud provider credentials (AWS, GCP, Azure)
## PLC Control-Logic Analyser
Prüfwerk's own analyser for IEC 61131-3 programs. It parses Structured Text
(`.st`, `.scl`, `.exp`) and PLCopen XML projects, including graphical FBD/LD,
and runs CWE-mapped security rules over them, for example hardcoded credentials,
safety interlock or watchdog bypass, unchecked array indexing and insecure
protocol ports. Its findings have the type **SPS-Steuerungslogik**. See
[SPS / PLC (CODESYS)](/guide/plc).
## LLM-Powered Code Review
Beyond rule-based scanning, Prüfwerk uses an LLM to perform architectural and security code review. The AI reviews code patterns that are too nuanced for static rules, such as:
For pull-request reviews, Prüfwerk uses an LLM to review the changed code in several passes. A regular scan does not run it, and PR reviews need webhooks, which are not available in this release (see [Webhooks & PR Reviews](/guide/webhooks)). The review looks for issues too nuanced for static rules, such as:
- Business logic flaws
- Race conditions
@@ -74,24 +115,20 @@ Code review findings are marked with the **Code Review** type.
## LLM-Powered Triage
Every finding -- regardless of which scanner produced it -- goes through AI triage. Here is how it works:
Every new finding a scan stores -- regardless of which scanner produced it -- goes through AI triage. Here is how it works:
1. **Context gathering** -- the triage engine collects the finding details, the code snippet, and information from the code knowledge graph (what calls this code, what it calls, how it connects to entry points)
1. **Context gathering** -- the triage engine collects the finding details, about 50 lines of surrounding code, and information from the code knowledge graph (what calls this code, what it calls, how it connects to entry points)
2. **Severity assessment** -- the LLM evaluates the finding considering:
- The vulnerability type and its typical impact
- The specific code context (is this in a test file? behind authentication? in dead code?)
- The blast radius -- how many entry points and call chains are affected, based on the code graph
3. **Confidence scoring** -- the LLM assigns a confidence score (0.0 to 1.0) indicating how certain it is about the assessment
3. **Confidence scoring** -- the LLM assigns a confidence from 0 to 10. It is lowered for findings in test, example, generated or vendored files. A finding the LLM dismisses, or does not confirm with a confidence of at least 3, is set to **Zu prüfen** (needs review); it is never deleted
4. **Rationale generation** -- the LLM writes a human-readable explanation of why it assigned the severity and confidence it did
5. **Remediation guidance** -- the LLM generates step-by-step fix instructions and, where possible, a suggested code fix
### Learning from Feedback
When you mark findings as false positives or provide developer feedback, this information is used to improve future triage accuracy. Over time, the AI becomes better at understanding which findings are actionable in your specific codebase and which are noise.
5. **Remediation guidance** -- where it can, the LLM writes a short remediation
::: tip
The AI triage is a starting point, not a final verdict. Always review the rationale and code evidence before acting on a finding. See [Understanding Findings](/guide/findings#human-in-the-loop) for more on the human-in-the-loop workflow.