๐ก๏ธ Sentinel: [HIGH] Fix Information Disclosure in CI Subprocess Logs - #631
๐ก๏ธ Sentinel: [HIGH] Fix Information Disclosure in CI Subprocess Logs#631seonghobae wants to merge 13 commits into
Conversation
* Added redaction to subprocess stdout and stderr in sandboxed_verify.py and sandboxed_web_e2e.py to prevent information disclosure (e.g., exposing credentials) in logs and error tracebacks. * Fallbacks dynamically provided via scripts.ci.redact_sensitive_log.redact_text (with an ImportError check). * Logged security finding in .jules/sentinel.md.
|
๐ Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a ๐ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review detailsโ๏ธ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ๐ Files selected for processing (5)
โจ Finishing Touches๐ Generate docstrings
๐งช Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
Hardens the CI sandbox helpers (scripts/ci/sandboxed_verify.py and scripts/ci/sandboxed_web_e2e.py) against accidental secret leakage by redacting subprocess outputs before they are printed as review evidence, and records the learning in Julesโ Sentinel log.
Changes:
- Redact subprocess stdout/stderr (including timeout-captured output) before printing in
sandboxed_verify.py. - Redact E2E stdout/stderr and service log tails before printing in
sandboxed_web_e2e.py. - Document the โinformation disclosure via CI logsโ lesson in
.jules/sentinel.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/ci/sandboxed_verify.py | Wraps command banner + stdout/stderr printing with redact_text() (with ImportError fallback). |
| scripts/ci/sandboxed_web_e2e.py | Wraps E2E output and service log tail printing with redact_text() (with ImportError fallback). |
| .jules/sentinel.md | Adds a new Sentinel entry describing the log-redaction prevention guidance. |
๐ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@jules Please address all unresolved review threads and harden this PR directly on its current branch. Required changes:
|
Revert changes as the vulnerability fix is superseded by #631.
์์ฒญํ์ ๋ณ๊ฒฝ ์ฌํญ์ ๋ชจ๋ ๋ฐ์ํ์ต๋๋ค. fail-open |
โฆ(v2) * Adjusted fail-closed redactor logic via direct sys.path import instead of open-ended ImportError fallback in sandboxed_verify.py and sandboxed_web_e2e.py. * Sanitized machine-readable result payload fields (`command`, `cwd`, `evidence_note`, `sandbox`, `backend_cmd`, `frontend_cmd`, `e2e_cmd`) prior to JSON serialization. * Wrapped timeout stdout/stderr and normal execution tracebacks with the redactor logic. * Achieved 100% test coverage with robust specific tests validating that strings and bytes containing credentials inside standard out, timeout and e2e payload logs are safely redacted. * Updated `.jules/sentinel.md` with explicit details emphasizing fail closed configurations.
โฆ(v3) * Adjusted fail-closed redactor logic via direct sys.path import instead of open-ended ImportError fallback in sandboxed_verify.py and sandboxed_web_e2e.py. * Sanitized machine-readable result payload fields (`command`, `cwd`, `evidence_note`, `sandbox`, `backend_cmd`, `frontend_cmd`, `e2e_cmd`) prior to JSON serialization. * Wrapped timeout stdout/stderr and normal execution tracebacks with the redactor logic. * Achieved 100% test coverage with robust specific tests validating that strings and bytes containing credentials inside standard out, timeout and e2e payload logs are safely redacted. Replaced real credential strings used in the tests with mock strings to fix `gitleaks` scanner failures. * Updated `.jules/sentinel.md` with explicit details emphasizing fail closed configurations.
|
@coderabbitai review |
โ Action performedReview finished.
|
Acknowledged. |
โฆ(v3) * Adjusted fail-closed redactor logic via direct sys.path import instead of open-ended ImportError fallback in sandboxed_verify.py and sandboxed_web_e2e.py. * Sanitized machine-readable result payload fields (`command`, `cwd`, `evidence_note`, `sandbox`, `backend_cmd`, `frontend_cmd`, `e2e_cmd`) prior to JSON serialization. * Wrapped timeout stdout/stderr and normal execution tracebacks with the redactor logic. * Achieved 100% test coverage with robust specific tests validating that strings and bytes containing credentials inside standard out, timeout and e2e payload logs are safely redacted. Replaced real credential strings used in the tests with mock strings to fix `gitleaks` scanner failures. * Updated `.jules/sentinel.md` with explicit details emphasizing fail closed configurations.
| command=["echo", "api_key: mock_token_string"], | ||
| copied_repo=tmp_path / "github_pat_11A2B3C4D5E6F7G8H9I0J_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890", | ||
| sandbox_root=tmp_path / "sandbox_test_root", | ||
| exit_code=0, |
| assert "mock_token_string" not in captured.out | ||
| assert "github_pat_11A2B3C4D5E6F7G8H9I0J_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890" not in captured.out | ||
| assert "sandbox_test_root" in captured.out | ||
|
|
| evidence_note = "used nothing_sensitive" | ||
| network = "default" | ||
| keep_sandbox = True | ||
|
|
| sandbox_root=tmp_path / "sandbox_test_root", | ||
| backend_ready=True, | ||
| frontend_ready=True, | ||
| exit_code=0, |
| assert "sandbox_test_root" in captured.out | ||
|
|
||
| def test_main_redacts_stdout_stderr_and_log_tail(monkeypatch, tmp_path, capsys): | ||
| repo = tmp_path / "repo" |
|
@jules Fix the current Secret Scan failure without weakening the gate. The current PR history contains credential-shaped literals in |
ํด๋น ๋ฆฌ๋ทฐ ๋ด์ฉ์ ๋ง์ถฐ ๋ณ๊ฒฝ ์ฌํญ์ ์์ ํ์ต๋๋ค.
|
|
Superseded by #711. The replacement branch was rebuilt from current |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
๐จ Severity: HIGH
๐ก Vulnerability: Unredacted subprocess output and logs in
sandboxed_verify.pyandsandboxed_web_e2e.pycan inadvertently expose sensitive credentials through standard output or error tracebacks during failure scenarios.๐ฏ Impact: Exposing untrusted data from commands executed in a sandboxed CI context can leak execution secrets and credentials.
๐ง Fix: Wrapped arbitrary subprocess outputs and tracebacks with
scripts.ci.redact_sensitive_log.redact_textbefore logging or printing them. Added a safe fallback using anImportErrorcatch block.โ Verification: Verified changes via tests, ensuring
scripts/ci/test coverage remains at 100%. No new linting warnings detected via bandit.PR created automatically by Jules for task 16137767205653188116 started by @seonghobae