이번 글에서는 SigmaHQ의 3,700+ 규칙을 단순히 복사해서 쓰는 수준이 아니라, CTI(사이버 위협 정보)와 연동해 200% 활용하는 방법을 정리해드리겠습니다.

SigmaHQ 문서는 규칙을 기여, 검증, 자동화, 위협 인텔 연동으로 확장하라고 안내하며, MISP 통합과 MITRE ATT&CK 매핑을 권장합니다.

즉, 수동 다운로드에서 벗어나 자동 업데이트 + 커스터마이징 + 공유 워크플로를 구축하는 것이 핵심입니다.

 

◎ SigmaHQ 레포지토리 이해

 - SigmaHQ/sigma는 3,731개 규칙을 보유하며, Windows/Linux/Cloud/네트워크 등 100+ logsource를 커버합니다.

  • 구조
sigma/
├── rules/              # 규칙 디렉토리 (windows/process_creation 등)
├── tools/              # 유틸리티
└── docs/               # 가이드

 - 강점: MITRE 태그 90%+, 테스트 결과 공개.

 - 기여 가이드

  • 레이아웃 준수: title, id, logsource 필수.
  • 파일명 규칙: windows_process_creation_proc_creation_win_susp_activity.yml.
  • PR: GitHub Issues 확인 후 Pull Request.

 

1단계: 자동 동기화 워크플로 (Daily Update)
 - GitHub Actions

name: Sigma Daily Sync
on:
  schedule:
    - cron: '0 2 * * *'  # 매일 새벽 2시
jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: SigmaHQ Sync
        run: |
          git clone https://github.com/SigmaHQ/sigma.git sigma_latest
          rsync -av sigma_latest/rules/ rules/ --delete
          git add rules/
          git commit -m "SigmaHQ daily sync $(date)"
          git push

 

 - MISP 연동 (Threat Intel)

# MISP → Sigma
misp2sigma --url https://misp.yourcompany.com misp-event-1234 > misp_sigma.yml

 

2단계: 규칙 검색 및 필터링

 - 로컬 검색

# PowerShell 탐지
grep -r "powershell.exe" rules/windows/ | grep stable

# MITRE T1078 (Valid Accounts)
grep -r "attack.t1078" rules/ | wc -l  # 45개

# 최신 룰 (1주일)
find rules/ -name "*.yml" -mtime -7

 

 - Sigma Intelligence

  • 3,731 규칙 검색.
  • ATT&CK 히트맵.
  • 작성자별 신뢰도.

 

 - Sigma CLI:

sigma search "powershell" --target splunk --pipeline splunk_windows

 

3단계: CTI 연동 전략

 1. MISP 통합:

# MISP 이벤트 → Sigma 생성
pip install misp2sigma
misp2sigma --url https://misp.yourcompany.com misp-event-5678
  • SigmaHQ 문서 권장.

 

 2. OSINT 소스:

# AlienVault OTX
otx-cli -k API_KEY get indicators --search "ransomware" | jq '.indicators[] | select(.indicator_type=="url")' | sigma generate

# VirusTotal YARA → Sigma
vt-yara-to-sigma yara_rules/

 

 3. SigmaGen AI:

SigmaGen --cti otx-ransomware.json --framework attck-v19
# AI로 Sigma 룰 생성

 

4단계: 커스터마이징 워크플로

 1. Fork & PR:

git clone https://github.com/YOURNAME/sigma.git
# 수정 → PR to SigmaHQ

 

 2. 로컬 확장:

rules/custom/
├── windows_custom_ps.yml
└── linux_nmap.yml

 

sigma convert rules/ rules/custom/ --target splunk 

 

 3. Filename Normalization:

# rules/windows/process_creation/win_ps_susp.yml → 규칙
sigma normalize-filename win_ps_susp.yml

 

5단계: 테스트 및 검증
 - Hayabusa

hayabusa.exe -d evtx-baseline/ -r rules/ --json > coverage.json
jq '.rules | map(select(.hits > 0)) | length' coverage.json

 

 - Sigma CLI

sigma test rules/ evtx-test/
sigma validate rules/

 

 - 커버리지

S2AN -d rules/ -w  # ATT&CK Navigator

 

6단계: CI/CD 파이프라인

 - 완전 자동화

name: Sigma Pipeline
on: [push]
jobs:
  build:
    steps:
      - git clone https://github.com/SigmaHQ/sigma.git sigma/
      - rsync sigma/rules/ rules/ --delete
      - sigma validate rules/
      - sigma convert rules/windows/*.yml --target splunk > splunk_rules/
      - sigma convert rules/linux/*.yml --target elasticsearch > elastic_rules/
      - upload-artifact splunk_rules/

 

 - MISP 웹훅

MISP → GitHub → Sigma 변환 → SIEM 배포

 

7단계: 커뮤니티 기여 (200% 달성)

 - PR 가이드

  • Issues 확인: 중복 피함.
  • 컨벤션: status=stable, tests 제공.
  • 테스트: evtx 파일 첨부.
  • PR: "Add T1078 detection" 제목.

 

 - 기여 통계

# top contributor
git shortlog -sn rules/
  • Sigma Discord/Slack: 피드백.

 

 

◎ CTI 소스 통합 예시

1. Abuse.ch

# Feodo Tracker C2 IP (실제 동작)
curl "https://feodotracker.abuse.ch/blocklist/?download=ipblocklist" | awk -F',' '{print $2}'

# SSLBL IP Blocklist
curl "https://sslbl.abuse.ch/blacklist/ip.txt"

 

2. Blocklist.de 악성 도메인  

curl https://lists.blocklist.de/lists/all.txt | head -5


3. CTI Exchange

misp-export --sigma misp-event > custom_sigma/

 

◎ 성능 최적화 팁

1. 규칙 우선순위

rules/high_critical/
rules/medium/
rules/low/

 

2. 파이프라인 분리

--pipeline windows_high_perf
--pipeline windows_general

 

3. 캐싱

sigma convert --cache rules/ > cached_queries/

 

 마무리

  • SigmaHQ를 200% 활용하려면 자동 동기화 + CTI 연동 + 커스터마이징 + 기여 워크플로가 핵심입니다. 
  • MISP, OSINT, AI를 결합해 3,700개 규칙을 넘어선 탐지 체계 구축하세요.

 

 

 

반응형

+ Recent posts