jpskill.com
🛠️ 開発・MCP コミュニティ

detection-sigma

Sigmaという汎用的なSIEMルール形式を用いて、セキュリティ監視のための検出ルールを作成したり、異なるSIEMプラットフォーム間でルールを変換したり、脅威ハンティングを効率化したりするSkill。

📜 元の英語説明(参考)

Generic detection rule creation and management using Sigma, the universal SIEM rule format. Sigma provides vendor-agnostic detection logic for log analysis across multiple SIEM platforms. Use when: (1) Creating detection rules for security monitoring, (2) Converting rules between SIEM platforms (Splunk, Elastic, QRadar, Sentinel), (3) Threat hunting with standardized detection patterns, (4) Building detection-as-code pipelines, (5) Mapping detections to MITRE ATT&CK tactics, (6) Implementing compliance-based monitoring rules.

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

一言でいうと

Sigmaという汎用的なSIEMルール形式を用いて、セキュリティ監視のための検出ルールを作成したり、異なるSIEMプラットフォーム間でルールを変換したり、脅威ハンティングを効率化したりするSkill。

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

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

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

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

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

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して detection-sigma.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → detection-sigma フォルダができる
  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-18
取得日時
2026-05-18
同梱ファイル
13

📖 Skill本文(日本語訳)

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

Sigma Detection Engineering

概要

Sigma はログ検出における Snort がネットワークトラフィックに、YARA がファイルに対するものと同様の役割を果たすもので、セキュリティ関連のログイベントを記述するための普遍的なシグネチャ形式です。このスキルは、複数の SIEM プラットフォームに展開するための Sigma ルールの作成、検証、変換を支援し、detection-as-code のワークフローを可能にします。

主な機能:

  • Sigma 形式を使用した検出ルールの作成
  • 25 以上の SIEM/EDR バックエンド (Splunk、Elastic、QRadar、Sentinel など) へのルール変換
  • ルールの構文とロジックの検証
  • MITRE ATT&CK フレームワークへの検出のマッピング
  • 脅威ハンティングクエリの構築
  • コンプライアンスに基づいた監視の実装

クイックスタート

依存関係のインストール

pip install pysigma pysigma-backend-splunk pysigma-backend-elasticsearch pyyaml

基本的な Sigma ルールの作成

title: Suspicious PowerShell Execution
id: 7d6d30b8-5b91-4b90-a71e-4f5a3f5a3c3f
status: experimental
description: Detects suspicious PowerShell execution with encoded commands
references:
    - https://attack.mitre.org/techniques/T1059/001/
author: Your Name
date: YYYY/MM/DD
modified: YYYY/MM/DD
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\powershell.exe'
        CommandLine|contains:
            - '-enc'
            - '-EncodedCommand'
            - 'FromBase64String'
    condition: selection
falsepositives:
    - Legitimate administrative scripts
level: medium

ターゲット SIEM へのルール変換

# Splunk への変換
python scripts/sigma_convert.py rule.yml --backend splunk

# Elasticsearch への変換
python scripts/sigma_convert.py rule.yml --backend elasticsearch

# Microsoft Sentinel への変換
python scripts/sigma_convert.py rule.yml --backend sentinel

主要なワークフロー

ワークフロー 1: 検出ルール開発

進捗状況: [ ] 1. 脅威インテリジェンスまたはコンプライアンスから検出要件を特定する [ ] 2. ターゲット環境のログソースとフィールドマッピングを調査する [ ] 3. 標準テンプレートを使用して Sigma ルールを作成する [ ] 4. ルール構文を検証する: python scripts/sigma_validate.py rule.yml [ ] 5. サンプルログまたは履歴データに対してルールをテストする [ ] 6. ターゲット SIEM 形式に変換する [ ] 7. 誤検知率に基づいてデプロイおよび調整する [ ] 8. ルールメタデータと MITRE ATT&CK マッピングを文書化する

各ステップを体系的に進めてください。完了した項目をチェックしてください。

ワークフロー 2: 脅威ハンティングルールの作成

