3efa2be1e14112f4e2aecbc12bf6804066bf9717
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3efa2be1e1 |
feat(ci): nightly scan regression against the built image (#188)
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 6m31s
The nightly workflow only ran the stale e2e suite (#298). It lacked the firmwerk git auth, so it could not even compile. - tests/nightly.rs: seeds the demo-target corpus on a running agent (NIGHTLY_AGENT_URL), waits for every scan, and compares the results with: - the manifest's `expect` block, now `Expect::violations`, reusable; - blessed snapshots in fixtures/nightly/baselines/: exact for scan status, skipped stages, SBOM and deterministic findings; at-least for CVEs and semgrep registry rules. LLM code review is ignored. Control refs, which only the LLM control judge stamps, are reported as advisory (`Expect::llm_violations`). NIGHTLY_BLESS=1 re-blesses. The report goes to target/nightly/. - nightly.yml: mongo + the :latest agent image as services (dev mode, source_only, optional LLM), the harness in rust:1.94, the report as an artifact, and one tracking issue while the nightly stays red (NIGHTLY_ALERT_TOKEN). workflow_dispatch has a "bless" input. Bugs the first runs found, fixed here: - Scan phases control_triage / semantic_control_mapping / grounded_control_checks / plc_provision were missing from ScanPhase. Runs failed to deserialize and silently dropped out of GET /scan-runs (and the dashboard's scan list). update_phase now takes ScanPhase, so this cannot drift again. - The PLC pump-station demo failed every scan since #256: its optional live endpoint fell back to modbus://plc-sim:502, and live URLs only accepted http(s). NetGuard::check_live_url now also allows modbus:// and opc.tcp://, with the same host rules; DAST only takes http(s) live URLs. Optional env-backed demo artifacts are skipped when their env var is unset, as the shell seeder already did. - SBOM clean-up: - The pipeline's stale-entry delete compared the target id as an ObjectId against the stored hex string, so it never deleted anything, and removed dependencies stayed in the SBOM forever. - The firmware step deleted every entry, so a rescan with no new commits wiped the Syft entries. Each step now replaces only its own package managers. - Manifest: `control_refs_any` was silently ignored (not in Expect). Zephyr's detected build system is "zephyr (west)". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p |
||
|
|
bc4553d576 | chore: replace every remaining "tramiton" with Firmwerk (#300) | ||
|
|
d9850bef90 |
feat(demo): seed curated targets from the agent, source-only mode (#251)
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
|
||
|
|
8dcdad9fe7 | feat(fixtures): curated demo targets + seed script + golden PLC baselines (#187) (#232) |