Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions detection_rules/etc/non-ecs-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
},
"logs-azure.auditlogs-*": {
"azure.auditlogs.properties.additional_details.value": "keyword",
"azure.auditlogs.properties.initiated_by.app.agentType": "keyword",
"azure.auditlogs.properties.target_resources.0.display_name": "keyword",
"azure.auditlogs.properties.target_resources.0.id": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.0.display_name": "keyword",
Expand All @@ -137,8 +138,14 @@
"azure.auditlogs.properties.target_resources.0.modified_properties.2.new_value": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.3.display_name": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.3.new_value": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.4.display_name": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.4.new_value": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.5.display_name": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.5.new_value": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.6.display_name": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.6.new_value": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.7.display_name": "keyword",
"azure.auditlogs.properties.target_resources.0.modified_properties.7.new_value": "keyword",
"azure.auditlogs.properties.target_resources.0.user_principal_name": "keyword",
"azure.auditlogs.properties.target_resources.0.type": "keyword",
"azure.auditlogs.properties.target_resources.1.display_name": "keyword",
Expand Down Expand Up @@ -189,6 +196,9 @@
},
"logs-azure.signinlogs-*": {
"azure.auditlogs.properties.target_resources.0.display_name": "keyword",
"azure.signinlogs.properties.agent.agent_subject_type": "keyword",
"azure.signinlogs.properties.agent.agent_type": "keyword",
"azure.signinlogs.properties.agent.parent_app_id": "keyword",
"azure.signinlogs.properties.app_id": "keyword",
"azure.signinlogs.properties.app_owner_tenant_id": "keyword",
"azure.signinlogs.properties.applied_conditional_access_policies.display_name": "keyword",
Expand All @@ -199,16 +209,18 @@
"azure.signinlogs.properties.authentication_protocol": "keyword",
"azure.signinlogs.properties.client_credential_type": "keyword",
"azure.signinlogs.properties.conditional_access_audiences.application_id": "keyword",
"azure.signinlogs.properties.device_detail.operating_system": "keyword",
"azure.signinlogs.properties.device_detail.trust_type": "keyword",
"azure.signinlogs.properties.is_interactive": "boolean",
"azure.signinlogs.properties.mfa_detail.auth_method": "keyword",
"azure.signinlogs.properties.original_transfer_method": "keyword",
"azure.signinlogs.properties.resource_id": "keyword",
"azure.signinlogs.properties.resource_owner_tenant_id": "keyword",
"azure.signinlogs.properties.service_principal_credential_key_id": "keyword",
"azure.signinlogs.properties.service_principal_id": "keyword",
"azure.signinlogs.properties.session_id": "keyword",
"azure.signinlogs.properties.tenant_id": "keyword",
"azure.signinlogs.properties.token_protection_status_details.sign_in_session_status": "keyword",
"azure.signinlogs.properties.device_detail.operating_system": "keyword",
"azure.signinlogs.properties.device_detail.trust_type": "keyword"
"azure.signinlogs.properties.token_protection_status_details.sign_in_session_status": "keyword"
},
"logs-azure_ai_foundry.logs-*": {
"azure.ai_foundry.properties.apim_subscription_id": "keyword",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
[metadata]
creation_date = "2026/11/25"
integration = ["azure"]
maturity = "production"
updated_date = "2026/11/25"

[rule]
author = ["Elastic"]
description = """
Identifies multiple distinct child agent identities that share the same agent identity blueprint failing to authenticate
from the same source IP within a short window. When an adversary holds a blueprint credential and probes which child
agents or resources it can impersonate, Entra returns distinct token-exchange failures (for example blueprint/child
relationship mismatch or disabled identity) across several siblings. A single source generating failed exchanges for
multiple children of one blueprint is a stronger signal than any single failure and can indicate blueprint credential
abuse or agent enumeration.
"""
false_positives = [
"""
A broken runtime, expired or rotated blueprint credential, or a misconfigured deployment can cause several sibling
agents to fail authentication from one host. Correlate with recent blueprint credential and configuration changes.
""",
]
from = "now-60m"
interval = "30m"
language = "esql"
license = "Elastic License v2"
name = "Entra ID Multiple Agent Identities Failing Authentication from One Source"
note = """## Triage and analysis

### Investigating Entra ID Multiple Agent Identities Failing Authentication from One Source

This rule groups failed **ServicePrincipalSignInLogs** events for child agent identities
(`azure.signinlogs.properties.agent.agent_type` is `agenticAppInstance`) by their parent blueprint
(`azure.signinlogs.properties.agent.parent_app_id`) and `source.ip` in 30-minute windows, and alerts when at least two
distinct child agents of the same blueprint fail from the same source.

#### Possible investigation steps

- Review `Esql.failed_children`, `Esql.error_codes`, and `source.ip`. Common codes include `7002134` (blueprint/child
relationship mismatch), `7000112` (disabled identity), and `7000215` (invalid credential at the blueprint stage).
- Identify the blueprint from `azure.signinlogs.properties.agent.parent_app_id` and whether this source IP is expected.
- Check for any successful child sign-ins from the same source and blueprint in the same window, which would indicate the
attacker found a working child after probing.
- Review Entra audit logs for recent credential additions on the blueprint.

### False positive analysis

- A broken or mid-rotation runtime can fail across siblings. Note that some failed exchanges drop
`agent.parent_app_id`; those events will not group here, so absence of grouping does not rule out abuse.

### Response and remediation

- If the source is unexpected, rotate blueprint credentials, review child agent permissions, and apply Conditional Access
to the blueprint.
"""
references = [
"https://learn.microsoft.com/en-us/entra/agent-id/sign-in-audit-logs-agents",
"https://learn.microsoft.com/en-us/entra/agent-id/agent-autonomous-app-oauth-flow",
"https://securitylabs.datadoghq.com/articles/agent-id-inside-agent-compromise/",
]
risk_score = 47
rule_id = "f4d9a1c7-6e32-4b85-9a0d-2c7e1b8f5a39"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Sign-In Logs",
"Use Case: Identity and Access Audit",
"Use Case: Threat Detection",
"Tactic: Credential Access",
"Resources: Investigation Guide",
"Rule Type: ES|QL",
"Platform: Entra ID",
]
timestamp_override = "event.ingested"
type = "esql"