TTP に基づいたプロアクティブな脅威ハンティングの場合:

  1. MITRE ATT&CK Technique の選択

    • 関連する TTP について脅威インテリジェンスを確認する
    • 手法 ID (例: T1059.001 - PowerShell) を特定する
    • 一般的な手法については、references/mitre-attack-mapping.md を参照してください
  2. ログソースの特定

    • どのログがその手法をキャプチャするかを判断する
    • ログソースカテゴリ (process_creation、network_connection、file_event) をマッピングする
    • 環境内でログソースが利用可能であることを確認する
  3. 検出ロジックの定義

    • 疑わしいパターンに一致する選択基準を作成する
    • 誤検知を減らすためのフィルタを追加する
    • ロバストなマッチングのためにフィールド修飾子 (endswith、contains、re) を使用する
  4. 検証とテスト

    • 検証を実行する: python scripts/sigma_validate.py hunting-rule.yml
    • 既知の良性のサンプルと悪性のサンプルに対してテストする
    • 結果に基づいて検出ロジックを調整する
  5. 文書化とデプロイ

    • 脅威レポートへの参照を追加する
    • 誤検知のシナリオを文書化する
    • 変換して本番 SIEM にデプロイする

ワークフロー 3: 一括ルール変換

SIEM プラットフォーム間を移行する場合:

# まずすべてのルールを検証する
python scripts/sigma_validate.py --directory rules/ --report validation-report.json

# ルールセット全体を変換する
python scripts/sigma_convert.py --directory rules/ --backend splunk --output converted/

# デプロイメントレポートを生成する
python scripts/sigma_convert.py --directory rules/ --backend splunk --report conversion-report.md

変換レポートを確認して、以下を確認してください。

  • 正常に変換されたルール
  • 手動調整が必要なルール
  • サポートされていないフィールドマッピング
  • バックエンド固有の制限事項

ワークフロー 4: コンプライアンスに基づいた検出

コンプライアンス監視 (PCI-DSS、NIST、ISO 27001) を実装する場合:

  1. 要件を検出にマッピングする

  2. 検出ルールの作成

    • assets/compliance-rules/ のコンプライアンスルールテンプレートを使用する
    • コンプライアンスフレームワークでルールをタグ付けする (例: tags: [pci-dss.10.2.5])
    • 適切な重大度レベルを設定する
  3. カバレッジの検証

    • 実行: python scripts/compliance_coverage.py --framework pci-dss
    • カバレッジのギャップを確認する
    • 必要に応じて追加のルールを作成する
  4. コンプライアンスレポートの生成

    • 制御による検出カバレッジを文書化する
    • サンプルクエリと予想されるアラートを含める
    • コンプライアンスエビデンスの監査証跡を維持する

ルール構造リファレンス

必須フィールド

title: Human-readable rule name
id: UUID (generate with: python -c "import uuid; print(uuid.uuid4())")
status: stable|test|experimental|deprecated
description: Detailed description of what this detects
author: Your Name
date: YYYY/MM/DD
modified: YYYY/MM/DD
logsource:
    category: process_creation|network_connection|file_event|...
    product: windows|linux|macos|azure|aws|...
detection:
    selection:
        FieldName: value
    condition: selection
level: informational|low|medium|high|critical

オプションフィールド

references:
    - https://attack.mitre.org/techniques/T1059/
tags:
    - attack.execution
    - attack.t1059.001
falsepositives:
    - Legitimate use cases
fields:
    - CommandLine
    - User
    - ParentImage

検出条件

# 単純な選択
detection:
    selection:
        Field: value
    condition: selection

# 複数の条件 (AND)
detection:
    selection:
        Fie
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Sigma Detection Engineering

Overview

Sigma is to log detection what Snort is to network traffic and YARA is to files - a universal signature format for describing security-relevant log events. This skill helps create, validate, and convert Sigma rules for deployment across multiple SIEM platforms, enabling detection-as-code workflows.

Core capabilities:

  • Create detection rules using Sigma format
  • Convert rules to 25+ SIEM/EDR backends (Splunk, Elastic, QRadar, Sentinel, etc.)
  • Validate rule syntax and logic
  • Map detections to MITRE ATT&CK framework
  • Build threat hunting queries
  • Implement compliance-based monitoring

