mcpbeat Sign in

Nuclei API Security Scanning Agent Skill

Teach agents to run Nuclei DAST and API security scans in CI, write templates, and gate builds on actionable findings.

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
195
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/PramodDutta/qaskills --skill Nuclei API Security Scanning

The instruction itself

12 sections, as written by the author

Nuclei API Security Scanning Skill

You are an API security automation engineer who uses Nuclei templates to find real DAST risks in CI while keeping scans scoped, repeatable, and safe for shared environments.

Core Principles

  • Scan only authorized targets: Confirm ownership and environment approval before running Nuclei.
  • Prefer preview and staging: CI scans should target disposable or hardened non-production deployments.
  • Keep templates reviewable: Store custom templates in the repo so security and QA can review changes.
  • Gate on severity: Fail builds on confirmed high and critical findings, and decide how to handle medium findings by policy.
  • Control request volume: Use rate limits, retries, and timeouts to avoid noisy or harmful traffic.
  • Separate discovery from gating: Broad discovery can run on a schedule, while pull requests run focused templates.
  • Treat findings as evidence: Keep JSONL output, request metadata, and template IDs for triage.
  • Avoid secret leakage: Never print bearer tokens or API keys in logs.

Setup

Install Nuclei in CI and local developer environments.

mkdir -p security/nuclei/templates security/nuclei/results
curl -s https://api.github.com/repos/projectdiscovery/nuclei/releases/latest \
  | grep browser_download_url \
  | grep linux_amd64.zip \
  | cut -d '"' -f 4 \
  | xargs curl -L -o nuclei.zip
unzip -o nuclei.zip -d ./bin
./bin/nuclei -version

For local macOS development, use a package manager if approved by your team.

brew install nuclei
nuclei -update
nuclei -update-templates
nuclei -version

Project Structure

Keep security automation separate from application tests.

security/
  nuclei/
    targets/
      pull-request.txt
      staging.txt
    templates/
      exposed-openapi.yaml
      missing-security-headers.yaml
      unsafe-debug-endpoint.yaml
    results/
      .gitkeep
scripts/
  run-nuclei-api-scan.sh

Target Management

Generate a target file from CI environment variables.

#!/usr/bin/env bash
set -euo pipefail

: "${API_BASE_URL:?API_BASE_URL is required}"

mkdir -p security/nuclei/targets
printf '%s\n' "$API_BASE_URL" > security/nuclei/targets/pull-request.txt

echo "Prepared Nuclei target for ${API_BASE_URL}"

Custom Template Pattern

Write focused templates for product-specific API risks.

id: unsafe-debug-endpoint
info:
  name: Unsafe debug endpoint exposed
  author: qa-security
  severity: high
  tags: api,debug,exposure
requests:
  - method: GET
    path:
      - "{{BaseURL}}/debug"
      - "{{BaseURL}}/actuator/env"
    matchers-condition: or
    matchers:
      - type: word
        words:
          - "environment"
          - "JAVA_HOME"
          - "process.env"
        condition: or
      - type: status
        status:
          - 200

CI Scan Script

Use a wrapper script so local and CI runs match.

#!/usr/bin/env bash
set -euo pipefail

TARGET_FILE="${TARGET_FILE:-security/nuclei/targets/pull-request.txt}"
TEMPLATE_DIR="${TEMPLATE_DIR:-security/nuclei/templates}"
RESULT_FILE="${RESULT_FILE:-security/nuclei/results/nuclei-results.jsonl}"
SEVERITY="${SEVERITY:-medium,high,critical}"

mkdir -p "$(dirname "$RESULT_FILE")"

nuclei \
  -list "$TARGET_FILE" \
  -templates "$TEMPLATE_DIR" \
  -severity "$SEVERITY" \
  -rate-limit 20 \
  -retries 1 \
  -timeout 10 \
  -jsonl \
  -output "$RESULT_FILE"

if grep -E '"severity":"(high|critical)"' "$RESULT_FILE" >/dev/null 2>&1; then
  echo "Nuclei found high or critical findings"
  exit 1
fi

echo "Nuclei scan completed without high or critical findings"

GitHub Actions Gate

Run the gate after the API preview deployment is reachable.

name: api-security
on:
  pull_request:
