<!--
MARDUK  /  SYSMON DYNAMIX

       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,,,,,,,,,,,,.     ,,,,,,,,,,,,,,,,,,,,,,
       ,,,,,,,,,,,..,,,,,,,,,.     ,,,,,,,,,,.,,,,,,,,,,,
       ,,,,,,,,,,,    ..,,,,,.     ,,,,,..    ,,,,,,,,,,,
       ,,,,,,,,,,,        ..,.    .,..        ,,,,,,,,,,,

Detection attribution and licensing are documented in THIRD_PARTY_NOTICES.md.
MITRE ATT&amp;CK mapping: © 2026 The MITRE Corporation. This work is reproduced
and distributed with the permission of The MITRE Corporation.
-->
<Sysmon schemaversion="4.90">
  <EventFiltering>
    <RuleGroup name="" groupRelation="or">
      <RegistryEvent onmatch="include">
        <!-- Note: The SPL filters on registry_value_data length > 2000 characters at search time.
             Sysmon's RegistryEvent schema does not expose a numeric length condition on the Details field,
             so the length threshold cannot be enforced directly in XML. The rules below match on the
             registry path pattern and exclude the "Path" value name, which is the structural pre-filter
             the SPL applies before the length evaluation. Analysts should apply the length filter
             (len(Details) > 2000) as a post-processing step in their SIEM query on top of these events. -->
        <!-- Note: The macro `security_content_summariesonly` controls whether tstats runs against
             the summary index or the full datamodel - it does not affect field values or matching logic
             and requires no representation in Sysmon XML. -->
        <!-- Note: The macro `windows_anomalous_registry_value_length_in_environment_key_filter` is a
             filter/allowlist macro whose contents could not be resolved from the security_content
             repository at rule-generation time. If it suppresses known-good processes or registry paths,
             those exclusions should be reviewed and applied as additional context in SIEM triage rather
             than in this Sysmon config. -->
        <Rule name="Windows Anomalous Registry Value Length in Environment Key" groupRelation="and">
          <EventType name="technique_id=T1112,technique_name=Modify Registry" condition="is any">SetValue;CreateValue</EventType>
          <TargetObject name="technique_id=T1112,technique_name=Modify Registry" condition="contains">\Environment\</TargetObject>
          <TargetObject name="technique_id=T1112,technique_name=Modify Registry" condition="not end with">\Path</TargetObject>
        </Rule>
      </RegistryEvent>
    </RuleGroup>
  </EventFiltering>
</Sysmon>