-
Notifications
You must be signed in to change notification settings - Fork 0
๐ก๏ธ Sentinel: [HIGH] CI ๋ก๊ทธ ๋ด ์ ๋ณด ์ ์ถ ๋ฐฉ์ง (Redact Subprocess Logs) #633
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,13 @@ | |
| from collections.abc import Sequence | ||
| from pathlib import Path | ||
|
|
||
| try: | ||
| from scripts.ci.redact_sensitive_log import redact_text | ||
| except ImportError: # pragma: no cover | ||
|
|
||
| def redact_text(text: str) -> str: | ||
| return text | ||
|
|
||
|
Comment on lines
+17
to
+23
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 Redaction ๋ชจ๋ ๋ถ์ฌ ์ ์ ์ฒด ๋ณดํธ๊ฐ fail-open ๋ฉ๋๋ค. ๋ ์คํฌ๋ฆฝํธ์ no-op ํด๋ฐฑ๊ณผ ์ด๋ฅผ ๋ช ์ํ ๋ฌธ์๊ฐ ๊ฒฐํฉ๋์ด, helper import ์คํจ ์ ๋ฏผ๊ฐํ stdout/stderr ๋ฐ ๋ก๊ทธ ํ ์ผ์ด ์๋ฌธ์ผ๋ก ๋ ธ์ถ๋ ์ ์์ต๋๋ค.
๐ Affects 3 files
๐ค Prompt for AI Agents |
||
|
|
||
| DEFAULT_IGNORE = ( | ||
| ".git", | ||
|
|
@@ -219,17 +226,17 @@ def main(argv: Sequence[str] | None = None) -> int: | |
| try: | ||
| completed = run_command(args.command, copied_repo, env, args.timeout) | ||
| if completed.stdout: | ||
| print(completed.stdout, end="") | ||
| print(redact_text(completed.stdout), end="") | ||
| if completed.stderr: | ||
| print(completed.stderr, end="", file=sys.stderr) | ||
| print(redact_text(completed.stderr), end="", file=sys.stderr) | ||
| exit_code = completed.returncode | ||
| except subprocess.TimeoutExpired as exc: | ||
| stdout = timeout_output_text(exc.stdout) | ||
| stderr = timeout_output_text(exc.stderr) | ||
| if stdout: | ||
| print(stdout, end="" if stdout.endswith("\n") else "\n") | ||
| print(redact_text(stdout), end="" if stdout.endswith("\n") else "\n") | ||
| if stderr: | ||
| print(stderr, end="" if stderr.endswith("\n") else "\n", file=sys.stderr) | ||
| print(redact_text(stderr), end="" if stderr.endswith("\n") else "\n", file=sys.stderr) | ||
| print(f"sandboxed-verify: command timed out after {args.timeout}s", file=sys.stderr) | ||
| exit_code = 124 | ||
| return exit_code | ||
|
|
||
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.
๐ Security & Privacy | ๐ Major | โก Quick win
๋ณด์ ์ง์นจ์ no-op ํด๋ฐฑ์ ์๊ตฌํ์ง ๋ง์ธ์.
ImportError ์ ์ ๋ ฅ์ ๊ทธ๋๋ก ์ถ๋ ฅํ๋ ํด๋ฐฑ์ ๋ฏผ๊ฐ ์ ๋ณด ๋ณดํธ๋ฅผ ๋ณด์ฅํ์ง ์์ต๋๋ค. ์ด ์ง์นจ์ redaction helper๊ฐ ์์ ๋ fail closed ํ๊ฑฐ๋ ์์ ํ ๋ก์ปฌ redaction์ ์ฌ์ฉํ๋๋ก ๋ช ํํ ํด์ผ ํฉ๋๋ค.
๐ค Prompt for AI Agents