Repository navigation
fix: repo audit: web deny prefix, broker/primary follow, kube recording evasion, revoked proxy, bot facts - #292
Merged
Conversation
…tory
A deny on path_prefixes ["/admin/"] matched only the path /admin/ itself:
stripping "/admin/" from /admin/users leaves "users", which doesn't start
with a slash, so the request was allowed. valid_web_path accepts the
trailing slash, so the rule looked correct and silently failed open. Allow
rules had the mirror problem ("/api/" refused /api/x).
Compare whole segments against the prefix with its trailing slash removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SEiXYa75baYfYaGJtH6xci
may_follow treated the bootstrap's parent as its domain. For a two-label bootstrap (example.com, kafka.corp) the parent is the top-level domain, so a Kafka broker list or MongoDB primary naming evil.com or attacker.corp was followed, with the credential. Require the parent to still be a domain; names under the bootstrap host itself stay allowed. Resources that need more list them in hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEiXYa75baYfYaGJtH6xci
…ecording Two ways a client could keep an exec's stdout off the recording while the API server still served it: - parse_headers read at most 256 headers and dropped the rest, so a streamtype: stdout after 256 junk headers was never seen. Refuse a block with more headers than that instead. - Past 1024 streams an exec ignored new ones, assuming the real ones came first; the client picks the order, so 1024 junk streams then stdout went unrecorded. An exec past the cap now ends (port-forward is unchanged). A decoder error ends the stream before the bytes are forwarded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEiXYa75baYfYaGJtH6xci
The WebSocket protocol filter dropped only base64.channel.k8s.io, so v4.base64.channel.k8s.io reached kubelet, which then sends output as text frames the recorder doesn't read. Drop every base64 variant, and don't count one as a readable channel protocol. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEiXYa75baYfYaGJtH6xci
…doffs #263 made API calls check revocation (resolve_checked) but RedeemWebHandoff and the console's proxy_only gate still checked only the certificate. A revoked proxy could keep relaying the console and redeeming handoffs into web-app sessions until its certificate expired. Check the revoked set in both, failing closed when it can't be read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEiXYa75baYfYaGJtH6xci
ci_facts took every provider claim plus up to 12 rule claims, then added provider, iss and sub. A GitHub job carries 13 provider claims, so a rule that pins repository_id (as the bots guide recommends) with an environment, or repository_id and repository_owner_id, produced 17 facts; the CA refuses more than 16, and every login of that bot failed. Take the rule's claims first, then the provider's while room is left. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SEiXYa75baYfYaGJtH6xci
jfcmartins
marked this pull request as ready for review
November 9, 2026 10:07
5 of 7 tasks
jfcmartins
added a commit
that referenced
this pull request
Nov 9, 2026
…sqlite3-sys) (#293) Main's rust workflow has failed since #292: proxy_revocation.rs was not rustfmt-clean, and a new advisory for libsqlite3-sys fails cargo audit. The crate is in Cargo.lock only, as sqlx's optional SQLite driver, and is never compiled. sqlx-sqlite 0.9.0 requires libsqlite3-sys below 0.38 and the fix is 0.39, so there is nothing to bump. Recorded in deny.toml, .cargo/audit.toml and ADR-0012.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
This PR fixes five issues found in a scheduled review of the repository. I checked the open PRs first (#290, #289, #288, #276); none of them already fixes any of these. Each fix is its own commit.
limen-policy/src/lib.rs,web_path_matches)path_prefixes: ["/admin/"]matched only/admin/itself./admin/usersand/admin/secret/xwere allowed.valid_web_pathaccepts the trailing slash, so the rule looked correct."/api/"refused/api/x.docs/policy.md."/api/"now also admits/apiitself. That is a small widening, but it is the same directory.limen-policy/src/delegation.rs,may_follow)example.com,kafka.corp), "same domain" meant.comor.corp.evil.comorattacker.corpwas followed, and the credential went with it.b-2.example.com) stay allowed. Anything else needshosts; the guides now say so.limen-kube,limen-worker/src/kube/serve.rs)parse_headerssilently stopped after 256 SPDY headers, so astreamtype: stdoutplaced after 256 junk headers was never seen. Such a block is now refused.base64.channel.k8s.io.v4.base64.channel.k8s.iostill went through, and kubelet then answers in text frames the recorder doesn't read. Every base64 variant is now dropped.pump.rs), so all three now fail closed.console/mod.rsproxy_only,console/web_auth.rsredeem)resolve_checkedfor API calls, but these two entry points checked only the certificate.services/bot_login.rs,ci_facts)provider,issandsubbring that to 16, which is exactly the CA'sMAX_CI_FACTS.repository_id(asdocs/guides/bots.mdrecommends), combined with anenvironmentor withrepository_owner_id, produced 17 facts. The CA refused, and every login of that bot failed.repository_idin the example bots, which makes this more likely to show up.Related: none (no phase work).
How it was verified
cargo fmt --all --checkandcargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.cargo test -p limen-policy: 102-p limen-kube: 27-p limen-worker --lib: 357-p limen-control-plane --lib: 138-p limen-proxy: 36LIMEN_TEST_DATABASE_URL):handoff,bot_login,verify_gaps,control_plane,component_namesconsole,phase1,phase35,phase8,proxy_revocationweb_path_prefixes_with_a_trailing_slash_cover_the_directorya_worker_follows_only_hosts_near_the_one_it_was_givenrefuses_more_headers_than_it_readsandspdy_exec_refuses_a_flood_of_streams. Both failed with the fix reverted.base64_channel_protocols_are_not_forwarded, plus a row inonly_binary_channel_protocols_are_readablea_rule_naming_provider_ids_still_fits_a_certificatea_revoked_proxy_no_longer_serves_the_console. It failed with the console fix reverted.protoccame from the system package (3.21), not mise's pinned 36.2, because mise isn't installed in this environment.Not verified
phase8ran against the testkit's stand-in API, not a real cluster. That kubelet acceptsv4.base64.channel.k8s.ioand keeps waiting past junk SPDY streams comes from reading upstream, not from a run.unverified.RedeemWebHandoffafter revocation: no test covers it. The console gate has one.demos/demo-*.sh, the KMS/S3 integration suites,cargo deny/cargo audit(no dependency changes), and gitleaks (not installed here).Review guide
limen-policy/src/lib.rsinto a function and editsdocs/policy.md. Whichever lands second should keepweb_path_matches.kafka.corpno longer auto-follows tokafka-2.corp. Such resources needhosts.Checklist
cargo fmtandcargo clippy ... -D warningscleandocs/policy.md,docs/guides/mongodb.md,docs/guides/messaging.md)Compatibility and rollback
Policy meaning changes slightly in two places:
path_prefixesentry ending in/now covers its directory.hoststo follow to sibling names.Nothing changes in the wire format or schema. Revert the individual commit to roll one back.
Findings not fixed here (for the owner)
Confirmed by reading, not fixed:
limen-verify/src/pack.rs:667).verify_packchecks the signer's component certificate against now, and that certificate lives 24h and renews at half-life. Fix: useverify_at(generated_at), asbucket.rsalready does.openforever (reviews/mod.rs). Only the item row is locked, so each transaction still sees the other item as undecided. Lock the review row too.limen://label/env/doesn't parse). Fix: validate inissue_component.limen-proxy/src/peer.rs). They keep the first client certificate and ignore address changes, so peering breaks once that certificate expires.DurationStrhas no upper bound, and(now + ttl)inlimen-proxy/src/sessions.rspanics past year 9999.deploy/kubernetes/limen/proxy.yamllacks the chart's ADR-0045startupProbeandmaxUnavailable: 0.examples/ci/policy-check.ymlexample has three problems:scripts/policy-pr-comment.sh, which won't exist in a user's policy repository.actions/checkout@v4.scripts/policy-pr-comment.shedits the first comment carrying the marker, whoever wrote it.infra.ymlandworkflows.ymldon't run onmise.tomlchanges, even thoughmise.tomlpins their tools.Need verification:
localhost.example.co.uk) are still "nearby" each other.Both #288 and #290 add an ADR numbered 0046. One of them needs renumbering.
Generated by Claude Code