Demonstration plan, phase D3 (agent side). Two things blocked a self-serve demo: a fresh trial tenant landed on an empty targets page, and staging tried to run DAST, pentest, the ICS probe and the soft-PLC runtime that are not deployed there, so those stages surfaced as tool errors.
## Seeding
| Request | Meaning |
|---|---|
| `GET /api/v1/targets/demo-seed` | what would be created: `key`, display `name`, `kind`, `description`, `source_only` |
| `POST /api/v1/targets/demo-seed` | body `{"names":[…],"rescan":false}`, empty `names` seeds all; `202` with one row per target, `status` = `queued` \| `exists` \| `failed` |
| `POST /api/v1/platform/tenants/demo/reset` | now takes `{"seed": true}` and reseeds with a service token, for the nightly sales-demo reset |
Seeding runs through a new shared target lifecycle (`compliance-agent/src/targets.rs`: create → store upload → attach → detect), which the onboarding handlers now call as well — so a seeded target is an ordinary target with the same records and the same `target.added` usage events, and there is no HTTP self-call. It is idempotent by display name: the seeder owns the `Demo · ` prefix, so a second call finds its own targets. `scan_id` is always `null` in the response because the scan run is created inside the background pipeline.
## Source-only set
The manifest is now source-only: `plc-pump-station`, `plc-conveyor-line`, `git-cra-vuln-demo`, `firmware-zephyr-example`. The Juice Shop target needed a running instance for DAST and pentest and is removed, along with `DEMO_WEB_URL`. Everything ships inside the agent binary (manifest plus the PLC upload fixtures), so a deployed agent seeds without the repo.
## `PW_FEATURES=source_only`
A static-analysis-only deployment: DAST, the ICS probe and the ephemeral PLC runtime record a `skipped_stages` entry on the scan run (`{stage, status:"skipped", reason:"feature disabled"}`) instead of failing; starting a DAST run or a pentest session answers `409`; the flag list is published on the public `/api/v1/platform/version` handshake so the dashboard reads the set the agent enforces rather than its own copy of the env. Unknown flags are kept and reported, so a dashboard-only flag needs no agent release.
Docs and the ops script are updated: `scripts/seed-demo-targets.sh --api` hands the job to the agent, the client-side path stays for `--reset` and for agents older than the checkout.
Verified locally: `cargo fmt --all --check`, `cargo clippy -p compliance-agent -- -D warnings`, `cargo clippy -p compliance-core -- -D warnings`, `cargo test -p compliance-core -p compliance-agent -p werkbank-exec -p control-map --lib` (414 tests). `compliance-agent/tests/demo_seed.rs` needs Mongo and runs outside CI like the other integration tests.
Pairs with the dashboard's "Add demo targets" button and with orca-platform setting `PW_FEATURES=source_only` on the staging agent.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Co-authored-by: Sharang Parnerkar <30073382+mighty840@users.noreply.github.com>
Reviewed-on: #251
110 lines
3.9 KiB
Bash
110 lines
3.9 KiB
Bash
# MongoDB
|
|
MONGODB_URI=mongodb://root:example@localhost:27017/compliance_scanner?authSource=admin
|
|
MONGODB_DATABASE=compliance_scanner
|
|
|
|
# LiteLLM
|
|
LITELLM_URL=http://localhost:4000
|
|
LITELLM_API_KEY=
|
|
LITELLM_MODEL=gpt-4o
|
|
|
|
# GitHub
|
|
GITHUB_TOKEN=
|
|
GITHUB_WEBHOOK_SECRET=
|
|
|
|
# GitLab
|
|
GITLAB_URL=https://gitlab.com
|
|
GITLAB_TOKEN=
|
|
GITLAB_WEBHOOK_SECRET=
|
|
|
|
# Jira
|
|
JIRA_URL=https://your-org.atlassian.net
|
|
JIRA_EMAIL=
|
|
JIRA_API_TOKEN=
|
|
JIRA_PROJECT_KEY=
|
|
|
|
# SearXNG
|
|
SEARXNG_URL=http://localhost:8888
|
|
|
|
# NVD
|
|
NVD_API_KEY=
|
|
|
|
# Agent
|
|
AGENT_PORT=3001
|
|
SCAN_SCHEDULE=0 0 */6 * * *
|
|
CVE_MONITOR_SCHEDULE=0 0 0 * * *
|
|
GIT_CLONE_BASE_PATH=/tmp/compliance-scanner/repos
|
|
|
|
# Dynamic PLC testing — ephemeral soft-PLC provisioning (#183). Off unless
|
|
# enabled; requires the agent container to have Docker access (socket mount).
|
|
# When on, a PLC/SPS target with control logic but no reachable device gets its
|
|
# logic instantiated on a throwaway OpenPLC, probed, then torn down.
|
|
PLC_RUNTIME_ENABLED=0
|
|
PLC_RUNTIME_IMAGE=repo.breakpilot.com/pruefwerk/openplc:latest
|
|
PLC_RUNTIME_NETWORK=certifai
|
|
PLC_RUNTIME_MEMORY=512m
|
|
PLC_RUNTIME_CPUS=0.5
|
|
PLC_RUNTIME_MAX_LIFETIME_SECS=180
|
|
PLC_RUNTIME_OPENPLC_USER=openplc
|
|
PLC_RUNTIME_OPENPLC_PASSWORD=openplc
|
|
|
|
# Werkbank runner API (/api/v1/werkbank/jobs/*, /api/v1/werkbank/artifacts/*).
|
|
# Mounted when this static token is set OR a tenant registry is configured
|
|
# (runners then present portal-issued `bp_…` API keys with scope
|
|
# werkbank:runner, verified via the registry). Unset + no registry = not mounted.
|
|
WERKBANK_RUNNER_TOKEN=
|
|
|
|
# Breakpilot Platform (PRODUCT_INTEGRATION_SPEC 2.0)
|
|
# Catalog key this deployment serves; used for entitlement checks, usage
|
|
# events and the platform handshake.
|
|
PRODUCT_KEY=pruefwerk
|
|
# Tenant registry: entitlement authority (POST /v1/internal/entitlements/check,
|
|
# cached ≤60 s, fail-closed), tenant list for the scheduler, API-key verify.
|
|
# Unset = claims-only mode (dev).
|
|
TENANT_REGISTRY_URL=
|
|
# client_credentials for the registry (Keycloak client `pruefwerk-svc-<env>`).
|
|
TENANT_REGISTRY_CLIENT_ID=
|
|
TENANT_REGISTRY_CLIENT_SECRET=
|
|
# JWT audience that user/service tokens must carry (scope `pruefwerk-audience`).
|
|
# Default `pruefwerk`; set to an empty string to disable audience validation (dev).
|
|
KEYCLOAK_AUDIENCE=pruefwerk
|
|
# Browser origins allowed by CORS (csv). Unset = permissive (dev only).
|
|
CORS_ALLOWED_ORIGINS=https://app-stage.breakpilot.com,https://pruefwerk-stage.breakpilot.com
|
|
# Keycloak client ids (azp) allowed on /api/v1/platform/* with a service token.
|
|
# Default: tenant-registry-svc-stage,tenant-registry-svc-prod,portal-svc-stage,portal-svc-prod
|
|
PLATFORM_ALLOWED_CLIENTS=
|
|
|
|
# Dashboard
|
|
DASHBOARD_PORT=8080
|
|
AGENT_API_URL=http://localhost:3001
|
|
|
|
# MCP Server
|
|
MCP_ENDPOINT_URL=http://localhost:8090
|
|
|
|
# Keycloak (required for authentication)
|
|
KEYCLOAK_URL=http://localhost:8080
|
|
KEYCLOAK_REALM=compliance
|
|
KEYCLOAK_CLIENT_ID=compliance-dashboard
|
|
REDIRECT_URI=http://localhost:8080/auth/callback
|
|
APP_URL=http://localhost:8080
|
|
|
|
# Control mapping (OSCAL catalog from breakpilot-compliance)
|
|
# Unset BREAKPILOT_BASE_URL to run snapshot-only: the image ships a CRA catalog
|
|
# snapshot, so findings still carry control_refs without the backend. The
|
|
# master-controls catalog is DB-derived and not shipped — turn the semantic pass
|
|
# off when running snapshot-only.
|
|
# BREAKPILOT_BASE_URL=https://api-dev.breakpilot.ai
|
|
# BREAKPILOT_TOKEN=
|
|
BREAKPILOT_SNAPSHOT_DIR=/data/compliance-scanner/oscal
|
|
# BREAKPILOT_SEMANTIC_MAPPING=false
|
|
# BREAKPILOT_GROUNDED_CHECKS=true
|
|
|
|
# Deployment feature flags (comma list). `source_only` = static analysis only:
|
|
# the scan pipeline skips DAST, pentest, the ICS probe and the ephemeral PLC
|
|
# runtime (recorded as skipped stages, not failures), and the dashboard hides
|
|
# those actions. Staging runs with it until that infrastructure is deployed.
|
|
# PW_FEATURES=source_only
|
|
|
|
# OpenTelemetry (optional - omit to disable)
|
|
# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
|
|
# OTEL_SERVICE_NAME=compliance-agent
|