Repository navigation
Commit 92dc64e
authored
feat(security): Spec 101 US3 TPA bundle refresh lifecycle and publication channel (#1720)
Spec 101 User Story 3 together with Spec 087 User Stories 1 and 2: the TPA bundle refresh lifecycle and the publication channel.
- Refresh lifecycle (internal/security/scanner/tpa_refresh.go). Each daily jittered cycle runs a file leg, then an optional fetch leg. Both feed the US1 Candidate pipeline, so the verifier is not forked. Concurrent triggers join one cycle, scheduling is one deadline held under the refresher's lock, and Runtime.Close joins the refresher.
- Opt-in signed fetch (tpa_fetch_enabled, default off; tpa_fetch_url, no default URL; env MCPPROXY_TPA_FETCH_ENABLED). It supports the GitHub Releases latest shape and a direct shape. Fetched pairs must be signed. The transport is https-only (http only to loopback), redirects are capped, egress is checked at dial time, bytes and time are bounded, ETag and backoff are honoured, and only the host is logged. Network outcomes are kept apart from rejections. A fetched bundle survives reloads and restarts.
- Activation self-check (tpa_selfcheck.go): the CI recall/FP gate over an embedded copy of the eval corpus. A failing candidate is refused as gate_failure and last-known-good keeps serving.
- Freshness: BundleInfo gains last_checked_at, last_activated_at, stale, refresh and reprotect, on REST (swagger regenerated), the CLI and the Web UI. Doctor warns on a stale database, on being stuck on last-known-good, and on a fetch that is enabled but cannot run. New: mcpproxy security bundle refresh and POST /api/v1/security/bundle/refresh.
- Re-protection after an activation. Held-evidence refresh, plus a cached-contract informational scan of approved toolsets pinned to the activated snapshot (no upstream connection, gated by auto_baseline_scan). RT-02 holds: nothing is approved, unquarantined, revoked or quarantined.
- Telemetry schema 16: five integer refresh and re-protection counters inside the closed anonymity contract.
- Specs: SC-007's fetch clause moves to Spec 087 as SC-009, and Spec 087 is marked implemented by Spec 101 US3. Tasks T300-T396 are ticked and roadmap tpa-db-refresh is done.
- Docs: tpa-bundle-signing, security-quarantine, tool-scanner, configuration, security-commands, telemetry, quickstart, CLAUDE.md.
No new dependencies. The fetch works today only with operator-signed bundles, because the publisher key set is empty and the corpus repository does not exist yet. Whichever of this PR and #1702 merges second must refresh bundled/selfcheck-corpus.json from specs/065-evaluation-foundation/datasets/detect_corpus_v1.json.
Related #9381 parent ba51774 commit 92dc64e
129 files changed
Lines changed: 19793 additions & 152 deletions
File tree
- cmd/mcpproxy
- docs
- cli
- features
- frontend
- src
- components/security
- utils
- tests/unit
- internal
- config
- httpapi
- oauth
- runtime
- security/scanner
- bundled
- testdata
- server
- storage
- telemetry
- oas
- specs
- 087-tpa-daily-refresh
- 101-tpa-db
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
| 241 | + | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| |||
1008 | 1008 | | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
| 1011 | + | |
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
| |||
1158 | 1158 | | |
1159 | 1159 | | |
1160 | 1160 | | |
1161 | | - | |
| 1161 | + | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
594 | 604 | | |
595 | 605 | | |
596 | 606 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
631 | 671 | | |
632 | 672 | | |
633 | 673 | | |
| |||
0 commit comments