pyaegis <target> [options]| Flag | Description | Default |
|---|---|---|
target |
スキャン対象のファイルまたはディレクトリ | — |
--rules |
YAML ルールファイルのパス | pyaegis/rules/default.yml |
--format |
出力形式:text, json, csv, html, sarif |
text |
--output |
出力ファイル(省略時は標準出力) | stdout |
--debug |
詳細ログ出力 | off |
終了コード:
0— 検出なし1— 検出あり、または致命的スキャンエラー
ルールは 3 つのオプショナルキーを持つプレーンな YAML ファイルです:
# my_rules.yml
inputs:
- input
- os.getenv
- request.args
sinks:
- eval
- exec
- os.system
- subprocess.*
- my_custom_exec_fn
sanitizers:
- html.escape
- my_project.utils.sanitize独自ルールで実行:
pyaegis ./src --rules my_rules.ymlパターンは fnmatch グロブをサポート:subprocess.* は subprocess.call、subprocess.Popen 等にマッチします。
詳細は docs/detectors.md を参照してください。
- name: Run PyAegis SAST
run: |
pip install pyaegis
pyaegis . --format sarif --output pyaegis.sarif
- name: Upload SARIF to GitHub Advanced Security
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: pyaegis.sarifsast:
stage: test
script:
- pip install pyaegis
- pyaegis . --format json --output gl-sast-report.json
artifacts:
reports:
sast: gl-sast-report.json詳細な例は docs/ci-integration.md を参照してください。
| Feature | PyAegis | Bandit | Semgrep |
|---|---|---|---|
| Language focus | Python-first | Python | Multi-language |
| Analysis method | AST taint-flow | AST pattern | Pattern + taint |
| Source→sink tracking | ✅ Yes | ✅ Taint mode | |
| Sanitizer awareness | ✅ Yes | ❌ No | ✅ Yes |
| Inter-procedural | ✅ Local functions | ❌ No | ✅ Yes |
| SARIF output | ✅ Native | ❌ External converter | ✅ Native |
| Custom rules format | YAML | Python plugin | YAML |
| Rule ecosystem | Small (growing) | Large | Very large |
| Typical FP rate | ~8–12% | ~25–35% | ~10–40% |
| Install size | Minimal | Moderate | Large |
| CI integration | Simple | Simple | Moderate |