Scan Python code for ten AST security issues: eval/exec, shell=True, pickle, unsafe yaml, weak hashes, disabled TLS, hardcoded secrets, SQL built from strings, mktemp, debug=True. Use when the user asks for a security scan or SARIF.
92%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Medium
Suggest reviewing before use
python3 scripts/sast_scan.py [PATH ...] [--format text|sarif] [--output FILE] [--min-severity low|medium|high]PATH defaults to the current directory. Directories are scanned recursively for *.py; files can be given directly..git, .venv, venv and node_modules directories are skipped, and symlinked directories are not followed.--min-severity hides findings below the level in the output. The exit code still reflects every detected finding.--output FILE writes the report to a file instead of standard output.Text line: path:line:column: [SEVERITY] RULE: message. A clean scan prints No findings detected.
Put a comment on the same line as the reported line:
digest = hashlib.md5(blob) # nosast: PY005
value = something() # nosast (silences every rule on this line)Several rules: # nosast: PY002, PY005. Rule ids are case-insensitive. For a call that spans lines,
the finding is reported on the line where the call starts, so put the comment there.
--format sarif emits one run with the rule table, results with startLine and startColumn, and
columnKind: unicodeCodePoints. Severity maps to SARIF level: high to error, medium to warning,
low to note. Paths use forward slashes.
getattr, __import__, reflection can hide a dangerous call).import statements.