skills/agentsecops/sast-semgrep/SKILL.md
Static application security testing (SAST) using Semgrep for vulnerability detection, security code review, and secure coding guidance with OWASP and CWE framework mapping. Use when: (1) Scanning code for security vulnerabilities across multiple languages, (2) Performing security code reviews with pattern-based detection, (3) Integrating SAST checks into CI/CD pipelines, (4) Providing remediation guidance with OWASP Top 10 and CWE mappings, (5) Creating custom security rules for organization-specific patterns, (6) Analyzing dependencies for known vulnerabilities.
npx skillsauth add aiskillstore/marketplace sast-semgrepInstall 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.
Perform comprehensive static application security testing using Semgrep, a fast, open-source static analysis tool. This skill provides automated vulnerability detection, security code review workflows, and remediation guidance mapped to OWASP Top 10 and CWE standards.
Scan a codebase for security vulnerabilities:
semgrep --config=auto --severity=ERROR --severity=WARNING /path/to/code
Run with OWASP Top 10 ruleset:
semgrep --config="p/owasp-top-ten" /path/to/code
scripts/semgrep_scan.py with appropriate rulesetssemgrep --diff to scan only modified codereferences/remediation_guide.mdassets/rule_template.yamlreferences/custom_rules.mdassets/ci_config_examples/Sensitive Data Handling: Semgrep scans code locally; ensure scan results don't leak
secrets or proprietary code patterns. Use --max-lines-per-finding to limit output.
Access Control: Semgrep scans require read access to source code. Restrict scan result access to authorized security and development teams.
Audit Logging: Log all scan executions with timestamps, user, commit hash, and findings count for compliance auditing.
Compliance: SAST scanning supports SOC2, PCI-DSS, and GDPR compliance requirements. Maintain scan history and remediation tracking.
Safe Defaults: Use --config=auto for balanced detection. For security-critical
applications, use --config="p/security-audit" for comprehensive coverage.
Semgrep supports 30+ languages including:
scripts/semgrep_scan.py - Full-featured scanning with OWASP/CWE mapping and reportingscripts/baseline_scan.sh - Quick baseline scan for CI/CDscripts/diff_scan.sh - Scan only changed files (for PRs)references/owasp_cwe_mapping.md - OWASP Top 10 to CWE mapping with Semgrep rulesreferences/remediation_guide.md - Vulnerability remediation patterns by categoryreferences/rule_library.md - Curated list of useful Semgrep rulesetsassets/rule_template.yaml - Template for creating custom Semgrep rulesassets/ci_config_examples/ - CI/CD integration examples (GitHub Actions, GitLab CI)assets/semgrep_config.yaml - Recommended Semgrep configuration# Run comprehensive scan and generate report
scripts/semgrep_scan.py --config security-audit \
--output results.json \
--format json \
--severity HIGH CRITICAL
# Scan only changed files, fail on HIGH/CRITICAL
scripts/diff_scan.sh --fail-on high \
--base-branch main \
--output sarif
# Search for specific vulnerability patterns
semgrep --config "r/javascript.lang.security.audit.xss" \
--json /path/to/code | jq '.results'
# Test custom rule against vulnerable samples
semgrep --config assets/custom_rules.yaml \
--test tests/vulnerable_samples/
semgrep/semgrep-action@v1 with SARIF uploadSee assets/ci_config_examples/ for ready-to-use configurations.
Semgrep findings are classified by severity:
For large codebases:
# Use --jobs for parallel scanning
semgrep --config auto --jobs 4
# Exclude vendor/test code
semgrep --config auto --exclude "vendor/" --exclude "test/"
# Use lightweight rulesets for faster feedback
semgrep --config "p/owasp-top-ten" --exclude-rule "generic.*"
Solution:
--exclude-rule to disable noisy rules.semgrepignore file to exclude false positive patterns--severity filtering# nosemgrep comments for confirmed false positives (with justification)Solution:
--exclude for vendor/generated code--jobs for parallel processing--config=auto--diffSolution:
p/security-audit or p/owasp-top-tenreferences/rule_library.md for specialized rulesSee references/rule_library.md for guidance on writing effective Semgrep rules.
Use assets/rule_template.yaml as a starting point.
Example rule structure:
rules:
- id: custom-sql-injection
patterns:
- pattern: execute($QUERY)
- pattern-inside: |
$QUERY = $USER_INPUT + ...
message: Potential SQL injection from user input concatenation
severity: ERROR
languages: [python]
metadata:
cwe: "CWE-89"
owasp: "A03:2021-Injection"
This skill provides detection for all OWASP Top 10 2021 categories.
See references/owasp_cwe_mapping.md for complete coverage matrix.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.