Skip to main content
Agent skill

Sast Configuration

Configure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or automating code vulnerability detection.

Get started

Get the complete skill folder, including its scripts and reference files.

·

When to use this skill

Use Sast Configuration when an AI agent needs a reusable SKILL.md workflow for this job: Configure Static Application Security Testing (SAST) tools for automated vulnerability detection in application code. Use when setting up security scanning, implementing DevSecOps practices, or automating code vulnerability detection.

When not to use it

Skip Sast Configuration when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
Claude Code folder setup
mkdir -p ~/.claude/skills/sast-configuration
# Save SKILL.md to ~/.claude/skills/sast-configuration/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/sast-configuration/SKILL.md. For a shared project, commit the folder at .claude/skills/sast-configuration/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Sast Configuration skill for this task: Use Sast Configuration when this documented workflow matches the task. Confirm any required inputs or files before making changes.

What supports this recommendation?

77/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
85/100
Practical detail
76/100
Source evidence
63/100
Source signals
80/100
Model compatibility evidence
  • claudeuntested

    No model-specific signal or recorded compatibility test was found.

  • chatgptuntested

    No model-specific signal or recorded compatibility test was found.

  • geminiuntested

    No model-specific signal or recorded compatibility test was found.

  • copilotuntested

    No model-specific signal or recorded compatibility test was found.

  • llamauntested

    No model-specific signal or recorded compatibility test was found.

  • perplexityuntested

    No model-specific signal or recorded compatibility test was found.

  • mistraluntested

    No model-specific signal or recorded compatibility test was found.

  • grokuntested

    No model-specific signal or recorded compatibility test was found.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

# SAST Configuration

Static Application Security Testing (SAST) tool setup, configuration, and custom rule creation for comprehensive security scanning across multiple programming languages.

## Overview

This skill provides comprehensive guidance for setting up and configuring SAST tools including Semgrep, SonarQube, and CodeQL. Use this skill when you need to:

- Set up SAST scanning in CI/CD pipelines - Create custom security rules for your codebase - Configure quality gates and compliance policies - Optimize scan performance and reduce false positives - Integrate multiple SAST tools for defense-in-depth

## Core Capabilities

### 1. Semgrep Configuration

- Custom rule creation with pattern matching - Language-specific security rules (Python, JavaScript, Go, Java, etc.) - CI/CD integration (GitHub Actions, GitLab CI, Jenkins) - False positive tuning and rule optimization - Organizational policy enforcement

### 2. SonarQube Setup

- Quality gate configuration - Security hotspot analysis - Code coverage and technical debt tracking - Custom quality profiles for languages - Enterprise integration with LDAP/SAML

### 3. CodeQL Analysis

- GitHub Advanced Security integration - Custom query development - Vulnerability variant analysis - Security research workflows - SARIF result processing

## Quick Start

### Initial Assessment

1. Identify primary programming languages in your codebase 2. Determine compliance requirements (PCI-DSS, SOC 2, etc.) 3. Choose SAST tool based on language support and integration needs 4. Review baseline scan to understand current security posture

### Basic Setup

```bash # Semgrep quick start pip install semgrep semgrep --config=auto --error

# SonarQube with Docker docker run -d --name sonarqube -p 9000:9000 sonarqube:10.8-community

# CodeQL CLI setup gh extension install github/gh-codeql codeql database create mydb --language=python ```

## Integration Patterns

### CI/CD Pipeline Integration

```yaml # GitHub Actions example - name: Run Semgrep uses: returntocorp/semgrep-action@v1 with: config: >- p/security-audit p/owasp-top-ten ```

### Pre-commit Hook

```bash # .pre-commit-config.yaml - repo: https://github.com/returntocorp/semgrep rev: v1.45.0 hooks: - id: semgrep args: ['--config=auto', '--error'] ```

## Best Practices

1. **Start with Baseline** - Run initial scan to establish security baseline - Prioritize critical and high severity findings - Create remediation roadmap

2. **Incremental Adoption** - Begin with security-focused rules - Gradually add code quality rules - Implement blocking only for critical issues

3. **False Positive Management** - Document legitimate suppressions - Create allow lists for known safe patterns - Regularly review suppressed findings

4. **Performance Optimization** - Exclude test files and generated code - Use incremental scanning for large codebases - Cache scan results in CI/CD

5. **Team Enablement** - Provide security training for developers - Create internal documentation for common patterns - Establish security champions program

## Common Use Cases

### New Project Setup

```bash # Semgrep: install, then run an auto-config scan that exits non-zero on findings pip install semgrep semgrep --config=auto --error

# SonarQube: start a community server for local evaluation, then analyze with sonar-scanner. # SONAR_ES_BOOTSTRAP_CHECKS_DISABLE skips the Elasticsearch host checks for a local try-out; # a real deployment needs vm.max_map_count>=524288 and fs.file-max>=131072 on the host instead. docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:10.8-community ```

### Custom Rule Development

```yaml rules: - id: hardcoded-jwt-secret pattern: jwt.encode($DATA, "...", ...) message: JWT secret should not be hardcoded severity: ERROR ```

### Compliance Scanning

```bash # PCI-DSS focused scan semgrep --config p/pci-dss --json -o pci-scan-results.json ```

## Troubleshooting

### High False Positive Rate

- Review and tune rule sensitivity - Add path filters to exclude test files - Use nostmt metadata for noisy patterns - Create organization-specific rule exceptions

### Performance Issues

- Enable incremental scanning - Parallelize scans across modules - Optimize rule patterns for efficiency - Cache dependencies and scan results

### Integration Failures

- Verify API tokens and credentials - Check network connectivity and proxy settings - Review SARIF output format compatibility - Validate CI/CD runner permissions

## Related Skills

- [STRIDE Analysis Patterns](../stride-analysis-patterns/SKILL.md) - [Threat Mitigation Mapping](../threat-mitigation-mapping/SKILL.md)

## Tool Comparison

| Tool | Best For | Language Support | Cost | Integration | | --------- | ------------------------ | ---------------- | --------------- | ------------- | | Semgrep | Custom rules, fast scans | 30+ languages | Free/Enterprise | Excellent | | SonarQube | Code quality + security | 25+ languages | Free/Commercial | Good | | CodeQL | Deep analysis, research | 10+ languages | Free (OSS) | GitHub native |

## Next Steps

1. Complete initial SAST tool setup 2. Run baseline security scan 3. Create custom rules for organization-specific patterns 4. Integrate into CI/CD pipeline 5. Establish security gate policies 6. Train development team on findings and remediation

Intended uses

  • Use Sast Configuration when this documented workflow matches the task.

Implementation notes

  • Start with Baseline
  • Run initial scan to establish security baseline
  • Prioritize critical and high severity findings
  • Create remediation roadmap
  • Incremental Adoption
  • Begin with security-focused rules
  • Gradually add code quality rules
  • Implement blocking only for critical issues
  • False Positive Management
  • Document legitimate suppressions
  • Create allow lists for known safe patterns
  • Regularly review suppressed findings
  • Performance Optimization
  • Exclude test files and generated code
  • Use incremental scanning for large codebases
  • Cache scan results in CI/CD
  • Team Enablement
  • Provide security training for developers
  • Create internal documentation for common patterns
  • Establish security champions program

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.