mirror of
https://github.com/waybarrios/opencode-power-pack.git
synced 2026-11-19 02:16:19 +00:00
GitHub Actions prompt-injection audit, threat modeling, differential review, variant analysis, SARIF parsing, Semgrep/CodeQL scanning and rule authoring, and WooYun-derived web vuln methodology. Generalized semgrep's piolium-specific subagent references. Skill count 45 -> 55.
73 lines
2.0 KiB
YAML
73 lines
2.0 KiB
YAML
rules:
|
|
- id: variant-taint-analysis
|
|
message: >-
|
|
Potential variant: user-controlled data flows to dangerous sink.
|
|
Original bug: [DESCRIBE_ORIGINAL_BUG]
|
|
severity: ERROR
|
|
languages: [python]
|
|
mode: taint
|
|
|
|
pattern-sources:
|
|
# Flask
|
|
- pattern: request.args.get(...)
|
|
- pattern: request.args[...]
|
|
- pattern: request.form.get(...)
|
|
- pattern: request.form[...]
|
|
- pattern: request.json
|
|
- pattern: request.data
|
|
# Django (uncomment if needed)
|
|
# - pattern: request.GET.get(...)
|
|
# - pattern: request.POST.get(...)
|
|
# General
|
|
- pattern: os.environ.get(...)
|
|
- pattern: input(...)
|
|
|
|
pattern-sinks:
|
|
# Command injection
|
|
- pattern: os.system($SINK)
|
|
- pattern: os.popen($SINK)
|
|
- pattern: subprocess.call($SINK, ...)
|
|
- pattern: subprocess.run($SINK, ...)
|
|
- pattern: subprocess.Popen($SINK, ...)
|
|
# Code execution
|
|
- pattern: eval($SINK)
|
|
- pattern: exec($SINK)
|
|
# SQL (uncomment if needed)
|
|
# - pattern: $CURSOR.execute($SINK)
|
|
# Path traversal (uncomment if needed)
|
|
# - pattern: open($SINK, ...)
|
|
|
|
pattern-sanitizers:
|
|
- pattern: shlex.quote(...)
|
|
- pattern: os.path.basename(...)
|
|
- pattern: int(...)
|
|
- pattern: sanitize(...)
|
|
- pattern: escape(...)
|
|
- pattern: validate(...)
|
|
|
|
paths:
|
|
exclude:
|
|
- "*_test.py"
|
|
- "test_*.py"
|
|
- "tests/"
|
|
- "**/test/**"
|
|
|
|
metadata:
|
|
category: security
|
|
confidence: HIGH
|
|
|
|
# Simple pattern matching variant (non-taint)
|
|
- id: variant-pattern-match
|
|
message: "Suspicious pattern matching known vulnerability signature"
|
|
severity: WARNING
|
|
languages: [python]
|
|
patterns:
|
|
- pattern-either:
|
|
- pattern: dangerous_func($USER_DATA)
|
|
- pattern: risky_operation(..., $USER_DATA, ...)
|
|
- pattern-not: dangerous_func("...")
|
|
paths:
|
|
exclude:
|
|
- "tests/"
|
|
- "*_test.py"
|