Quick Start

Install Dependencies

pip install pysigma pysigma-backend-splunk pysigma-backend-elasticsearch pyyaml

Create a Basic Sigma Rule

title: Suspicious PowerShell Execution
id: 7d6d30b8-5b91-4b90-a71e-4f5a3f5a3c3f
status: experimental
description: Detects suspicious PowerShell execution with encoded commands
references:
    - https://attack.mitre.org/techniques/T1059/001/
author: Your Name
date: YYYY/MM/DD
modified: YYYY/MM/DD
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith: '\powershell.exe'
        CommandLine|contains:
            - '-enc'
            - '-EncodedCommand'
            - 'FromBase64String'
    condition: selection
falsepositives:
    - Legitimate administrative scripts
level: medium

Convert Rule to Target SIEM

# Convert to Splunk
python scripts/sigma_convert.py rule.yml --backend splunk

# Convert to Elasticsearch
python scripts/sigma_convert.py rule.yml --backend elasticsearch

# Convert to Microsoft Sentinel
python scripts/sigma_convert.py rule.yml --backend sentinel

Core Workflows

Workflow 1: Detection Rule Development

Progress: [ ] 1. Identify detection requirement from threat intelligence or compliance [ ] 2. Research log sources and field mappings for target environment [ ] 3. Create Sigma rule using standard template [ ] 4. Validate rule syntax: python scripts/sigma_validate.py rule.yml [ ] 5. Test rule against sample logs or historical data [ ] 6. Convert to target SIEM format [ ] 7. Deploy and tune based on false positive rate [ ] 8. Document rule metadata and MITRE ATT&CK mapping

Work through each step systematically. Check off completed items.

Workflow 2: Threat Hunting Rule Creation

For proactive threat hunting based on TTPs:

  1. Select MITRE ATT&CK Technique

  2. Identify Log Sources

    • Determine which logs capture the technique
    • Map log source categories (process_creation, network_connection, file_event)
    • Verify log source availability in your environment
  3. Define Detection Logic

    • Create selection criteria matching suspicious patterns
    • Add filters to reduce false positives
    • Use field modifiers for robust matching (endswith, contains, re)
  4. Validate and Test

    • Run validation: python scripts/sigma_validate.py hunting-rule.yml
    • Test against known-good and known-bad samples
    • Tune detection logic based on results
  5. Document and Deploy

    • Add references to threat reports
    • Document false positive scenarios
    • Convert and deploy to production SIEM

Workflow 3: Bulk Rule Conversion

When migrating between SIEM platforms:

# Validate all rules first
python scripts/sigma_validate.py --directory rules/ --report validation-report.json

# Convert entire rule set
python scripts/sigma_convert.py --directory rules/ --backend splunk --output converted/

# Generate deployment report
python scripts/sigma_convert.py --directory rules/ --backend splunk --report conversion-report.md

Review conversion report for:

  • Successfully converted rules
  • Rules requiring manual adjustment
  • Unsupported field mappings
  • Backend-specific limitations

Workflow 4: Compliance-Based Detection

For implementing compliance monitoring (PCI-DSS, NIST, ISO 27001):

  1. Map Requirements to Detections

  2. Create Detection Rules

    • Use compliance rule templates from assets/compliance-rules/
    • Tag rules with compliance framework (e.g., tags: [pci-dss.10.2.5])
    • Set appropriate severity levels
  3. Validate Coverage

    • Run: python scripts/compliance_coverage.py --framework pci-dss
    • Review coverage gaps
    • Create additional rules as needed
  4. Generate Compliance Report

    • Document detection coverage by control
    • Include sample queries and expected alerts
    • Maintain audit trail for compliance evidence

Rule Structure Reference

Required Fields

title: Human-readable rule name
id: UUID (generate with: python -c "import uuid; print(uuid.uuid4())")
status: stable|test|experimental|deprecated
description: Detailed description of what this detects
author: Your Name
date: YYYY/MM/DD
modified: YYYY/MM/DD
logsource:
    category: process_creation|network_connection|file_event|...
    product: windows|linux|macos|azure|aws|...
