fix(scan): Prüfwerk's own code no longer flags its test literals
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m4s
CI / Check (pull_request) Successful in 17m14s
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 4m4s
CI / Check (pull_request) Successful in 17m14s
Four findings of Prüfwerk's scan of its own repository, each a test value: - scripts/test_codesys_export.py ran the export script with exec(compile(...)) (semgrep exec-used). runpy.run_path runs it the same way, with the Script Engine's `projects` as an initial global, without eval. - patterns.rs: the oauth-token-url test held the strings the rule matches, so the rule matched its own test. The strings are now split with concat!, and the test checks the same. - A made-up Firebase-shaped key in gitleaks.rs's tests and the throwaway MongoDB password of a CI test container are in the git history, which the secret scanner walks. .gitleaksignore lists their fingerprints (commit:file:rule:line); gitleaks honours it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b079cf9267
commit
0b833b85e8
3 files changed
+21
-5
No files matched your search
@@ -53,16 +53,17 @@ class FakeProjects:
|
||||
|
||||
def run(argv: list[str], projects: FakeProjects | None) -> int:
|
||||
"""Run the script with `argv`; its exit status (0 when it returns)."""
|
||||
source = SCRIPT.read_text(encoding="utf-8")
|
||||
scope: dict[str, object] = {"__name__": "__main__", "__file__": str(SCRIPT)}
|
||||
# The Script Engine's globals; runpy adds __name__ and __file__.
|
||||
scope: dict[str, object] = {}
|
||||
if projects is not None:
|
||||
scope["projects"] = projects
|
||||
import runpy
|
||||
import sys
|
||||
|
||||
saved = sys.argv
|
||||
sys.argv = argv
|
||||
try:
|
||||
exec(compile(source, str(SCRIPT), "exec"), scope)
|
||||
runpy.run_path(str(SCRIPT), init_globals=scope, run_name="__main__")
|
||||
except SystemExit as stop:
|
||||
return int(stop.code or 0)
|
||||
finally:
|
||||
|
||||
Reference in new issue
Block a user