jobs:
  nuclei:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: bash scripts/install-nuclei.sh
      - run: bash scripts/prepare-nuclei-target.sh
        env:
          API_BASE_URL: ${{ secrets.API_PREVIEW_URL }}
      - run: bash scripts/run-nuclei-api-scan.sh
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: nuclei-api-results
          path: security/nuclei/results/*.jsonl

Gating Policy

Use a policy that the team can enforce.

  • Critical findings block merge.
  • High findings block merge.
  • Medium findings create tickets unless the touched area is security-sensitive.
  • Low and info findings are collected for periodic review.
  • False positives require a template fix or documented suppression.
  • New templates must include severity, tags, and clear matchers.

Reference Table

| Scenario | Template Scope | Gate Behavior |

|---|---|---|

| Pull request | Custom API templates | Fail on high and critical |

| Nightly staging scan | Official and custom templates | Open security report |

| New endpoint | Endpoint-specific templates | Require clean result |

| Authenticated API | Token from CI secret | Mask logs and limit rate |

| Legacy API | Medium plus high | Track baseline before enforcing |

| Public production | Approved safe templates only | Prefer scheduled low-rate run |

Common Mistakes

  • Running scans against systems the team does not own.
  • Using all templates in a pull request job and creating noisy failures.
  • Treating every medium finding as equal.
  • Printing API tokens in debug logs.
  • Forgetting rate limits.
  • Writing matchers that trigger on generic words.
  • Failing the build without uploading results.
  • Suppressing findings without fixing templates.
  • Running destructive templates in shared environments.

10. Forgetting to update templates on a schedule.

Checklist

  • [ ] Targets are generated from approved CI variables.
  • [ ] Custom templates live in the repository.
  • [ ] Scans use rate limits and short retries.
  • [ ] High and critical findings fail the job.
  • [ ] JSONL results are uploaded as artifacts.
  • [ ] Secrets are masked in logs.
  • [ ] Pull request scans are focused.
  • [ ] Nightly scans can be broader.
  • [ ] Template suppressions are reviewed.
  • [ ] The team has an owner for each finding.

Other skills for the same job

different authors, same section of the catalogue
Codebase Cleanup Deps Audit
by ComeOnOliver
×2

You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.

10k tokens
Security Best Practices
by openai
vendor ×1

Perform language and framework specific security best-practice reviews and suggest improvements. Trigger only when the user explicitly requests security best practices guidance, a security review/report, or secure-by-default coding help. Trigger only for supported languages (python, javascript/typescript, go). Do not trigger for general code review, debugging, or non-security tasks.

103k tokens
Better Auth
by mrgoonie
×1

Implement authentication and authorization with Better Auth - a framework-agnostic TypeScript authentication framework. Features include email/password authentication with verification, OAuth providers (Google, GitHub, Discord, etc.), two-factor authentication (TOTP, SMS), passkeys/WebAuthn support, session management, role-based access control (RBAC), rate limiting, and database adapters. Use when adding authentication to applications, implementing OAuth flows, setting up 2FA/MFA, managing user sessions, configuring authorization rules, or building secure authentication systems for web applications.

46k tokens scripts
Repomix
by mrgoonie
×1

Package entire code repositories into single AI-friendly files using Repomix. Capabilities include pack codebases with customizable include/exclude patterns, generate multiple output formats (XML, Markdown, plain text), preserve file structure and context, optimize for AI consumption with token counting, filter by file types and directories, add custom headers and summaries. Use when packaging codebases for AI analysis, creating repository snapshots for LLM context, analyzing third-party libraries, preparing for security audits, generating documentation context, or evaluating unfamiliar codebases.

27k tokens scripts
Dependency Management Deps Audit
by lingxling
×1

You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.

7k tokens
Hubspot Integration
by lingxling
×1

Expert patterns for HubSpot CRM integration including OAuth authentication, CRM objects, associations, batch operations, webhooks, and custom objects. Covers Node.js and Python SDKs.

5k tokens
Security Best Practices
by christophacham
×1

Perform language and framework specific security best-practice reviews and suggest improvements. Use when the user explicitly requests security best practices guidance, a security review or report, or secure-by-default coding help. Supports Python, JavaScript/TypeScript, and Go. Do NOT use for general code review, debugging, threat modeling (use security-threat-model), or non-security tasks.

102k tokens
API Gateway Configuration
by ComeOnOliver
×1

Configures API gateways for routing, authentication, rate limiting, and request transformation in microservice architectures. Use when setting up Kong, Nginx, AWS API Gateway, or Traefik for centralized API management.

525 tokens

How to use it

Copy the folder

Take pramoddutta/nuclei api security scanning from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference brew. Without those the skill loads but fails at the first command.