detection:
    selection:
        FieldName: value
    condition: selection
level: informational|low|medium|high|critical

Optional Fields

references:
    - https://attack.mitre.org/techniques/T1059/
tags:
    - attack.execution
    - attack.t1059.001
falsepositives:
    - Legitimate use cases
fields:
    - CommandLine
    - User
    - ParentImage

Detection Conditions

# Simple selection
detection:
    selection:
        Field: value
    condition: selection

# Multiple conditions (AND)
detection:
    selection:
        Field1: value1
        Field2: value2
    condition: selection

# OR conditions
detection:
    selection1:
        Field: value1
    selection2:
        Field: value2
    condition: selection1 or selection2

# NOT conditions
detection:
    selection:
        Field: suspicious_value
    filter:
        Field: legitimate_value
    condition: selection and not filter

# Complex logic
detection:
    selection:
        EventID: 4688
    suspicious_cmd:
        CommandLine|contains:
            - 'powershell'
            - 'cmd.exe'
    filter_legitimate:
        ParentImage|endswith: '\explorer.exe'
    condition: selection and suspicious_cmd and not filter_legitimate

Field Modifiers

Common modifiers for flexible matching:

  • |contains - Contains substring (case-insensitive)
  • |endswith - Ends with string
  • |startswith - Starts with string
  • |re - Regular expression match
  • |all - All values must match
  • |base64 - Base64-encoded value matching
  • |base64offset - Base64 with offset variations

Example:

detection:
    selection:
        CommandLine|contains|all:
            - 'powershell'
            - '-enc'
        Image|endswith: '\powershell.exe'

Security Considerations

  • Sensitive Data Handling: Sigma rules may reference sensitive field names or patterns. Store rules in version control with appropriate access controls. Avoid including actual sensitive data in example values.

  • Access Control: Detection rules reveal defensive capabilities to adversaries. Implement role-based access for rule repositories. Limit rule modification to authorized detection engineers.

  • Audit Logging: Log all rule deployments, modifications, and deletions. Track who deployed which rules to which systems. Maintain change history for compliance auditing.

  • Compliance: Sigma rules support compliance monitoring (PCI-DSS 10.2, NIST SP 800-53 AU family, ISO 27001 A.12.4). Document rule-to-control mappings for audit evidence.

  • Safe Defaults: Use conservative false positive filtering in production. Start rules at "experimental" status. Test thoroughly in test environment before production deployment.

Bundled Resources

Scripts

  • scripts/sigma_convert.py - Convert Sigma rules to target SIEM backend formats
  • scripts/sigma_validate.py - Validate Sigma rule syntax and detect common errors
  • scripts/compliance_coverage.py - Analyze detection coverage for compliance frameworks
  • scripts/generate_rule_template.py - Generate Sigma rule template with MITRE ATT&CK tags

References

  • references/mitre-attack-mapping.md - Common MITRE ATT&CK techniques and Sigma detection patterns
  • references/log-source-guide.md - Log source categories, products, and field mappings
  • references/compliance-mappings.md - Compliance framework to detection rule mappings
  • references/backend-support.md - Supported SIEM backends and conversion capabilities
  • references/field-modifiers.md - Comprehensive guide to Sigma field modifiers and regex patterns

Assets

  • assets/rule-templates/ - Pre-built Sigma rule templates for common attack patterns

    • lateral-movement.yml - Lateral movement detection template
    • privilege-escalation.yml - Privilege escalation detection template
    • persistence.yml - Persistence mechanism detection template
    • credential-access.yml - Credential dumping detection template
  • assets/compliance-rules/ - Compliance-focused rule templates

    • pci-dss-monitoring.yml - PCI-DSS monitoring requirements
    • nist-800-53-audit.yml - NIST 800-53 audit logging requirements
    • iso27001-logging.yml - ISO 27001 logging and monitoring

Common Detection Patterns

Pattern 1: Process Execution Monitoring

Detect suspicious process creation with command-line analysis:

logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith:
            - '\powershell.exe'
            - '\cmd.exe'
        CommandLine|contains:
            - 'Invoke-'
            - 'IEX'
            - 'FromBase64String'

