Semgrep flags `subprocess.run(cmd, shell=True)` in a script where `cmd` is a hard-coded constant
BeginnerTroubleshootingSAST, SCA and secrets scanning in CI
Answer
Likely causes → The rule is a pattern match on shell=True, not a taint rule, so it cannot tell a constant from user input.
Diagnose →
semgrep --config p/python --json path/to/script.py | jq '.results[] | {check_id, line: .start.line}'
Fix → If genuinely safe, suppress inline with a reason:
subprocess.run(CMD, shell=True) # nosemgrep: python.lang.security.audit.subprocess-shell-true.subprocess-shell-true -- constant, no input
Better: drop shell=True and pass a list.
Prevent → Prefer taint-mode rules for injection classes, and require a justification string on every nosemgrep (enforce with a review rule).
More on SAST, SCA and secrets scanning in CI
gitleaks fails the PR on `tests/fixtures/fake_rsa.pem` and `testdata/aws_creds.json`, which only contain dummy valuesBeginnergitleaks passes locally but the CI job reports 40 old leaks nobody touched in this PRIntermediate`fatal: ambiguous argument 'origin/main..HEAD': unknown revision` in the secrets-scan stepBeginnerSemgrep in CI reports findings in `node_modules/`, `vendor/` and minified `dist/*.js`BeginnerSemgrep job takes 35 minutes and gets killed with `exit code 137`IntermediateSonarQube Quality Gate fails on "Security Hotspots Reviewed is less than 100%" but there are no vulnerabilitiesBeginner