cerberauth/jwtop-action
L’action officielle — aucune configuration requise, ajoutez-la simplement à votre workflow.
Exécutez jwtop dans vos workflows GitHub Actions pour détecter les mauvaises configurations JWT avant qu’elles n’atteignent la production.
cerberauth/jwtop-action
L’action officielle — aucune configuration requise, ajoutez-la simplement à votre workflow.
CLI brute
Installez jwtop directement et exécutez n’importe quelle commande dans une étape de workflow.
L’action cerberauth/jwtop-action installe jwtop et exécute la commande que vous spécifiez.
- uses: cerberauth/jwtop-action@v1 with: args: crack ${{ env.TOKEN }} --url https://api.example.com/protected| Entrée | Description | Requis |
|---|---|---|
args | Arguments passés directement à jwtop | Oui |
name: JWT security scan
on: pull_request:
jobs: jwt-scan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6
- name: Scan for JWT vulnerabilities uses: cerberauth/jwtop-action@v1 with: args: crack ${{ secrets.TEST_TOKEN }} --url ${{ vars.API_URL }}/protectedSi vous avez besoin de plus de contrôle, installez jwtop en tant qu’étape et exécutez les commandes directement.
- name: Install jwtop run: go install github.com/cerberauth/jwtop@latestOu utilisez l’image Docker pour éviter d’avoir besoin de Go :
- name: Scan JWT vulnerabilities run: | docker run --rm ghcr.io/cerberauth/jwtop \ crack "$TOKEN" --url "$API_URL" env: TOKEN: ${{ secrets.TEST_TOKEN }} API_URL: ${{ vars.API_URL }}jwtop crack retourne le code 0 si au moins un exploit réussit. Utilisez une négation pour faire échouer le build :
- name: Assert no JWT vulnerabilities run: | if jwtop crack "$TOKEN" --url "$API_URL"; then echo "::error::JWT vulnerability detected" exit 1 fi env: TOKEN: ${{ secrets.TEST_TOKEN }} API_URL: ${{ vars.API_URL }}- name: Generate test JWT run: | TOKEN=$(jwtop create --alg HS256 \ --secret "$TEST_SECRET" \ --sub ci-runner \ --exp 1h) echo "TEST_TOKEN=$TOKEN" >> "$GITHUB_ENV" env: TEST_SECRET: ${{ secrets.TEST_SECRET }}
- name: Run integration tests run: go test ./integration/... env: TEST_TOKEN: ${{ env.TEST_TOKEN }}- name: Verify staging token run: jwtop verify "$TOKEN" --jwks "$JWKS_URI" env: TOKEN: ${{ steps.fetch-token.outputs.token }} JWKS_URI: https://staging.example.com/.well-known/jwks.json- name: Full JWT security scan uses: cerberauth/jwtop-action@v1 with: args: > crack ${{ secrets.TEST_TOKEN }} --url ${{ vars.API_URL }}/protected --key public.pem --wordlist wordlists/secrets.txt