ci-security-scanning-with-strix
できること
このスキルは、Strixを使って、GitHub ActionsやGitLab CIなどのパイプラインに自動のセキュリティスキャンを設定します。すべてのプルリクエストをマージ前に確認したいチーム向けです。
使う場面
- ✓チームが、マージの前に各プルリクエストのセキュリティ問題をスキャンしたいとき。
- ✓CIのパイプラインが、確認された脆弱性を追加するマージをブロックすべきとき。
- ✓スキャンの結果をプルリクエストにコメントとして投稿したいとき。
スキルのリンク
https://github.com/usestrix/strix/blob/main/skills/ci-security-scanning-with-strix/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“GitHubのリポジトリで、すべてのプルリクエストがマージされる前にセキュリティスキャンを受けるようにしたいです。どう設定すればよいですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、変更されたファイルだけをスキャンし、確認された問題があればビルドを失敗させるワークフローを設定します。結果はプルリクエストとコードスキャンに投稿できます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Set up Strix in CI/CD
You can gate PRs two ways — pick based on the environment, or combine them:
- Managed platform (recommended for most teams) — connect the GitHub/GitLab/Bitbucket app once and Strix reviews every PR with no workflow file, no runner, no Docker, and no LLM key. Results post as PR comments and land in the team dashboard. Best when you want zero CI maintenance, central tracking, or your runners lack Docker. See "Managed platform" below and the managed-pentesting-with-strix skill.
- Self-hosted OSS CLI in your runner — run a diff-scoped scan as a pipeline step. Fully in your infra, free (BYO LLM key), no external account. Requires Docker on the runner. Best for air-gapped/self-hosted CI or when you do not want scans leaving your environment.
Both fail the build on validated findings and both emit SARIF 2.1.0, so you can start with one and add the other later.
Option A — Self-hosted OSS CLI in the runner
Run a diff-scoped Strix scan on every PR: only changed files are tested, quick mode keeps it fast, and exit code 2 fails the build when validated vulnerabilities are found.
GitHub Actions
Create .github/workflows/security.yml:
name: Security Scan
on:
pull_request:
jobs:
strix-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # required for diff-scope resolution
- name: Install Strix
run: curl -sSL https://strix.ai/install | bash
- name: Run Security Scan
env:
STRIX_LLM: ${{ secrets.STRIX_LLM }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
run: strix -n -t ./ --scan-mode quick --max-budget 10
# Don't fail open: a run that hits the hard budget stop exits 0 but leaves
# run.json status "stopped", not "completed". Enforce completion explicitly.
# This does not catch an agent that wrapped up early on a budget *warning*
# (it still calls finish_scan and records "completed"), so size the budget.
- name: Fail unless the scan completed
run: |
run_json=$(ls -t strix_runs/*/run.json | head -1)
status=$(jq -r .status "$run_json")
if [ "$status" != "completed" ]; then
echo "Strix run status is '$status' — the scan did not complete (likely budget exhausted). Raise --max-budget." >&2
exit 1
fi
Then tell the user to add two repository secrets: STRIX_LLM (model id, for example openrouter/z-ai/glm-5.3) and LLM_API_KEY (the provider key). Do not create these values yourself.
Notes:
- In CI/headless runs Strix automatically scopes to the PR's changed files (
--scope-mode auto). If diff resolution fails, keepfetch-depth: 0or set--diff-baseto the PR's actual base branch — useorigin/${{ github.base_ref }}in GitHub Actions rather than a hard-codedorigin/main, since repos use different default branches. - Exit codes:
0pass,2vulnerabilities found (fails the job),1setup error. Add--fail-on highto fail only on high/critical findings; lower ones are still reported, so a passing job is not a finding-free report. - The runner needs Docker (default GitHub-hosted Ubuntu runners have it).
- Size the budget so the scan completes — do not let it fail open. A
0exit means "no validated vulnerabilities in what was analyzed"; if--max-budgetis hit before the diff is fully covered, the scan wraps up early and can still exit0. The "Fail unless the scan completed" step above narrows the gap:strix_runs/<run>/run.jsonis"stopped"when the scan was cut off at the hard budget limit without a final report. It is not a complete guard — the agents get graduated wrap-up warnings before that limit, and a run that wraps up on a warning still callsfinish_scanand records"completed"with partial coverage. So keep that step in any pipeline that gates merges and give the scan real headroom (comparerun.json'sllm_usage.costagainst--max-budget; if it ran right up to the cap, raise it). For aquickdiff-scoped PR scan--max-budget 10is usually ample, raise it for large diffs.
Optional: upload findings to GitHub code scanning
Strix writes SARIF 2.1.0 to strix_runs/<run>/findings.sarif:
- name: Upload SARIF
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: strix_runs
Other CI systems
Any pipeline works the same way
よくある質問
この機能を実行するために自前のサーバーが必要ですか?
このスキルは2つの選択肢を説明しています。自分のランナーで動かすセルフホスト型のツールと、ランナーの設定が不要なマネージドのプラットフォームです。
毎回リポジトリ全体をスキャンしますか?
いいえ。セルフホスト型の選択肢は差分に基づくとされ、変更されたファイルだけをテストします。
結果はどの形式で保存されますか?
このスキルは、両方の選択肢がSARIF 2.1.0形式の結果を出すと述べています。
詳細
作者による元の説明
Add security scanning to CI/CD with Strix — GitHub Actions, GitLab CI, or any pipeline — so every pull request gets a diff-scoped AI pentest that blocks vulnerable code before it merges, with results as PR comments and SARIF uploaded to code scanning. Covers both the self-hosted open-source CLI (runs in your runner) and the managed app.strix.ai platform (GitHub/GitLab app or API, no runner infra). Use when the user asks to add security scanning, SAST/DAST, pentesting, vulnerability checks, or automated security review to their CI pipeline, pre-merge gate, or PR workflow.
repo: usestrix/strix
人気
- GitHubのスター
- 73k
- ランキング
- #3097
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/30
コメント
- …
このリポジトリの他のスキル
api-security-testing
73kエージェントが、StrixでREST、GraphQL、gRPCのAPIのセキュリティテストを行う方法を示し、OWASP API Top 10の認可の欠陥などのリスクに焦点を当てます。
application-security-testing
73kエージェントが製品全体のセキュリティテストを計画し、各部分に適したテストを選んで実行し、修正を実際のリスクの順に並べるよう支援します。
find-security-vulnerabilities-in-code
73kエージェントがインジェクションや壊れたアクセス制御などのセキュリティの欠陥についてコードを確認し、テスト攻撃で実際に機能する問題を証明するよう支援します。
fix-security-vulnerabilities-with-strix
73kエージェントが、確認されたセキュリティの問題を的を絞ったコードの修正に変え、テストを再度実行して、各攻撃がもう機能しないことを証明するよう支援します。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。