SAST Setup & Tuning (Semgrep / SonarQube / CodeQL)

    by Mr Vempire

    1

    Baseline, tune, and gate SAST scanners to eliminate noise and block real security flaws in CI.

    $10

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    SAST Setup & Tuning (Semgrep / SonarQube / CodeQL)

    Example session with this skill installed

    Baseline our Python repo with Semgrep. It is currently throwing 400 findings, mostly in the migrations and tests folders. We need a tuned config and a gate report.

    • Read your context and instructions
    • Compiled the sast setup

    I have completed the baseline scan and tuning for the Python repository. I identified that 65% of the findings were located in migrations/ and tests/, which have now been excluded. After triaging a sample of 30 findings, I disabled 3 high-noise rules with false-positive rates above 80% and promoted SQL injection checks to blocking severity.

    Tuned SAST Gate Report

    MetricBaseline (Untuned)Tuned Result
    Total Findings41284
    Findings per 1k LoC18.43.7
    False Positive Rate (Sample)72%12%
    CI Gate StatusFAILPASS

    Rule Enforcement Decisions

    • Excluded Paths: **/migrations/*, **/tests/*, **/venv/*.
    • Promoted to ERROR: python.sqlalchemy.security.sqlalchemy-execute-variables, python.lang.security.audit.dangerous-subprocess-use-audit.
    • Disabled: python.django.security.audit.xss.direct-usage-with-safe (Reason: 14 findings in sample, 13 were false positives in template fragments).
    • Demoted to WARNING: python.lang.maintainability.is-literal-too-long.

    Tuned Configuration (semgrep.yaml)

    rules:
      - id: python-sqli-blocking
        pattern: $DB.execute(..., $VAR)
        message: Potential SQL Injection detected.
        severity: ERROR
        languages: [python]
      - id: secrets-check
        pattern-regex: "(?i)password\\s*=\\s*['\"](?P<password>[^'\"]+)['\"]"
        message: Hardcoded credential found.
        severity: ERROR
        languages: [python]
    

    Next steps

    1. Commit the semgrep.yaml and .semgrepignore files to the root directory.
    2. Update your GitHub Actions workflow using the provided ci-gate.yml template.
    3. Monitor the gate in warn-only mode for 7 days before switching to blocking.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Security tools often flood developers with false positives, leading teams to ignore or disable scanners entirely. This skill implements a systematic process to silence the noise, baseline your codebase, and implement a CI gate that only blocks on real issues.

    What it does

    • Baseline measurement runs a default scan to quantify noise, identify high-volume rules, and calculate findings per 1,000 lines of code.
    • Scope optimization filters out noise by excluding test fixtures, generated code, migrations, and vendored assets from the scan path.
    • Rule curation selects language-specific rulesets and justifies every deactivation with sampled evidence and measured false-positive rates.
    • Severity tuning promotes high-signal rules like SQL injection to blocking status while demoting style nits to non-blocking warnings.
    • CI gate integration configures diff-aware gating so that legacy debt does not block new pull requests.
    • Audit reporting generates a structured gate report documenting enforcement decisions, threshold logic, and pass/fail verdicts.

    How it works

    1. Run a baseline scan using Semgrep, SonarQube, or CodeQL to identify the noisiest rules and triage a sample of findings.
    2. Apply exclusions for non-production code and generated files using tool-specific ignore configurations.
    3. Use the provided templates to curate a ruleset, promoting high-signal rules and documenting justifications for any disabled checks.
    4. Deploy a diff-aware CI workflow that gates pull requests based on new findings in changed lines only.

    Frameworks & tools

    This skill supports Semgrep, SonarQube, and CodeQL. It includes configuration templates for GitHub Actions and Python scripts for processing JSON or SARIF output into markdown reports.

    Why this beats prompting it yourself

    Generic prompts often result in a "turn everything on" approach that kills developer productivity with noise. This skill follows a specific measurement-first methodology that requires evidence for every rule change, ensuring your security gate is defensible and sustainable.

    Use cases

    • Tuning a noisy Semgrep installation that developers are currently ignoring.
    • Setting up a CodeQL security-and-quality gate for a new TypeScript project.
    • Reducing SonarQube false positives in a legacy Python codebase with many test fixtures.
    • Creating a standardized SAST gate report for a security compliance audit.

    Known limitations

    Does not prove exploitability or replace manual code review. Requires the codebase to be in a buildable state for deep data-flow analysis tools like CodeQL.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed5 days ago

    What's inside

    Creator

    Mr Vempire

    Mr Vempire

    32 skills on Agensi

    Frequently Asked Questions

    The skill provides a systematic framework to reduce false positives by baselining existing debt, excluding non-production code (like test fixtures), and curating rules based on actual signal-to-noise ratios.

    It is compatible with Semgrep, SonarQube, and CodeQL, providing specific configuration templates and processing scripts for each tool's JSON or SARIF output.

    You receive specialized configuration templates for GitHub Actions, Python-based reporting scripts for SARIF data, and the structured measurement-first methodology for tuning rulesets.

    No, the skill implements diff-aware gating, which ensures that only new security flaws introduced in a pull request block the build, rather than flagging legacy code.

    The skill is designed to run within modern CI/CD environments like GitHub Actions and works alongside AI agents capable of executing Python scripts or managing YAML configurations.

    While the skill automates noise reduction and reporting, it does not replace manual code review or prove exploitability; it focuses on making automated scanners defensible and productive.

    New in Code Quality & Review

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.