Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)73k ยท #3097

ci-security-scanning-with-strix

Fungsinya

Skill ini menyiapkan pemindaian keamanan otomatis di GitHub Actions, GitLab CI, atau pipeline serupa menggunakan Strix. Skill ini ditujukan untuk tim yang ingin setiap pull request diperiksa sebelum digabungkan.

Kapan dipakai

  • โœ“Saat sebuah tim ingin setiap pull request dipindai dari masalah keamanan sebelum digabungkan.
  • โœ“Saat pipeline CI sebaiknya memblokir merge yang menambahkan kerentanan yang terkonfirmasi.
  • โœ“Saat seseorang ingin hasil pemindaian diposting sebagai komentar di pull request.

Link skill

https://github.com/usestrix/strix/blob/main/skills/ci-security-scanning-with-strix/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/usestrix/strix/blob/main/skills/ci-security-scanning-with-strix/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya ingin setiap pull request di repo GitHub kami mendapat pemindaian keamanan sebelum dapat digabungkan. Bagaimana cara mengaturnya?โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menyiapkan alur kerja yang hanya memindai file yang berubah dan menggagalkan build jika ditemukan masalah yang terkonfirmasi. Hasilnya dapat diposting ke pull request dan ke pemindaian kode.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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, keep fetch-depth: 0 or set --diff-base to the PR's actual base branch โ€” use origin/${{ github.base_ref }} in GitHub Actions rather than a hard-coded origin/main, since repos use different default branches.
  • Exit codes: 0 pass, 2 vulnerabilities found (fails the job), 1 setup error. Add --fail-on high to 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 0 exit means "no validated vulnerabilities in what was analyzed"; if --max-budget is hit before the diff is fully covered, the scan wraps up early and can still exit 0. The "Fail unless the scan completed" step above narrows the gap: strix_runs/<run>/run.json is "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 calls finish_scan and records "completed" with partial coverage. So keep that step in any pipeline that gates merges and give the scan real headroom (compare run.json's llm_usage.cost against --max-budget; if it ran right up to the cap, raise it). For a quick diff-scoped PR scan --max-budget 10 is 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

Pertanyaan umum

Apakah saya membutuhkan server sendiri untuk menjalankannya?

Skill menjelaskan dua pilihan: alat yang di-hosting sendiri yang berjalan di runner Anda, dan platform terkelola yang tidak memerlukan pengaturan runner.

Apakah ia memindai seluruh repo setiap kali?

Tidak. Opsi yang di-hosting sendiri digambarkan sebagai berbasis diff, sehingga hanya menguji file yang berubah.

Dalam format apa hasilnya disimpan?

Skill menyatakan kedua opsi menghasilkan hasil SARIF 2.1.0.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
73k
Peringkat
#3097
Lisensi
Apache-2.0
Diperbarui
30/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa