暫無描述

soc-a2-fortigate-fw-rules.xml 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!--
  2. SOC Proposal Rules — Appendix A2: FortiGate IPS/IDS & Firewall
  3. Production profile rule IDs : 110311-110320
  4. Severity mapping:
  5. High → level 12
  6. Medium → level 8
  7. Low → level 5
  8. Parent SID reference (built-in Wazuh FortiGate rules):
  9. 81603 — Fortigate messages grouped (universal FortiGate base)
  10. 81606 — Fortigate: Login failed (action=login status=failed)
  11. 81608 — Fortigate: Configuration changed (Configuration is changed in the admin session)
  12. 81612 — Fortigate: Firewall configuration changes (action=Edit, type=event)
  13. 81618 — Fortigate: Traffic to be aware of (type=traffic)
  14. 81622 — Fortigate: VPN user connected (action=tunnel-up)
  15. 81628 — Fortigate attack detected
  16. 81629 — Fortigate attack dropped
  17. Fix history:
  18. 2026-03-19: Changed all if_group=fortigate → if_sid=81603/81618/81628/81629
  19. if_group=fortigate does not chain rules correctly in Wazuh 4.x;
  20. correct approach is if_sid pointing to a built-in parent rule.
  21. 2026-03-20: Changed 110311/110320 from if_sid=81618 → if_sid=81603 with explicit
  22. type=traffic match. Wazuh 4.x does not evaluate grandchild if_sid chains
  23. (81603 → 81618 → 110311 fails); sibling pattern (81603 → 110311) works.
  24. -->
  25. <group name="soc_mvp,appendix_a,a2,fortigate,">
  26. <!-- A2-01: RDP traffic allowed through firewall
  27. Parent: 81603 (FortiGate base — NOT 81618 to avoid 3-level chain depth limit)
  28. Fix 2026-03-22: replaced multiple <match> (ORed) with single <regex> (AND).
  29. Multiple <match> elements in Wazuh fire if ANY one matches — old rule
  30. matched every traffic log via type=traffic or action=accept (~5M hits/day).
  31. dstport/action are static Wazuh fields — cannot use <field>; use PCRE2
  32. lookaheads in a single <regex> to require BOTH conditions in the raw log. -->
  33. <rule id="110311" level="12">
  34. <if_sid>81603</if_sid>
  35. <regex type="pcre2">(?=.*\bdstport=3389\b)(?=.*\baction="?accept"?)</regex>
  36. <description>A2-01 [PROD] FortiGate: RDP (3389) traffic allowed</description>
  37. <group>soc_prod,a2,rdp,</group>
  38. <mitre><id>T1021.001</id></mitre>
  39. </rule>
  40. <!-- A2-02: Admin password changed
  41. Parent: 81603 (generic base — admin events vary by FW model/version)
  42. FortiGate logs action="password-change" under type=event subtype=system -->
  43. <rule id="110312" level="12">
  44. <if_sid>81603</if_sid>
  45. <match>action="password-change"|action=password-change</match>
  46. <description>A2-02 [PROD] FortiGate: admin account password changed</description>
  47. <group>soc_prod,a2,admin_change,</group>
  48. <mitre><id>T1098</id></mitre>
  49. </rule>
  50. <!-- A2-03: New admin account created
  51. Parent: 81603 (generic base) -->
  52. <rule id="110313" level="12">
  53. <if_sid>81603</if_sid>
  54. <match>action="create-admin"|action=create-admin</match>
  55. <description>A2-03 [PROD] FortiGate: new admin account created</description>
  56. <group>soc_prod,a2,admin_change,</group>
  57. <mitre><id>T1136</id></mitre>
  58. </rule>
  59. <!-- A2-04: Alerting/notification disabled via config change
  60. Parent: 81608 (Configuration changed) or 81612 (Firewall config changes) -->
  61. <rule id="110314" level="12">
  62. <if_sid>81608, 81612</if_sid>
  63. <match>config_value=disable|"disable"</match>
  64. <description>A2-04 [PROD] FortiGate: alerting/notification disabled via config change</description>
  65. <group>soc_prod,a2,defense_evasion,</group>
  66. <mitre><id>T1562</id></mitre>
  67. </rule>
  68. <!-- A2-05: Firewall configuration file downloaded
  69. Parent: 81603 (generic base) -->
  70. <rule id="110315" level="5">
  71. <if_sid>81603</if_sid>
  72. <match>action="download-config"|action=download-config</match>
  73. <description>A2-05 [PROD] FortiGate: firewall configuration file downloaded</description>
  74. <group>soc_prod,a2,config,</group>
  75. <mitre><id>T1005</id></mitre>
  76. </rule>
  77. <!-- A2-06: Multiple critical/high IPS signatures triggered
  78. Parent: 81628 (attack detected) or 81629 (attack dropped)
  79. Note: requires FortiGate IPS UTM logs to be forwarded -->
  80. <rule id="110316" level="8">
  81. <if_sid>81628, 81629</if_sid>
  82. <match>severity="critical"|severity="high"|severity=critical|severity=high</match>
  83. <description>A2-06 [PROD] FortiGate IPS: critical/high attack signature triggered</description>
  84. <group>soc_prod,a2,ips,</group>
  85. <mitre><id>T1595</id></mitre>
  86. </rule>
  87. <!-- A2-07: TCP port scan from external IP
  88. Parent: 81628 or 81629 (IPS/anomaly attack events)
  89. Note: requires FortiGate anomaly detection to be enabled -->
  90. <rule id="110317" level="5">
  91. <if_sid>81628, 81629</if_sid>
  92. <match>attack="TCP.Port.Scan"|TCP.Port.Scan</match>
  93. <description>A2-07 [PROD] FortiGate: TCP port scan from external IP</description>
  94. <group>soc_prod,a2,recon,</group>
  95. <mitre><id>T1046</id></mitre>
  96. </rule>
  97. <!-- A2-08: IOC-based IP detection via IPS
  98. Parent: 81628 or 81629 -->
  99. <rule id="110318" level="8">
  100. <if_sid>81628, 81629</if_sid>
  101. <match>ioc_type=ip|ioc_type="ip"</match>
  102. <description>A2-08 [PROD] FortiGate IPS: IOC-based IP indicator detected</description>
  103. <group>soc_prod,a2,ioc,</group>
  104. <mitre><id>T1071.001</id></mitre>
  105. </rule>
  106. <!-- A2-09: Internal port scan from private source IP
  107. Parent: 81628 or 81629 -->
  108. <rule id="110319" level="8">
  109. <if_sid>81628, 81629</if_sid>
  110. <match>attack="Internal.Port.Scan"|Internal.Port.Scan</match>
  111. <description>A2-09 [PROD] FortiGate: internal port scan from private source IP</description>
  112. <group>soc_prod,a2,recon,</group>
  113. <mitre><id>T1046</id></mitre>
  114. </rule>
  115. <!-- A2-10: Traffic to known C2/malicious IP
  116. Parent: 81603 (FortiGate base — sibling pattern, same fix as 110311)
  117. Fix 2026-03-22: single <regex> with PCRE2 lookaheads ANDs both conditions.
  118. threat_label is not extracted by Wazuh's built-in FortiGate decoder so
  119. raw log matching via regex is required. -->
  120. <rule id="110320" level="8">
  121. <if_sid>81603</if_sid>
  122. <regex type="pcre2">(?=.*\btype="?traffic"?)(?=.*threat_label="?known-c2"?)</regex>
  123. <description>A2-10 [PROD] FortiGate: traffic to known C2/malicious IP allowed</description>
  124. <group>soc_prod,a2,ioc,c2,</group>
  125. <mitre><id>T1071.001</id></mitre>
  126. </rule>
  127. </group>