query = '''
from logs-azure.signinlogs-* metadata _id, _index
| where data_stream.dataset == "azure.signinlogs"
and azure.signinlogs.category == "ServicePrincipalSignInLogs"
and azure.signinlogs.properties.agent.agent_type == "agenticAppInstance"
and azure.signinlogs.properties.agent.parent_app_id is not null
and azure.signinlogs.properties.status.error_code != 0
| eval Esql.time_window = date_trunc(30 minutes, @timestamp)
| stats
Esql.failed_child_count = count_distinct(azure.signinlogs.properties.app_id),
Esql.failed_children = values(azure.signinlogs.properties.app_id),
Esql.error_codes = values(azure.signinlogs.properties.status.error_code),
Esql.first_seen = min(@timestamp),
Esql.last_seen = max(@timestamp)
by Esql.time_window, azure.signinlogs.properties.agent.parent_app_id, source.ip
| where Esql.failed_child_count >= 2
| keep azure.signinlogs.properties.agent.parent_app_id, source.ip, Esql.*
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1110"
name = "Brute Force"
reference = "https://attack.mitre.org/techniques/T1110/"
[[rule.threat.technique.subtechnique]]
id = "T1110.004"
name = "Credential Stuffing"
reference = "https://attack.mitre.org/techniques/T1110/004/"



[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[rule.investigation_fields]
field_names = [
"azure.signinlogs.properties.agent.parent_app_id",
"source.ip",
"Esql.failed_child_count",
"Esql.failed_children",
"Esql.error_codes",
"Esql.time_window",
]

Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
[metadata]
creation_date = "2026/11/25"
integration = ["azure"]
maturity = "production"
updated_date = "2026/11/25"

[rule]
author = ["Elastic"]
description = """
Identifies the first observed authentication of a Microsoft Entra agent identity blueprint principal, scoped by
blueprint application ID, within the history window. When a tenant admin consents to a third-party (multitenant) agent
blueprint, a blueprint principal is created locally and can immediately authenticate using credentials held in the
blueprint's home (attacker) tenant. Because the blueprint principal authenticates locally in the victim tenant, standard
cross-tenant sign-in indicators are not set, so a newly observed blueprint principal authenticating is one of the few
sign-in-side signals of a freshly consented blueprint, including a malicious externally owned one as described in
Proofpoint's "BluePhishing" research. This complements the companion rule that detects a known blueprint authenticating
with a new credential, catching the case where no credential key ID is present on the sign-in.
"""
false_positives = [
"""
Onboarding of a legitimate internal or approved third-party agent blueprint produces a first-seen blueprint
principal authentication. Validate with the blueprint owner and the corresponding consent event, and suppress
expected onboarding waves rather than disabling the rule.
""",
]
from = "now-65m"
index = ["filebeat-*", "logs-azure.signinlogs-*"]
interval = "1h"
language = "kuery"
license = "Elastic License v2"
name = "Entra ID Agent Blueprint Principal First Authentication"
note = """## Triage and analysis

### Investigating Entra ID Agent Blueprint Principal First Authentication

This rule matches successful **ServicePrincipalSignInLogs** events where the acting identity is an agent identity
blueprint principal (`azure.signinlogs.properties.agent.agent_type` is `agentIdentityBlueprintPrincipal`) and the
blueprint `azure.signinlogs.properties.app_id` has not been seen authenticating in the history window. This is a
first-seen blueprint principal, which maps to a newly created or newly consented agent blueprint.

#### Possible investigation steps

- Identify the blueprint from `azure.signinlogs.properties.app_id` and `azure.signinlogs.properties.service_principal_name`.
- Determine whether the blueprint principal is owned by an external organization (service principal
`appOwnerOrganizationId` differs from the tenant). An externally owned blueprint principal that authenticates locally
indicates a consented third-party blueprint (BluePhishing).
- Review Entra audit logs for a recent `Consent to application` / `Add service principal` event for this blueprint and
who granted the consent (`initiatedBy`).
- Review `source.ip`, `source.as.organization.name`, and `source.geo.*` against expected blueprint runtime and egress.
- Pivot on child agent sign-ins (`agent.agent_type:agenticAppInstance` with `agent.parent_app_id` equal to this
blueprint) and any `Add service principal` events initiated by this blueprint principal (agent identity creation).

### False positive analysis

- Legitimate blueprint onboarding or approved third-party blueprint consent produces a first-seen blueprint principal.
Confirm with the owner and the consent record before excluding.

### Response and remediation

- If the blueprint is unexpected or externally owned without approval, remove the consent/blueprint principal, review all
agent identities derived from it and their inherited permissions, and restrict third-party application and agent
blueprint consent via consent policies and permission classifications.
"""
references = [
"https://www.proofpoint.com/us/blog/threat-insight/BluePhishing-Initial-Access-via-Third-Party-Agent-Blueprint-Consent",
"https://learn.microsoft.com/en-us/entra/agent-id/sign-in-audit-logs-agents",
"https://learn.microsoft.com/en-us/entra/agent-id/agent-autonomous-app-oauth-flow",
"https://securitylabs.datadoghq.com/articles/agent-id-inside-agent-compromise/",
]
risk_score = 47
rule_id = "d4e5f6a7-8b9c-4d0e-1f2a-3b4c5d6e7f80"
severity = "medium"
tags = [
"Domain: Cloud",
"Domain: Identity",
"Data Source: Azure",
"Data Source: Microsoft Entra ID",
"Data Source: Microsoft Entra ID Sign-In Logs",
"Use Case: Identity and Access Audit",
"Use Case: Threat Detection",
"Tactic: Initial Access",
"Resources: Investigation Guide",
"Rule Type: New Terms",
"Platform: Entra ID",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset:azure.signinlogs
and azure.signinlogs.category:ServicePrincipalSignInLogs
and azure.signinlogs.properties.status.error_code:0
and azure.signinlogs.properties.agent.agent_type:"agentIdentityBlueprintPrincipal"
and azure.signinlogs.properties.app_id:*
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"
[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"



[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[rule.investigation_fields]
field_names = [
"@timestamp",
"source.ip",
"source.as.number",
"source.as.organization.name",
"source.geo.country_name",
"azure.signinlogs.properties.app_id",
"azure.signinlogs.properties.service_principal_name",
"azure.signinlogs.properties.agent.agent_type",
"azure.signinlogs.properties.resource_display_name",
"azure.signinlogs.properties.correlation_id",
]

[rule.new_terms]
field = "new_terms_fields"
value = ["azure.signinlogs.properties.app_id"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-10d"


Loading
Loading