DeviceRegistryEvents
| where Timestamp > ago(1d)
| where ActionType == "RegistryValueSet"
| where (
(RegistryKey has "EnableFirewall" and RegistryValueData == "0")
or (RegistryKey has "DisableAntiSpyware" and RegistryValueData == "1")
or (RegistryKey has "AmsiEnable" and RegistryValueData == "0")
or (RegistryKey has "EnableScriptBlockLogging" and RegistryValueData == "0")
or (RegistryKey has "EnableLUA" and RegistryValueData == "0")
or (RegistryKey has "ConsentPromptBehaviorAdmin" and RegistryValueData == "0")
)
| project Timestamp, DeviceName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessAccountName
| sort by Timestamp desc