mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 04:29:27 +00:00
search executor: name the credential-like variables it refuses (names only)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1bfb729422
commit
75f2134eb4
@@ -534,11 +534,14 @@ def main() -> None:
|
|||||||
prepared_url = os.environ.get("PREPARED_PUT_URL")
|
prepared_url = os.environ.get("PREPARED_PUT_URL")
|
||||||
# Clearing Python's environment cannot remove initial /proc/self/environ.
|
# Clearing Python's environment cannot remove initial /proc/self/environ.
|
||||||
# Refuse a misconfigured task before any repository input is opened.
|
# Refuse a misconfigured task before any repository input is opened.
|
||||||
if any(
|
inherited = sorted(
|
||||||
value and any(word in key.upper() for word in ("KEY", "TOKEN", "SECRET", "PASSWORD", "CREDENTIAL"))
|
key
|
||||||
for key, value in os.environ.items()
|
for key, value in os.environ.items()
|
||||||
):
|
if value and any(word in key.upper() for word in ("KEY", "TOKEN", "SECRET", "PASSWORD", "CREDENTIAL"))
|
||||||
raise SystemExit("executor refuses inherited credentials")
|
)
|
||||||
|
if inherited:
|
||||||
|
# Names only, never values, so a misconfigured task can be diagnosed from the worker log.
|
||||||
|
raise SystemExit("executor refuses inherited credentials: " + ", ".join(inherited))
|
||||||
scratch_limit = task_storage.configure()
|
scratch_limit = task_storage.configure()
|
||||||
os.environ.clear()
|
os.environ.clear()
|
||||||
os.environ.update(clean_environment())
|
os.environ.update(clean_environment())
|
||||||
|
|||||||
Reference in New Issue
Block a user