FortiSIEM Rules

Windows: Azure AD Health Service Agents Registry Keys Access

Rule ID

PH_Rule_SIGMA_1164

Default Status

Enabled

Description

This detection uses Windows security events to detect suspicious access attempts to the registry key values and sub-keys of Azure AD Health service agents (e.g AD FS). Information from AD Health service agents can be used to potentially abuse some of the features provided by those services in the cloud (e.g. Federation). This detection requires an access control entry (ACE) on the system access control list (SACL) of the following securable object: HKLM:\SOFTWARE\Microsoft\ADHealthAgent. Make sure you set the SACL to propagate to its sub-keys. . This rule is adapted from https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_aadhealth_svc_agent_regkey_access.yml

Severity

5

Category

Security

MITRE ATT&CK® Tactics

Discovery

Discovery consists of techniques an adversary may use to gain knowledge about the system and internal network. These techniques help adversaries observe the environment and orient themselves before deciding how to act. They also allow adversaries to explore what they can control and what’s around their entry point in order to discover how it could benefit their current objective. Native operating system tools are often used toward this post-compromise information-gathering objective.

https://attack.mitre.org/tactics/TA0007

MITRE ATT&CK® Techniques


T1012

Query Registry

Adversaries may interact with the Windows Registry to gather information about the system, configuration, and installed software. Adversaries may use the information from Query Registry during automated discovery to shape follow-on behaviors, including whether or not the adversary fully infects the target and/or attempts specific actions.

https://attack.mitre.org/techniques/T1012

Impacts

Server

Data Source

Windows Security Log via OMI or FortiSIEM Agent

Detection

Correlation

Remediation Guidance

No remediation guidance specified

Time Window

If the following pattern or patterns match an ingested event within the given time window in seconds, trigger an incident.

300 seconds

Trigger Conditions

If the following defined pattern/s occur within a 300 second time window.

Filter

SubPattern Definitions

SubPattern Name: Filter

This is the named definition of the event query, this is important if multiple subpatterns are defined to distinguish them.

SubPattern Query

This is the query logic that matches incoming events

(eventType IN ("Win-Security-4656","Win-Security-4663") AND osObjType="Key" AND osObjName="\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\ADHealthAgent") AND (procName NOT REGEXP ".*Microsoft\.Identity\.Health\.Adfs\.DiagnosticsAgent\.exe.*|.*Microsoft\.Identity\.Health\.Adfs\.InsightsService\.exe.*|.*Microsoft\.Identity\.Health\.Adfs\.MonitoringAgent\.Startup\.exe.*|.*Microsoft\.Identity\.Health\.Adfs\.PshSurrogate\.exe.*|.*Microsoft\.Identity\.Health\.Common\.Clients\.ResourceMonitor\.exe.*")

Group by Attributes

This defines how matching events are aggregated, only events with the same matching attribute values are grouped into one unique incident ID

hostName,osObjName,osObjType,procName

Aggregate Constraint

This is most typically a numerical constraint that defines when the rule should trigger an incident

COUNT(*) >= 1

Incident Attribute Mapping

This section defines which fields in matching raw events should be mapped to the incident attributes in the resulting incident.

The available raw event attributes to map are limited to the group by attributes and the aggregate event constraint fields for each subpattern

hostName = Filter.hostName,
osObjName = Filter.osObjName,
osObjType = Filter.osObjType,
procName = Filter.procName