Skip to content

Commit c0922ea

Browse files
harmjeffclaude
andcommitted
fix(security): fix nosemgrep suppression format for subprocess calls
Change inline full-rule-ID nosemgrep comments to preceding-line short-name format (# nosemgrep: dangerous-subprocess-use-audit), matching the pattern used throughout the rest of the codebase that the Semgrep OSS GitHub App correctly honours. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 2c41fb4 commit c0922ea

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

scripts/aidlc-evaluator/packages/cli-harness/src/cli_harness/adapters/claude_code_sdk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ def _exec_tool(name: str, tool_input: dict, run_folder: Path, rules_dir: Path) -
299299
if (val := os.environ.get(var)):
300300
env[var] = val
301301
try:
302-
result = subprocess.run( # nosec B603 nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
302+
# nosemgrep: dangerous-subprocess-use-audit
303+
result = subprocess.run( # nosec B603
303304
shlex.split(command),
304305
shell=False,
305306
cwd=str(cwd),

scripts/aidlc-evaluator/packages/cli-harness/src/cli_harness/adapters/kiro_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ def _run_kiro_stage(stage_prompt: str, stage_name: str, is_first: bool) -> tuple
171171

172172
_log(f"{stage_name}: launching kiro ({len(stage_prompt)} chars)")
173173

174-
proc = subprocess.Popen( # nosec B603 nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
174+
# nosemgrep: dangerous-subprocess-use-audit
175+
proc = subprocess.Popen( # nosec B603
175176
cmd,
176177
cwd=str(workspace),
177178
stdout=subprocess.PIPE,

scripts/aidlc-evaluator/run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ def check_docker_sandbox() -> bool:
9393
if cli is None:
9494
return False
9595
try:
96-
result = subprocess.run( # nosec B603 nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
96+
# nosemgrep: dangerous-subprocess-use-audit
97+
result = subprocess.run( # nosec B603
9798
[cli, "info"],
9899
stdout=subprocess.DEVNULL,
99100
stderr=subprocess.DEVNULL,
@@ -102,7 +103,8 @@ def check_docker_sandbox() -> bool:
102103
if result.returncode != 0:
103104
return False
104105

105-
result = subprocess.run( # nosec B603 nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
106+
# nosemgrep: dangerous-subprocess-use-audit
107+
result = subprocess.run( # nosec B603
106108
[cli, "images", "-q", "aidlc-sandbox:latest"],
107109
capture_output=True,
108110
text=True,

scripts/aidlc-evaluator/scripts/run_git_compare.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ def run_single_evaluation(
367367
log_file.write(f"{'=' * 70}\n\n")
368368
log_file.flush()
369369

370-
result = subprocess.run(cmd, stdout=log_file, stderr=subprocess.STDOUT) # nosec B603 nosemgrep: python.lang.security.audit.dangerous-subprocess-use-audit.dangerous-subprocess-use-audit
370+
# nosemgrep: dangerous-subprocess-use-audit
371+
result = subprocess.run(cmd, stdout=log_file, stderr=subprocess.STDOUT) # nosec B603
371372

372373
elapsed_s = time.monotonic() - start_monotonic
373374
status = "success" if result.returncode == 0 else "failed"

0 commit comments

Comments
 (0)