CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

trysac/sast-rules-mini

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.

Quality

92%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Medium

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

usage.mdreferences/

Usage, suppression, SARIF and limits

Command line

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.

Suppressing a finding

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.

SARIF 2.1.0

--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.

Limits

  • Resource limits: 1 MiB per file (larger files give PY000) and 10,000 files per run.
  • No inter-procedural data flow, no cross-file tracking, no analysis of code built at run time (getattr, __import__, reflection can hide a dangerous call).
  • Alias tracking uses the file's own import statements.
  • A clean scan means none of these ten patterns were found. It is not a proof that the code is secure.

SKILL.md

tile.json