x-run-dast
Dynamic Application Security Testing -- tests the running application for XSS, injection, misconfiguration, and information disclosure using OWASP ZAP or Nuclei.
- License 许可
- MIT
- 最近更新
- 2026-10-27
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- x-run-dast
- description
- Dynamic Application Security Testing -- tests the running application for XSS, injection, misconfiguration, and information disclosure using OWASP ZAP or Nuclei.
- allowed-tools
- Read, Bash
- argument-hint
- --target <URL> [--env local|dev|homolog|prod] [--mode passive|active|full] [--confirm-prod] [--openapi <path>] [--auth-token <token>]
- user-invocable
- true
- requires-capabilities
- []
02 资源文件 1
- 参考文档README.md1.6 KB
03 SKILL.md 正文
Global Output Policy
- Language: English ONLY.
- Tone: Technical, Direct, and Concise.
- Efficiency: Remove all conversational fillers and greetings to save tokens.
Skill: DAST Scanner
Purpose
Orchestrate Dynamic Application Security Testing against a running application. DAST complements SAST by testing from outside-in, simulating real attacks to detect runtime vulnerabilities that static analysis cannot find: missing security headers, insecure cookies, CORS misconfiguration, injection flaws, and information disclosure.
Activation Condition
Include this skill when security.scanning.dast = true in the project configuration.
Triggers
/x-run-dast --target http://localhost:8080-- scan local app with default passive mode/x-run-dast --target http://localhost:8080 --mode active-- active scan in local/x-run-dast --target https://app.staging.com --env homolog-- scan homolog (auto-downgrades)/x-run-dast --target https://app.example.com --env prod --confirm-prod-- production passive scan
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
--target |
URL | Yes | (none) | Target application URL (http/https) |
--env |
Enum | No | local |
Environment: local, dev, homolog, prod |
--mode |
Enum | No | passive |
Scan mode: passive, active, full |
--confirm-prod |
Flag | No | false |
Required confirmation for production scans |
--openapi |
Path | No | (none) | OpenAPI spec path to expand scan coverage |
--auth-token |
String | No | (none) | Bearer token for authenticated endpoint scanning |
Workflow
Step 1 — Validate Parameters
Verify --target is a valid URL (http/https scheme).
Step 2 — Apply Environment Guard (RULE-004)
| Environment | Passive | Active | Full | Requirements |
|---|---|---|---|---|
| local | Yes | Yes | Yes | None |
| dev | Yes | Yes | Yes | None |
| homolog | Yes | Yes (non-destructive) | No | Full auto-downgrades to active |
| prod | Yes | No | No | Requires --confirm-prod; active/full auto-downgrade to passive |
Guard logic:
- If
--env=prodand--confirm-prodNOT provided: BLOCK scan with error - If
--env=prodand--modeisactiveorfull: AUTO-DOWNGRADE to passive - If
--env=homologand--mode=full: AUTO-DOWNGRADE to active (non-destructive)
Step 3 — Detect Tool
Check for scanning tools in order of preference:
| Priority | Tool | Use Case |
|---|---|---|
| Preferred | OWASP ZAP | Full DAST scanner: passive interception, active scanning, fuzzing, OpenAPI import |
| Fallback | Nuclei | Template-based scanner: fast, targeted checks for known CVEs and misconfigurations |
| Lightweight | nikto | Quick web server misconfiguration checks |
Step 4 — Configure and Execute Scan
Set mode, import OpenAPI spec if provided, configure auth token, and execute.
Step 5 — Parse and Categorize Findings
Extract raw findings from tool output. Map each finding to category:
| Category | Description | OWASP Mapping |
|---|---|---|
| injection | SQL, NoSQL, LDAP, OS command injection | A03:2021 |
| authentication | Weak auth, session fixation, credential exposure | A07:2021 |
| misconfiguration | Missing headers, CORS, TLS issues, verbose errors | A05:2021 |
| info-disclosure | Stack traces, internal paths, version info, debug endpoints | A01:2021 |
Step 6 — Generate SARIF Output
Produce SARIF 2.1.0 compliant output with all findings.
Step 7 — Score and Grade
Start at 100, deduct per finding severity:
| Severity | Deduction |
|---|---|
| CRITICAL | -25 |
| HIGH | -15 |
| MEDIUM | -5 |
| LOW | -2 |
| INFO | 0 |
| Grade | Score Range | Criteria |
|---|---|---|
| A | 90-100 | No CRITICAL or HIGH findings |
| B | 75-89 | No CRITICAL, up to 2 HIGH |
| C | 60-74 | No CRITICAL, 3+ HIGH or 5+ MEDIUM |
| D | 40-59 | 1+ CRITICAL or 5+ HIGH |
| F | 0-39 | Multiple CRITICAL findings |
Step 8 — Generate Report
Produce Markdown summary report with configuration, environment guard, findings by category, OWASP coverage, and recommendations.
Scan Modes
Passive Mode
- Intercepts HTTP responses and analyzes them without sending attack payloads
- Checks: missing security headers, insecure cookies, information disclosure, verbose errors
- Safe for all environments including production
Active Mode
- Sends test payloads to detect injection vulnerabilities
- Checks: SQL injection, XSS (reflected/stored), path traversal, command injection
- NOT safe for production
Full Mode
- Combines passive + active + advanced fuzzing
- Includes: parameter fuzzing, authentication bypass attempts, session management tests
- Only for local and dev environments
Error Handling
| Scenario | Action |
|---|---|
| No DAST tool found | Report error with installation instructions for ZAP, Nuclei, or nikto |
--env=prod without --confirm-prod |
Block scan immediately, no requests sent |
| Target URL unreachable | Report connection failure with target URL |
| Scan timeout | Report partial findings collected so far |
CI Integration
# GitHub Actions example
- name: DAST Scan
run: |
/x-run-dast \
--target ${{ env.APP_URL }} \
--env ${{ env.ENVIRONMENT }} \
--mode passive \
--openapi docs/openapi.yaml
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: dast-report.sarif
04 同仓库更多 Skills
x-parallel-eval
Detects and classifies file-collision risks between work units (tasks, stories, or epic phases) before parallel execution. Reads ## File Footprint blocks produced by x-task-plan / x-story-plan, applies the parallelism-heuristics knowledge pack (hard / regen / soft categories + hotspot overrides), and emits a collision matrix + serialization recommendation in Markdown (default) or JSON.
parallelism-heuristics
Canonical catalog of file-collision heuristics for parallel task, story, and epic execution. Defines the File Footprint block format, the three Conflict Categories (hard / regen / soft), a hotspot list of high-contention paths, and the degrade-with-warning policy. Consumed by x-task-plan, x-story-plan, x-epic-map, x-parallel-eval, and x-dev-*-implement.
x-watch-pr-ci
Polls a PR's CI checks and Copilot review status, blocking until checks complete or timeout. Returns one of 8 stable exit codes (SUCCESS=0, CI_PENDING_PROCEED=10, CI_FAILED=20, TIMEOUT=30, PR_ALREADY_MERGED=40, NO_CI_CONFIGURED=50, PR_CLOSED=60, PR_NOT_FOUND=70). Writes a versioned state-file for session resume.
x-validate-docs
Documentation freshness gate: validates 6 dimensions (readme, api-specs, grpc-proto, adr, skill-docs, system-architecture) against code changes in a PR. Stack-aware — only validates targets declared/auto-detected from ProjectConfig.documentation.targets. Returns exit non-zero on staleness; produces structured report.
x-update-system-architecture
Incrementally updates docs/architecture/system.md after an epic completes. Appends new entries to the Decision Log (§11) using x-internal-write-report --append (dedup by ## ID: marker) and surgically inserts component/integration changes into sections 1-10 via Edit. Idempotent: re-running with the same epic produces a byte-identical system.md.
x-update-architecture
Incrementally updates the service architecture document with changes from architecture plans. Adds new components, integrations, flows, and ADR references without rewriting existing content. Use after implementation to keep architecture documentation current.