/SKILL.md
Correlate SAST findings from SonarQube with DAST findings from SARIF files (StackHawk, ZAP, etc.) and generate a comprehensive security report. Use when the user asks to correlate static and dynamic analysis results, cross-reference SonarQube with SARIF scan outputs, compare SonarQube and StackHawk/ZAP results, or generate a unified security findings report from .sarif files or SonarQube JSON exports.
npx skillsauth add mathiasconradt/sonarqube-sast-dast-correlation sonarqube-sast-dast-correlationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a comprehensive security correlation report that maps SonarQube SAST findings with DAST findings from SARIF files. All files are stored in .sonar/ subdirectory.
Workflow: Check existing report → Gather config (Steps 1-2 in Workflow Steps) → Execute Steps 3-6 below → Generate report → Tag issues (optional)
TRUE correlation: Valid SonarQube issue key (not "N/A"), matching DAST finding, matching category and endpoint. DAST-only findings (no SAST key) go in report Section 5, not tagged.
Tagging workflow (tag: dast-detected):
GET /api/issues/search?tags=dast-detected&additionalFields=comments, then DELETE /api/issues/delete_comment for all comments containing 🔴/🟠/🟡/🔵 or "DAST Correlation"POST /api/issues/remove_tags?tags=dast-detectedPOST /api/issues/set_tags?issue={key}&tags=dast-detected then POST /api/issues/add_comment with {icon} **DAST Correlation - {CONFIDENCE}**📖 Implementation Guide - Step 10 for complete API examples
Fetch issues via SonarQube REST API, filter out imported DAST issues:
mkdir -p .sonar
curl -s -u "$SONAR_TOKEN:" \
"https://sonarqube.example.com/api/issues/search?projectKeys=my-project&ps=500&p=1" \
-o .sonar/sonar_issues.json
jq '[.issues[] | select(.rule | startswith("external_") | not)]' .sonar/sonar_issues.json > .sonar/sast_issues_filtered.json
jq 'length' .sonar/sast_issues_filtered.json
Locate and validate SARIF files:
find . -name "*.sarif" -o -name "*.sarif.json" 2>/dev/null
jq '.runs[0].results | length' path/to/results.sarif
jq '[.runs[0].results[] | {ruleId: .ruleId, uri: .locations[0].physicalLocation.artifactLocation.uri, message: .message.text}]' \
path/to/results.sarif
Match SAST and DAST findings via source code analysis on file/endpoint, vulnerability category, and confidence level. Write to .sonar/correlations.json with valid SAST issue keys only.
jq -n \
--slurpfile sast .sonar/sast_issues_filtered.json \
--slurpfile dast .sonar/dast_findings.json \
'[
$sast[][] as $s |
$dast[][] as $d |
select($s.category == $d.category) |
{sast_key: $s.key, dast_ruleId: $d.ruleId, file: $s.component, url: $d.uri, category: $s.category}
]' > .sonar/candidate_correlations.json
📖 Correlation Analysis for complete rules
jq 'length' .sonar/correlations.json
jq 'group_by(.confidence) | map({confidence: .[0].confidence, count: length})' .sonar/correlations.json
Zero correlations: Stop. Confirm tools scanned same app. LOW confidence only: note in summary, recommend manual review.
Write .sonar/sast-dast-correlation-report.md with sections: Executive Summary, Severity Distribution, Correlated Findings (HIGH PRIORITY), SAST-Only Findings, DAST-Only Findings, Coverage Analysis, Actionable Recommendations.
📖 See Report Template for structure
API unreachable: use existing .sonar/sonar_issues.json. No SARIF: ask for path. Invalid SARIF: validate with jq .runs[0].results. Filter external_* imports. Zero correlations: confirm same app scanned.
All in .sonar/ subdirectory: sonar_issues.json, sast_issues_filtered.json, correlations.json, sast-dast-correlation-report.md. Add .sonar/ to .gitignore.
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).