chore(ci): add two-stage secret gate - #600
Open
erinavllazagaj-eng wants to merge 1 commit into
Open
erinavllazagaj-eng wants to merge 1 commit into
erinavllazagaj-eng wants to merge 1 commit into
Conversation
Stage 1 scans with betterleaks (advisory). Stage 2 triages with Kimi K3 and publishes the blocking 'AI secret verdict' commit status. Run 'deploy-secret-gate.sh arm runpod/runpod-python' after this merges.
| # No tick when a banner above already failed the gate: a green line under | ||
| # a red banner is the one mixed signal this comment must never send. | ||
| clean = not (review["injection"] or review["unanswered"] or blocked) | ||
| L += ["✅ No secrets in the changed files." if clean |
| HTTP_TIMEOUT_S = 60 | ||
|
|
||
| def log(msg: str) -> None: | ||
| print(msg, flush=True) |
Comment on lines
+927
to
+928
| "⚠️ **PR Security Scan did not finish cleanly** — the scanner errored " | ||
| "or a suppression was added. Resolve that before reading this.", |
Comment on lines
+946
to
+947
| "🚨 **The scanned source attempts to instruct the reviewer.** The " | ||
| "verdict below is unreliable; read the change by hand.", |
Comment on lines
+968
to
+970
| L += ["", "Rotate before anything else — the value is already in git " | ||
| "history and on GitHub's servers, so deleting the line does not " | ||
| "un-leak it.", ""] |
| # on a runner that keeps running, so remove it rather than trusting that. | ||
| try: | ||
| os.remove(report_path) | ||
| except OSError: |
Comment on lines
+927
to
+928
| "⚠️ **PR Security Scan did not finish cleanly** — the scanner errored " | ||
| "or a suppression was added. Resolve that before reading this.", |
Comment on lines
+946
to
+947
| "🚨 **The scanned source attempts to instruct the reviewer.** The " | ||
| "verdict below is unreliable; read the change by hand.", |
Comment on lines
+968
to
+970
| L += ["", "Rotate before anything else — the value is already in git " | ||
| "history and on GitHub's servers, so deleting the line does not " | ||
| "un-leak it.", ""] |
| # on a runner that keeps running, so remove it rather than trusting that. | ||
| try: | ||
| os.remove(report_path) | ||
| except OSError: |
This branch has not been deployed
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.
Adds the secret gate. Nothing blocks yet — the required-check ruleset is created separately by
deploy-secret-gate.sh arm runpod/runpod-pythonafter this merges.Owners: @runpod/security
Before merging, an admin must set the
KIMI_RUNPOD_API_KEYrepo secret. Without it stage 2 fails closed on every PR.