Sigma คืออะไร?
"Open detection language" — เป็น YAML format ที่ใช้เขียน "กฎจับภัย" แบบไม่ผูกกับ vendor SIEM
เปรียบเทียบ:
Regex สำหรับ text ↳ เขียน 1 pattern ใช้ search ได้ทุกโปรแกรมSigma สำหรับ log ↳ เขียน 1 rule แปลง KQL/SPL/EQL ได้
ชุมชนใช้ Sigma แชร์ detection rule กัน — SigmaHQ มี 3,000+ rules ฟรีบน GitHub
ทำไมต้องแปลง?
SIEM แต่ละเจ้าใช้ "ภาษาคนละแบบ":
Microsoft Sentinel / Defender ↳ KQL (Kusto Query Language)Splunk ↳ SPL (Search Processing Language)
Elastic / OpenSearch ↳ EQL หรือ Lucene query string
ถ้าเจอ Sigma rule ใน blog/Twitter/GitHub แล้วคุณใช้ Sentinel — ต้องแปลง ก่อนเอาไปใช้ · tool นี้คือ converter
⚠️ Official tool คือ pySigma (Python CLI) · tool นี้เป็น web simplified version · cover ~80% syntax
Anatomy ของ Sigma rule
Sigma rule มี 3 ส่วนหลัก:
Modifier เช่น |contains · |endswith · |startswith · |re (regex)
ลอง paste Sigma rule แล้วดู query ที่แปลงให้ทันที — มี 5 sample rules ให้เริ่มต้นถ้ายังไม่มีของคุณเอง
📝 Sigma Rule (YAML)
⚡ Translated Query
// paste Sigma rule แล้วกด Convert
🔷 Microsoft Sentinel / Defender
KQL · Kusto Query LanguageMicrosoft Sentinel → Hunting → + New QueryRun QueryLast 24 hours ก่อน · ดูว่ามี hit ไหมSentinel → Analytics → + Create → Scheduled query ruleRun every 5 minutes + Lookup last 1 hourSeverity = High + Alert grouping + Incident creation: Yes🔶 Splunk Enterprise / Cloud
SPL · Search Processing LanguageSearch & Reporting appindex= และ sourcetype= ให้ตรงกับของคุณLast 24 hours · กด SearchSave As → AlertSchedule: Every 5 minutes + Trigger when results > 0Send to ITSM หรือ Email · กรอกข้อความ alert🔴 Elastic Security / Kibana
EQL หรือ KQL/LuceneKibana → Discoverwinlogbeat-* หรือ logs-*Security app → Rules → + Create new ruleEQL (ถ้าใช้ EQL) หรือ Custom Query (KQL)Schedule: 5m + Lookback: 30m + Severity: High💡 SOC Tips · ก่อน deploy production
Test ใน 24-hour window ก่อน
ยิง query ใน lookback 24 ชม. ก่อน — ถ้า hit > 100 ครั้ง = น่าจะมี false positive · ต้อง tune ก่อน production
Tune false positive ด้วย "filter_legit"
ถ้าเจอ noise · เพิ่ม filter_legit ใน Sigma แล้ว condition: selection and not filter_legit
Map กับ MITRE ATT&CK
ใช้ tag attack.t1059.001 ใน Sigma เพื่อ track coverage · ดูที่ attack.mitre.org
Adjust table/index ก่อน paste
Tool generate ให้ default = DeviceProcessEvents (Sentinel) · index=windows (Splunk) · ปรับให้ตรง env ของคุณ
Version control rules
Save Sigma YAML ใน Git repo + alert metadata · แชร์กับทีม · review เป็น PR · audit trail
Source ของ Sigma rules
SigmaHQ (3,000+ official) · detection.fyi · Uncoder.IO