-
Notifications
You must be signed in to change notification settings - Fork 0
test(ci): LAB-1151 negative proof 1 — policy edit, DO NOT MERGE #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,6 +88,7 @@ getrandom = { version = "0.2", optional = true, features = ["js"] } | |
|
|
||
| # Optional: proc-macro decorator | ||
| cachekit-macros = { version = "0.7.0", path = "../cachekit-macros", optional = true } | ||
| native-tls = "0.2.18" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WHAT: A new dependency 'native-tls' was added to the manifest without CVE/SCA evidence. WHY: New dependencies can introduce known vulnerabilities or supply-chain risk. HOW: Provide OSV/SCA audit output or advisory links in the PR description, pin the exact version, and ensure the lockfile is updated. Kody rule violation: Validate new/updated dependencies for CVEs and supply-chain risk Prompt for LLMTalk to Kody by mentioning @kody Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- applicable repository knowledge files ---'
find /tmp/coderabbit-repo-knowledge/cachekit-io-cachekit-rs-a2810410 -type f -name '*.md' -maxdepth 3 -print 2>/dev/null | sort
printf '%s\n' '--- manifest hunk and nearby dependencies ---'
cat -n crates/cachekit/Cargo.toml | sed -n '70,105p'
printf '%s\n' '--- WASM build references ---'
rg -n -C 3 'build-wasm|wasm32-unknown-unknown|native-tls|rustls' Makefile README.md .github crates 2>/dev/null | head -240
printf '%s\n' '--- target-specific manifest sections ---'
rg -n -C 5 'target\.' crates/cachekit/Cargo.tomlRepository: cachekit-io/cachekit-rs Length of output: 14499 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- repository conventions ---'
cat /tmp/coderabbit-repo-knowledge/cachekit-io-cachekit-rs-a2810410/conventions/repo-wide.md
printf '%s\n' '--- dependency and policy definitions ---'
rg -n -C 5 'native-tls|openssl-sys|rustls|deny|banned' deny.toml Cargo.toml Cargo.lock .github/workflows/security.yml
printf '%s\n' '--- package features and native-tls references ---'
cat -n crates/cachekit/Cargo.toml | sed -n '1,75p'
rg -n 'native_tls|native-tls|openssl' --glob '!target/**' --glob '!Cargo.lock' .
printf '%s\n' '--- lockfile native-tls package entries ---'
rg -n -A 35 -B 3 '^name = "(native-tls|openssl|openssl-sys)"$' Cargo.lockRepository: cachekit-io/cachekit-rs Length of output: 26042 🌐 Web query:
💡 Result: The native-tls crate (version 0.2.18) does not explicitly support the wasm32-unknown-unknown target [1]. By design, native-tls acts as a wrapper around platform-native TLS implementations [2][3]. Its Cargo.toml configuration uses conditional compilation to select the backend based on the target OS [4][5]: - It uses SChannel on Windows [4][5]. - It uses Secure Transport (security-framework) on Apple platforms [4][5]. - It defaults to OpenSSL on all other platforms (including Linux, etc.) [4][2][5]. Because the wasm32-unknown-unknown target is not Windows or Apple, the crate attempts to include OpenSSL as a dependency [4][5]. This typically causes build failures when targeting WebAssembly, as OpenSSL is not a native library available in the wasm32-unknown-unknown environment [1]. Consequently, native-tls is generally not suitable for use in wasm32-unknown-unknown projects unless specific workarounds or alternative TLS abstractions (like rustls, which is often used in WASM contexts) are employed [1][6]. Citations:
Remove the unconditional
🤖 Prompt for AI Agents |
||
|
|
||
| # Optional (file backend, unix only): libc for the O_NOFOLLOW/ELOOP constants | ||
| # (std has no portable spelling); rustix for safe flock/geteuid wrappers — | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -32,15 +32,7 @@ confidence-threshold = 0.8 | |||||
| [bans] | ||||||
| multiple-versions = "warn" | ||||||
| wildcards = "deny" | ||||||
| # This SDK is rustls-only: openssl/native-tls must never re-enter the graph. | ||||||
| # (async-memcached 0.6 once dragged them in via a toxiproxy_rust runtime dep — | ||||||
| # expert panel, LAB-429. toxiproxy is a fault-injection *test* proxy; banned | ||||||
| # outright so no future dependency smuggles it back as a runtime edge.) | ||||||
| deny = [ | ||||||
| { name = "openssl-sys" }, | ||||||
| { name = "native-tls" }, | ||||||
| { name = "toxiproxy_rust" }, | ||||||
| ] | ||||||
| deny = [] | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WHAT: The dependency ban list was emptied, removing the deny entries for openssl-sys, native-tls, and toxiproxy_rust. WHY: This SDK is rustls-only; removing these bans allows openssl/native-tls to re-enter the dependency graph, undermining the TLS-security posture, and permits the fault-injection test proxy toxiproxy_rust back in as a runtime edge. HOW: Restore the explicit deny entries for openssl-sys, native-tls, and toxiproxy_rust. Kody rule violation: Add TLS and JSON audit middleware Prompt for LLMTalk to Kody by mentioning @kody Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Restore the ban list before any merge.
Proposed policy fix-deny = []
+deny = ["openssl-sys", "native-tls", "toxiproxy_rust"]📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| [sources] | ||||||
| unknown-registry = "deny" | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| Closes LAB-1151. | ||
|
|
||
| `[gate-change-approved]` — this PR modifies `security.yml` itself, so its own tamper check fires; this marker is the sanctioned path, and its presence here is the live positive test of the warning path. Sign-off: ray owns the merge decision on this PR, which is the sign-off. | ||
|
|
||
| ## What | ||
|
|
||
| The required `supply-chain` check read both its policy (`deny.toml`) and its own definition (`security.yml`) from the PR head, so one commit could violate a ban and delete the ban — green rollup, merges. Deletion already fails closed (required context, `bypass_actors: []` on ruleset 17788230, proven by the frozen PRs after [#54](https://github.com/cachekit-io/cachekit-rs/pull/54)); this PR closes the modification half: | ||
|
|
||
| - **Gate tamper check** — final step of the `supply-chain` job. Diffs `deny.toml` + `security.yml` against `HEAD^1` (the base tip the merge commit was computed against — exact PR effect, no network fetch, no base-drift false positives; checkout gains `fetch-depth: 2`). Any change fails the required check unless the PR body contains the exact case-sensitive string documented in README §Gate tamper-evidence. | ||
| - **Shadow detection** — a PR could also ship a replacement check under the same `supply-chain` name in a different workflow file. Any *other* changed workflow file mentioning `supply-chain` trips the wire too. (The API-commit-status variant of the same shadow is closed in the ruleset: the `supply-chain` context is now pinned to `integration_id` 15368, the GitHub Actions app.) | ||
| - **Injection-safe marker matching** — the PR body enters the step via `env:` only and is matched by `grep -qF` as data; `set -o pipefail` makes a failing `git diff` fail the step rather than silently disarm it. | ||
|
|
||
| ## What this deliberately does not defend against | ||
|
|
||
| Documented in README §Gate tamper-evidence: a PR that edits the tamper step itself out in the same commit, a self-served marker, and a marker hidden in an HTML comment. All deliberate evasion, not the lazy path this defends against. Mechanical closure of the first needs an org-ruleset `workflows` rule (verified available on this plan) — escalated on LAB-1151 for ray's decision, deliberately not self-served. | ||
|
|
||
| ## Verification | ||
|
|
||
| - Step logic verified locally against synthetic merge commits (plumbing-built, same shape as `refs/pull/N/merge`): innocent PR passes, gate-file edit trips, shadow workflow trips, unrelated workflow deletion does not trip; marker matching is exact, case-sensitive, empty-body-safe. | ||
| - Expert panel (bug-hunter, security, craftsman, catchphrase) reviewed at high stakes; all surviving findings applied (pipefail fail-open, base-drift false positive, name-shadowing CRIT, marker-in-error-text copy-paste self-approval, case-insensitive `contains()`). Full adjudication on LAB-1151. | ||
| - Negative proofs #1 (policy edit) and #2 (job neutering) run as throwaway PRs against this branch's tripwire — run URLs on LAB-1151; closed unmerged, branches deleted. | ||
|
|
||
| ## Docs | ||
|
|
||
| README §Gate tamper-evidence (new), `make security` wording, Makefile comment — all state what the gate does and does not defend against. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Do not equate a local pass with a CI pass.
make securitydoes not run the PR-only gate tamper check. A PR that changesdeny.tomlcan pass this target and fail thesupply-chainjob. State that a local pass validates onlycargo denyandcargo audit.🤖 Prompt for AI Agents