Pattern 2: Network Connection Monitoring

Detect suspicious outbound connections:

logsource:
    category: network_connection
    product: windows
detection:
    selection:
        Initiated: 'true'
        DestinationPort:
            - 4444
            - 5555
            - 8080
    filter:
        DestinationIp|startswith:
            - '10.'
            - '172.16.'
            - '192.168.'
    condition: selection and not filter

Pattern 3: File Event Monitoring

Detect file creation in suspicious locations:

logsource:
    category: file_event
    product: windows
detection:
    selection:
        TargetFilename|contains:
            - '\Windows\Temp\'
            - '\AppData\Roaming\'
        TargetFilename|endswith:
            - '.exe'
            - '.dll'
            - '.ps1'

Integration Points

CI/CD Integration

Build detection-as-code pipelines:

# .github/workflows/sigma-validation.yml
name: Sigma Rule Validation
on: [push, pull_request]
jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Validate Sigma Rules
        run: |
          pip install pysigma
          python scripts/sigma_validate.py --directory rules/
      - name: Convert to Production Format
        run: |
          python scripts/sigma_convert.py --directory rules/ --backend splunk --output converted/

SIEM Deployment

Automated rule deployment:

  • Splunk: Use Splunk REST API or splunk-sdk for savedsearches
  • Elasticsearch: Convert to EQL and deploy via Kibana API
  • Microsoft Sentinel: Convert to KQL and deploy via Azure API
  • QRadar: Convert to AQL and deploy via QRadar API

See references/backend-support.md for deployment examples.

Threat Intelligence Integration

Enrich rules with threat intel:

  • Tag rules with threat actor TTPs
  • Reference threat reports and IOCs
  • Map to MITRE ATT&CK techniques
  • Track rule effectiveness against known threats

Troubleshooting

Issue: Conversion Fails for Specific Backend

Solution: Check backend compatibility and field mappings. Some backends have limitations:

  • Review references/backend-support.md for known limitations
  • Use sigma_convert.py --backend <backend> --debug for detailed error output
  • Check if field names are supported in target backend
  • Consider custom pipeline transformations for unsupported fields

Issue: High False Positive Rate

Solution: Refine detection logic with additional filters:

  1. Review false positive patterns
  2. Add exclusion filters for legitimate use cases
  3. Use more specific field modifiers (e.g., |endswith vs |contains)
  4. Consider time-based correlation for behavioral detection
  5. Test with historical data to validate tuning

Issue: Rule Not Triggering in Target SIEM

Solution: Verify log source availability and field mappings:

  1. Confirm log source is ingested: Check SIEM data sources
  2. Verify field names match: Use sigma_convert.py --show-fields to see mapping
  3. Test converted query directly in SIEM
  4. Check for case sensitivity issues in field values
  5. Validate time window and search scope in SIEM

MITRE ATT&CK Integration

Tag rules with ATT&CK tactics and techniques:

tags:
    - attack.execution           # Tactic
    - attack.t1059.001          # Technique: PowerShell
    - attack.defense_evasion    # Additional tactic
    - attack.t1027              # Technique: Obfuscated Files

Common tactic tags:

  • attack.initial_access
  • attack.execution
  • attack.persistence
  • attack.privilege_escalation
  • attack.defense_evasion
  • attack.credential_access
  • attack.discovery
  • attack.lateral_movement
  • attack.collection
  • attack.exfiltration
  • attack.command_and_control
  • attack.impact

For detailed technique mappings, see references/mitre-attack-mapping.md.

Best Practices

  1. Start with Community Rules: Use SigmaHQ repository (3000+ peer-reviewed rules) as foundation
  2. Version Control: Store rules in Git with meaningful commit messages
  3. Test Before Deploy: Validate against historical data in test environment
  4. Document Tuning: Track false positive patterns and tuning decisions
  5. Map to Frameworks: Tag all rules with MITRE ATT&CK and compliance mappings
  6. Automate Validation: Use CI/CD to validate rules on every change
  7. Monitor Effectiveness: Track rule trigger rates and true positive rates
  8. Regular Updates: Review and update rules based on new threat intelligence

References

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。