<group name="decisionterrain_audit_detections,">
  <!-- Generated by scripts/generate_siem_detections.py from detections.json. Requires wazuh-bridge-rules.xml (IDs 100210-100213). -->
  <rule id="100220" level="12">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:policy_updated|organization_data_governance_policy_updated)$</field>
    <description>Audit or data-governance policy changed.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100222" level="10">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:evidence_revealed|export_created|export_downloaded|investigation_evidence_used|audit_explanation_evidence_requested|audit_explanation_evidence_used|audit_explanation_revealed|security_audit_exported|organization_portable_export_requested)$</field>
    <description>Audit evidence revealed or exported.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100224" level="12">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:siem_destination_stop|siem_destination_pause|siem_destination_retire|siem_installation_forwarding_changed|siem_installation_eligibility_changed|siem_installation_storage_limits_changed)$</field>
    <description>SIEM forwarding stopped or restricted.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100226" level="10">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:organization_api_key_created|scim_token_created|scim_token_rotated|machine_identity_created|machine_identity_version_activated|security_service_identity_created|security_service_credential_rotated|native_integration_credentials_created)$</field>
    <description>Credential or machine identity issued.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100228" level="10">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:organization_member_role_updated|scim_group_mapping_updated|scim_default_role_updated|organization_access_policy_updated|organization_invite_created)$</field>
    <description>Role mapping or access policy changed.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100230" level="12">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:connection_deactivated|recovery_enforcement_relaxed|recovery_kit_created|recovery_kit_rotated|recovery_session_started|identity_unlinked)$</field>
    <description>SSO enforcement weakened or recovery used.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100232" level="12">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:security_rule_halt_accepted|external_security_halt_accepted|internal_security_halt_accepted|security_halt_batch_started)$</field>
    <description>Agent security hold placed.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100234" level="12">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:agent_emergency_.*|sandbox_emergency_.*)$</field>
    <field name="Result" type="pcre2">^(?:failed)$</field>
    <description>Emergency control step failed.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100236" level="3">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:member_login_failed)$</field>
    <description>Repeated failed sign-ins for one account.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100237" level="12" frequency="5" timeframe="600">
    <if_matched_sid>100236</if_matched_sid>
    <same_field>ResourceId</same_field>
    <description>Repeated failed sign-ins for one account.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100238" level="3">
    <if_sid>100210,100211</if_sid>
    <field name="Action" type="pcre2">^(?:api_key_authentication_failed|service_credential_authentication_failed)$</field>
    <description>Repeated rejected API key or service credential.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100239" level="10" frequency="3" timeframe="600">
    <if_matched_sid>100238</if_matched_sid>
    <same_field>ResourceId</same_field>
    <description>Repeated rejected API key or service credential.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100240" level="3">
    <if_sid>100212,100213</if_sid>
    <field name="Action" type="pcre2">^(?:security_rule_evaluated|sandbox_network_request)$</field>
    <field name="Result" type="pcre2">^(?:denied)$</field>
    <description>Agent repeatedly denied by policy.</description>
    <group>decisionterrain_detection,</group>
  </rule>
  <rule id="100241" level="10" frequency="10" timeframe="900">
    <if_matched_sid>100240</if_matched_sid>
    <same_field>AgentId</same_field>
    <description>Agent repeatedly denied by policy.</description>
    <group>decisionterrain_detection,</group>
  </rule>
</group>
