sast-semgrep
БесплатноБез исполняемых скриптовНе проверенStatic application security testing (SAST) using Semgrep for vulnerability detection, security code review, and secure coding guidance with OWASP and CWE…
Об этом скилле
SAST with Semgrep
Overview
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.
Quick Start
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
Core Workflows
Workflow 1: Initial Security Scan
- Identify the primary languages in the codebase
- Run
scripts/semgrep_scan.pywith appropriate rulesets - Parse findings and categorize by severity (CRITICAL, HIGH, MEDIUM, LOW)
- Map findings to OWASP Top 10 and CWE categories
- Generate prioritized remediation report
Workflow 2: Security Code Review
- For pull requests or commits, run targeted scans on changed files
- Use
semgrep --diffto scan only modified code - Flag high-severity findings as blocking issues
- Provide inline remediation guidance from
references/remediation_guide.md - Link findings to secure coding patterns
Workflow 3: Custom Rule Development
- Identify organization-specific security patterns to detect
- Create custom Semgrep rules in YAML format using
assets/rule_template.yaml - Test rules against known vulnerable code samples
- Integrate custom rules into CI/CD pipeline
- Document rules in
references/custom_rules.md
Workflow 4: CI/CD Integration
- Add Semgrep to CI/CD pipeline using
assets/ci_config_examples/ - Configure baseline scanning for pull requests
- Set severity thresholds (fail on CRITICAL/HIGH)
- Generate SARIF output for security dashboards
- Track metrics: vulnerabilities found, fix rate, false positives
Security Considerations
Sensitive Data Handling: Semgrep scans code locally; ensure scan results don't leak secrets or proprietary code patterns. Use
--max-lines-per-findingto 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=autofor balanced detection. For security-critical applications, use--config="p/security-audit"for comprehensive coverage.
Language Support
Semgrep supports 30+ languages including:
- Web: JavaScript, TypeScript, Python, Ruby, PHP, Java, C#, Go
- Mobile: Swift, Kotlin, Java (Android)
- Infrastructure: Terraform, Dockerfile, YAML, JSON
- Other: C, C++, Rust, Scala, Solidity
Bundled Resources
Scripts
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
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 rulesets
Assets
assets/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
Common Patterns
Pattern 1: Daily Security Baseline Scan
# Run comprehensive scan and generate report
scripts/semgrep_scan.py --config security-audit \
--output results.json \
--format json \
--severity HIGH CRITICAL
Pattern 2: Pull Request Security Gate
# Scan only changed files, fail on HIGH/CRITICAL
scripts/diff_scan.sh --fail-on high \
--base-branch main \
--output sarif
Pattern 3: Vulnerability Research
# Search for specific vulnerability patterns
semgrep --config "r/javascript.lang.security.audit.xss" \
--json /path/to/code | jq '.results'
Pattern 4: Custom Rule Validation
# Test custom rule against vulnerable samples
semgrep --config assets/custom_rules.yaml \
--test tests/vulnerable_samples/
Integration Points
CI/CD Integration
- GitHub Actions: Use
semgrep/semgrep-action@v1with SARIF upload - GitLab CI: Run as security scanning job with artifact reports
- Jenkins: Execute as build step with quality gate integration
- pre-commit hooks: Run lightweight scans on staged files
See assets/ci_config_examples/ for ready-to-use configurations.
Security Tool Integration
- SIEM/SOAR: Export findings in JSON/SARIF for ingestion
- Vulnerability Management: Integrate with
Установить sast-semgrep в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл sast-semgrep?
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.
Как установить скилл sast-semgrep?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sast-semgrep запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic