jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ SAST設定

sast-configuration

静的アプリケーションセキュリティテスト(SAST)ツールの設定やカスタムルール作成を通じて、多言語に対応した包括的なセキュリティスキャンを可能にするSkill。

⏱ MCPサーバー実装 1日 → 2時間

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

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

🇯🇵 日本人クリエイター向け解説

一言でいうと

静的アプリケーションセキュリティテスト(SAST)ツールの設定やカスタムルール作成を通じて、多言語に対応した包括的なセキュリティスキャンを可能にするSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o sast-configuration.zip https://jpskill.com/download/3407.zip && unzip -o sast-configuration.zip && rm sast-configuration.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3407.zip -OutFile "$d\sast-configuration.zip"; Expand-Archive "$d\sast-configuration.zip" -DestinationPath $d -Force; ri "$d\sast-configuration.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して sast-configuration.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → sast-configuration フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Sast Configuration を使って、最小構成のサンプルコードを示して
  • Sast Configuration の主な使い方と注意点を教えて
  • Sast Configuration を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] sast-configuration

SAST 設定

複数のプログラミング言語にわたる包括的なセキュリティスキャンを実現するための、静的アプリケーションセキュリティテスト (SAST) ツールのセットアップ、設定、およびカスタムルールの作成について説明します。

このスキルを使用する場面

  • CI/CD パイプラインで SAST スキャンを設定する場合
  • コードベース用のカスタムセキュリティルールを作成する場合
  • 品質ゲートとコンプライアンスポリシーを設定する場合
  • スキャンパフォーマンスを最適化し、誤検知を減らす場合
  • 多層防御のために複数の SAST ツールを統合する場合

このスキルを使用しない場面

  • DAST または手動による侵入テストのガイダンスのみが必要な場合
  • ソースコードまたは CI/CD パイプラインにアクセスできない場合
  • ツール設定ではなく、組織のポリシー決定が必要な場合

手順

  1. 言語、リポジトリ、およびコンプライアンス要件を特定します。
  2. ツールを選択し、ベースラインポリシーを定義します。
  3. ゲーティングしきい値を使用して、スキャンを CI/CD に統合します。
  4. 誤検知に基づいてルールと抑制を調整します。
  5. 修正を追跡し、修正を検証します。

安全性

  • 承認なしに、機密性の高いリポジトリをサードパーティサービスでスキャンすることは避けてください。
  • スキャン成果物やログでのシークレットの漏洩を防ぎます。

概要

このスキルは、Semgrep、SonarQube、CodeQL などの SAST ツールのセットアップと設定に関する包括的なガイダンスを提供します。

コア機能

1. Semgrep 設定

  • パターンマッチングによるカスタムルール作成
  • 言語固有のセキュリティルール (Python、JavaScript、Go、Java など)
  • CI/CD 統合 (GitHub Actions、GitLab CI、Jenkins)
  • 誤検知の調整とルール最適化
  • 組織ポリシーの強制

2. SonarQube セットアップ

  • 品質ゲート設定
  • セキュリティホットスポット分析
  • コードカバレッジと技術的負債の追跡
  • 言語用のカスタム品質プロファイル
  • LDAP/SAML とのエンタープライズ統合

3. CodeQL 分析

  • GitHub Advanced Security 統合
  • カスタムクエリ開発
  • 脆弱性バリアント分析
  • セキュリティ研究ワークフロー
  • SARIF 結果処理

クイックスタート

初期評価

  1. コードベースの主要なプログラミング言語を特定します
  2. コンプライアンス要件 (PCI-DSS、SOC 2 など) を決定します
  3. 言語サポートと統合ニーズに基づいて SAST ツールを選択します
  4. 現在のセキュリティ体制を理解するためにベースラインスキャンをレビューします

基本設定

# Semgrep クイックスタート
pip install semgrep
semgrep --config=auto --error

# Docker を使用した SonarQube
docker run -d --name sonarqube -p 9000:9000 sonarqube:latest

# CodeQL CLI セットアップ
gh extension install github/gh-codeql
codeql database create mydb --language=python

参考資料

  • Semgrep Rule Creation - パターンベースのセキュリティルール開発
  • SonarQube Configuration - 品質ゲートとプロファイル
  • CodeQL Setup Guide - クエリ開発とワークフロー

テンプレートとアセット

  • semgrep-config.yml - 本番環境対応の Semgrep 設定
  • sonarqube-settings.xml - SonarQube 品質プロファイルテンプレート
  • run-sast.sh - 自動 SAST 実行スクリプト

統合パターン

CI/CD パイプライン統合

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

プリコミットフック

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

ベストプラクティス

  1. ベースラインから始める

    • セキュリティベースラインを確立するために初期スキャンを実行します
    • 重大度が高い、またはクリティカルな検出結果を優先します
    • 修正ロードマップを作成します
  2. 段階的な導入

    • セキュリティに焦点を当てたルールから始めます
    • コード品質ルールを徐々に追加します
    • クリティカルな問題に対してのみブロックを実装します
  3. 誤検知管理

    • 正当な抑制を文書化します
    • 既知の安全なパターンに対して許可リストを作成します
    • 抑制された検出結果を定期的にレビューします
  4. パフォーマンス最適化

    • テストファイルと生成されたコードを除外します
    • 大規模なコードベースには増分スキャンを使用します
    • CI/CD でスキャン結果をキャッシュします
  5. チームの有効化

    • 開発者向けにセキュリティトレーニングを提供します
    • 一般的なパターンに関する内部ドキュメントを作成します
    • セキュリティチャンピオンプログラムを確立します

一般的なユースケース

新規プロジェクトのセットアップ

./scripts/run-sast.sh --setup --language python --tools semgrep,sonarqube

カスタムルール開発

# 詳細な例については references/semgrep-rules.md を参照してください
rules:
  - id: hardcoded-jwt-secret
    pattern: jwt.encode($DATA, "...", ...)
    message: JWT secret should not be hardcoded
    severity: ERROR

コンプライアンススキャン

# PCI-DSS に焦点を当てたスキャン
semgrep --config p/pci-dss --json -o pci-scan-results.json

トラブルシューティング

高い誤検知率

  • ルールの感度をレビューし、調整します
  • テストファイルを除外するためにパスフィルターを追加します
  • ノイズの多いパターンには nostmt メタデータを使用します
  • 組織固有のルール例外を作成します

パフォーマンスの問題

  • 増分スキャンを有効にします
  • モジュール間でスキャンを並列化します
  • 効率のためにルールパターンを最適化します
  • 依存関係とスキャン結果をキャッシュします

統合の失敗

  • API トークンと資格情報を確認します
  • ネットワーク接続とプロキシ設定を確認します
  • SARIF 出力形式の互換性をレビューします
  • CI/CD ランナーの権限を検証します

関連スキル

  • OWASP Top 10 チェックリスト
  • コンテナセキュリティ
  • 依存関係スキャン

ツール比較

ツール 最適な用途 言語サポート コスト 統合
Semgrep カスタムルール、高速スキャン 30以上の言語 無料/エンタープライズ 非常に良い
SonarQube コード品質 + セキュリティ 25以上の言語 無料/商用 良い
CodeQL 詳細分析、研究 10以上の言語 無料 (OSS) GitHub ネイティブ

次のステップ

  1. 初期 SAST ツール設定を完了します
  2. ベースラインセキュリティスキャンを実行します
  3. 組織固有のパターンに対してカスタムルールを作成します
  4. CI/CD パイプラインに統合します
  5. セキュリティゲートポリシーを確立します
  6. 開発チームに検出結果と修正についてトレーニングします

制限事項

  • このスキルは、ta の場合にのみ使用してください

(原文がここで切り詰められています)

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

SAST Configuration

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

Use this skill when

  • 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

Do not use this skill when

  • You only need DAST or manual penetration testing guidance
  • You cannot access source code or CI/CD pipelines
  • You need organizational policy decisions rather than tooling setup

Instructions

  1. Identify languages, repos, and compliance requirements.
  2. Choose tools and define a baseline policy.
  3. Integrate scans into CI/CD with gating thresholds.
  4. Tune rules and suppressions based on false positives.
  5. Track remediation and verify fixes.

Safety

  • Avoid scanning sensitive repos with third-party services without approval.
  • Prevent leaks of secrets in scan artifacts and logs.

Overview

This skill provides comprehensive guidance for setting up and configuring SAST tools including Semgrep, SonarQube, and CodeQL.

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

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

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

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

Reference Documentation

  • Semgrep Rule Creation - Pattern-based security rule development
  • SonarQube Configuration - Quality gates and profiles
  • CodeQL Setup Guide - Query development and workflows

Templates & Assets

  • semgrep-config.yml - Production-ready Semgrep configuration
  • sonarqube-settings.xml - SonarQube quality profile template
  • run-sast.sh - Automated SAST execution script

Integration Patterns

CI/CD Pipeline Integration

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

Pre-commit Hook

# .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

./scripts/run-sast.sh --setup --language python --tools semgrep,sonarqube

Custom Rule Development

# See references/semgrep-rules.md for detailed examples
rules:
  - id: hardcoded-jwt-secret
    pattern: jwt.encode($DATA, "...", ...)
    message: JWT secret should not be hardcoded
    severity: ERROR

Compliance Scanning

# 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

  • OWASP Top 10 Checklist
  • Container Security
  • Dependency Scanning

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

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.