Repository navigation
Security audits: AI scans for deploys and a scan-before-public gate - #886
Brooooooklyn wants to merge 53 commits into
Conversation
…ler stub Adds the securityAudits capability (deployment schema 7, missing reads as off) and the SecurityScanScheduler Durable Object stub with its migration tag. Binds the scheduler only for runtimes that ship it, and blocks a CLI rollback to a runtime from before this release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ge source Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the hard-coded security model list with prices, badges, engines and reserves, plus the installation policy type, defaults, limit ranges and error codes. Writes use a strict parser; the stored row is read with a lenient reader so a retired or newly added model does not turn audits off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds the 11 security audit tables (settings, scans, findings, events, public requests, bypasses, spend, rejections, notifications) in 0065. Mode, engine and max-cap lists are checked against the M2 policy; the month check ignores the session time zone; bypasses only from D50 states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds /operator/v1/security/{policy,status} with revision checks under a lock,
a plan preview, a fresh-probe check to turn on, and Off canceling queued scans.
The preview says where projects go when a model is blocked under a third-party
default. Operator audit records known ids only. Design doc lists the M6/M8/M9 follow-ups.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Runner reads task.json and the input tar on stdin, runs hunt and verify sessions through the model proxy, and writes findings.json then status.json. Pax xattrs are skipped as bytes, SIGTERM during the tar read writes timed_out, paths with control characters are refused, and any non-stop failure retries once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tainer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tlement probe Controller Worker with one Durable Object per scan attempt or probe, egress lock, and result files read as the scanner user without following symlinks. Per-installation provisioning (controller, container app, owned gate) and probe checks 1-6; turning the policy on checks the request first, then re-runs the probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scan model proxy checks the fence, model, call and token caps, holds the worst case on both spend rows, and settles to tokens x list price. It refuses provider-run tools, filters anthropic-beta, stops on tokens below the provider minimum, and keeps the worst case for unreadable answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each live deploy writes its scan row in the go-live transaction, then copies inline Worker modules, queues the row and pokes the scheduler after `done`. Compensation finishes the row with the modules when a deploy is still live. Staged input stays while a waiting scan points at it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scheduler claims queued scans round-robin by owner, reserves budget, starts them through the controller and retries a failed start once. Hourly jobs reap, re-poke, skip backlog, sweep, keep retention and probe. Ends, requeues and cancels give the reserve back in the same transaction. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
T2/T3 input builder: source maps, filters, third-party, redaction, phrase check, memory and backlog, streamed to the runner as a tar. Changed files the input cannot hold go to the backlog, never counted as seen. Modules are read one at a time and the tar is encoded as it is read. Builder and runner share one set of input limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
T1 reads the head tarball (equal 8 MiB R2 parts, one key per call) after the same GitHub authority check a managed build runs. Only changed unread files cap a scan; unchanged ones are dropped, so big repos stay complete. The bundle is parsed once, and skipped tar entries count toward the limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
S2/S3 gain --local-gateway: the engines run in local Docker behind a model-proxy stand-in that holds the token and calls the gateway REST route. S10 checks what the gateway keeps (no bodies, no cache). Third-party calls hit the credits 402. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Take the runner result in one transaction: findings, events, reopen and stale-scan rules, not-seen hint, fix check, ledger and the no-changes path. The cap limits new keys only, server leads have their own key space, and a diff scan keeps the base ledger. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…an caps; fix controller PATH A bad verify session now leaves the candidate a lead and the scan incomplete instead of dropping every finding. Engine B repairs harmless report slips and takes JSON sent as text. The controller PATH gains /usr/sbin:/sbin so useradd works. Default token caps go to 1.2M in and 120k out after spikes S4/S8. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… scanner images Engine A runs the Claude Agent SDK with three read tools; Engine C runs the Codex SDK with only the void-scan MCP server. Both ask the model proxy why a session ended without a report. The SDKs live in two images with exact pins, lockfiles and a drift test. The proxy takes the gateway model name and never passes an upstream 401 to an engine. Spike lessons: is_error with a 402 is credits, Codex retry caps are 0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
After the runner and cap changes deepseek-v4.1-flash-1017 meets every S4 bar (10/10 bugs, 8/8 valid runs, no false crit/high) and glm-5.3 does not (4/10 bugs, 4/8 valid runs). The default model is unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
S4 rerun on VoidZero: deepseek 10/10 bugs, 8/8 valid, median $0.18, p95 15.7 min (pass); glm-5.3 4/10, 4/8 valid (fail). glm-5.3 stays selectable. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add the per-project security status, findings, comment, resolve, reopen, scans, model and page-link routes, with reader and CI views that hide detail. Scans and model writes answer 501 while the capability is off; the page link uses `?t=` for M19 to redeem. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ate and bypass Adds the outbox, recipients, copy and senders, queued with the change and sent by the scheduler alarm. Types email finding severity, pins the raise-to-critical rule with a test, and covers the hourly poke. Tests that expected the old default model now name the new one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e catch-up) Public requests are judged at ask, ingest, resolve, cutover, rollback, bypass and hourly. Review fixes: one exposure scan per deployment, the hourly backstop rotates and shares the run's routing budget, gate-off cancel writes its event and email, and held copy names the cause. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds operator routes for the security budget, findings, scans, public requests and bypass. The budget write needs the capability, the bypass preview shares the real refusal rules, and the month totals use a UTC month start and stay installation-wide. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds the Security pages, banner and nav badge, plus project Security and bypass controls. Mark all as seen posts the newest bypass time the page showed, clamped to the real newest row. The admin bypass route stays open with the capability off, like the operator route. Adds a test per write route, each asserting its audit row. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A signed CLI link opens a path-scoped cookie page at /security/projects/:slug. Urgent findings load apart from the capped open list, headings use real totals, and a cut list points to the CLI. The route uses the same gate as the project API (member, owner not suspended). Tests cover suspended and deleted accounts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds status, list, show, comment, resolve, reopen, scans, model, budget and open. The status route now returns the open public request. Tests cover every command path, the public request view by role, and the capability-off read. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tatus Add 'void project zero-trust bypass' with a reason and a confirm prompt. Show the held public request and its urgent finding ids in status. Help, the no-args hint and docs/reference/cli.md are updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Managed deploys print the scan state and open urgent findings after the deploy is live. One read with a 5 s limit; any error, 404 or timeout prints nothing and keeps the exit code. A deploy with unpublished routing still gets the notice. Rows sort critical first, then oldest. The caller-role "Fixed?" line is a documented gap in the plan. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ninstall Add `void platform security ...`; `budget` shows caps with no flags and sets them with any cap flag (spec 13.4). Add --security-audits to install, upgrade and repair, and remove the scanner on uninstall. Uninstall treats a refused or missing container application list as nothing to remove when no controller exists. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add the security audits admin guide and link it from the platform docs. Update the project, deploy and platform Zero Trust CLI references and the skill. Name the platform administrator bypass command next to the project one. Record the M24 notes in the design doc. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d run Copy the pinned engine images into the operator registry and run each engine in its own class. A failed probe step no longer changes what is deployed; concurrent probes converge. Copy is bounded by the probe deadline; hosts with all models blocked get no copy. Uninstall image cleanup fails loudly and can be retried; recorded run is opt-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add void project security scan, operator backfill and policy sweeps run hourly. Leave out projects with no stored code so they never block a batch. A sweep replaced by a deploy or canceled by policy Off is due again. Standard hunts keep the strongest record per fingerprint and fit report limits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d webhook Opt-in @cf fallback after a refused, bad-output or timed-out third-party scan; a rescan, sweep or gate fallback keeps its full scan and gate rule. Streak emails once per streak, weekly digest, and a signed ids-only webhook that posts every event kind and holds its rows after a failed POST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plans can set a monthly scan cap (amount, none, or inherit) from the operator CLI and the admin Plans page; scans, model calls, the budget view and cap emails all use it. Budget writers read the plan cap in their locked select, and messages name the plan when its cap is the limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neutral check run (counts and landing link) on the build's commit at ingest. One counts-only PR comment per project; a failed or partial read skips the PR. Only our App's comment is edited; platform failure reasons stay private. Re-run queues a project rescan for a sender with settings on the project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dget and bypass Resolve, comment, model, budget and bypass forms on the API page and the dashboard. The page sends Referrer-Policy same-origin so its own posts keep their Origin. A bypass whose Access update fails says it is recorded (502); the picker keeps the saved model. Form text uses small shared parsers from @void/platform/security-policy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ment Engine B verify can send requests to a per-attempt copy with empty stores and fake secrets. Only an app request the copy answered is runtime proof; setup routes never are. No copy when the bundle, kept vars or schema hold a stored secret value. The copy is deleted from its own bindings, or at once if its attempt already ended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stored secret values in the deployed output become server findings, one per secret and side, kept across hashed bundle names; built code and big assets are searched too. Opt-in client asset pass reads client sources from maps within the input budget. SARIF export for project and operator findings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y S9/S11 - Codex "cyber policy: <msg>" text now ends refused (cyber_policy). - The model proxy passes a provider cyber_policy / trusted_access_for_cyber 400 on with its code and records last failure `refused`. - Engine A reads the refusal category from the assistant message. - Engine A path hook checks every Glob pattern (.., ~, braces, relative under the search path) and refuses ~ paths for all tools. - A session that read no file cannot clear code: an empty or all-rejected report from it is bad_output (nothing_read), so a silent decline (S9 B5) never passes the public gate. - S9 now 21/21 (B5 counted as unsignalled), S11 150/150. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Engine A path hook refuses a Glob/Grep path with whitespace at either end (Claude Code trims it, so " /" searched /) and any non-string path. - stats.reads counts only reads that returned code under /scan/input: Engine B via FsTools, Engine C via the void-scan server's <out>.reads, Engine A via a PostToolUse hook on Read. Reading the memory index, listing or searching and then declining no longer clears the gate. - Engine A: a refused turn with no report ends refused whatever the result says; CLAUDE_CODE_REFUSAL_FALLBACK_CATCH_ALL=0 is pinned. - classifyCodexRun matches the policy code on letters and digits only. - The proxy finds a policy code in any code/type field at any depth, keeps 8000 chars, and drops the dead 402 refusal mapping (credits wins). - S9 24/24 (new B6, A6, C9), S11 160/160. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add void project security check: upload git-tracked files, scan, print a separate 30-day result that never touches project findings. Result is written before the row ends; a lost upload reply or start recovers. Local checks stay out of fallback, retention, streaks, sweeps and rescans. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keys are saved encrypted after a 1-token test call; the proxy adds them server-side. A probe that ran while a key changed keeps the value the key write stored. The proxy reads the key before the policy; a malformed entry fails the call. Operator CLI: void platform security models --provider <host> --key-stdin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Admins set a project's rule from the CLI, operator API or admin UI. never skips deploy scans, rescans, sweeps and local checks; the scan before a project goes public still runs. always scans a protected project under public. Preview counts follow the rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owners and admins can set a finding's severity, with a comment, or clear it to go back to the scan value. Later scans keep the human value. The gate, counts, digest, checks and webhooks use the shown severity. A stale-revision reply now names who made a severity edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan cap changes apply at once, including to running scans. GitHub checks cover connected builds with either executor; PR comments cap at five. Only owners and admins resolve, bypass, set model and budget. I6 names its tests; I2/I3 mark S1 as not recorded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/void/src/cli/deploy-managed-events.ts
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://feat-security-audits-void-cloud.voidzero-docs.workers.dev (commit de390f6)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b698e8caa
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
CI forces colour, so each box border sits between escape codes and the flattened text kept them between words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ored key Ingest hashes the reported fingerprint with the project and sink, so a model that reused the hashed key from memory made a new finding and lost the old one's severity edit and resolve history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What this adds
Security audits for the self-hosted platform: each go-live deploy gets an AI security scan, and an admin can require a clean scan before a project goes public (Zero Trust turned off). Off by default (
securityAuditscapability). Design doc:platform/meta/design-docs/0095-security-audits.md.Phases
void project security …CLI, deploy notice, docs@cffallback, digest + webhooks, per-plan caps, GitHub check, page/dashboard forms, runtime checks on a throwaway copy, secret findings, SARIFvoid project security check(local tree), BYOK keys, per-project rule, severity edits, docsPublic gate rules
fixedneeds a rescan of a new deploy;false_positive/accepted_riskunlock at once.Spikes (live on Cloudflare, cleaned up)
Open before release
nulluntil the images are published to ghcr at release, so Engines A/C can't be picked yet.Checks
vp check: cleanvp test run: see CI🤖 Generated with Claude Code