Skip to content

[New] Entra ID Federated Identity Credential Added - #6741

Closed
earbona23 wants to merge 1 commit into
elastic:mainfrom
earbona23:rule/entra-federated-identity-credential-added
Closed

earbona23 wants to merge 1 commit into
elastic:mainfrom
earbona23:rule/entra-federated-identity-credential-added

Conversation

@earbona23

Copy link
Copy Markdown

Summary

Adds an ES|QL detection rule, Entra ID Federated Identity Credential Added, for the initial addition of a federated identity credential (FIC) to an Entra ID application that previously had none.

A FIC establishes trust with an external OpenID Connect identity provider, letting a client authenticate as the application's service principal by presenting an externally issued token instead of a managed secret or certificate. An adversary with Application Administrator, application-owner, or Application.ReadWrite.All access can add a FIC pointing to an attacker-controlled IdP to gain persistent access without managing any secret and without tripping secret/certificate credential monitoring or MFA controls.

Reference: dirkjanm — Persisting with Federated Credentials in Entra ID.

Why this is not a duplicate

The existing rule Entra ID Federated Identity Credential Issuer Modified (rule_id 498e4094-60e7-11f0-8847-f661ea17fbcd) fires only when an existing FIC's issuer changes — its guard is external_idp_old_issuer is not null and external_idp_new_issuer is not null and old != new.

This rule covers the inverse, non-overlapping case: a new issuer appears in the FederatedIdentityCredentials modified property while no prior issuer was present (external_idp_new_issuer is not null and external_idp_old_issuer is null) — i.e. the credential was added, not modified. The two guards are mutually exclusive, so there is no double-alerting. Together they cover both establishing and redirecting federated trust.

Neither of the adjacent credential rules covers this either:

  • persistence_entra_id_service_principal_credentials_added → operation Add service principal credentials (client secrets / certificates on a service principal, not FICs).
  • persistence_entra_id_application_credential_modification → operation Update application - Certificates and secrets management (secrets / certs, not FICs).

Detection

ES|QL over logs-azure.auditlogs-*, keyed on event.action == "Update application" with target_resources.0.modified_properties.0.display_name == "FederatedIdentityCredentials", mirroring the field handling of the companion issuer-modified rule.

Complements Prowler hardening

This detection pairs with a preventive/hardening check for the same technique in Prowler (prowler-cloud/prowler#12748): Prowler surfaces existing risky FIC configurations, this rule alerts in near-real-time when a new one is established.

MITRE ATT&CK

  • Persistence (TA0003) — T1098 / T1098.001 Additional Cloud Credentials
  • Privilege Escalation (TA0004) — T1098 / T1098.001 Additional Cloud Credentials

Scope / known limitation

Scoped to the initial addition where no FIC existed before (highest-signal, lowest-FP persistence establishment). Documented in the investigation guide, which points to the companion issuer-modified rule for the modification case.

Validation

  • python -m detection_rules validate-rule <rule> → Rule validation successful
  • pytest tests/test_all_rules.py → 54 passed, 1 skipped (skip is the remote/live-stack test requiring credentials)

DCO sign-off included.

Adds an ES|QL detection for the initial addition of a federated
identity credential (FIC) to an Entra ID application that previously
had none.

A FIC establishes trust with an external OpenID Connect identity
provider, letting a client authenticate as the application's service
principal by presenting an externally issued token instead of a
managed secret or certificate. An adversary with Application
Administrator, application-owner, or Application.ReadWrite.All access
can add a FIC pointing to an attacker-controlled IdP to gain
persistent access without managing a secret and without tripping
secret/certificate credential monitoring (T1098.001).

This complements the existing rule "Entra ID Federated Identity
Credential Issuer Modified" (rule_id 498e4094-...), which fires only
when an existing FIC's issuer changes (old and new issuer both
present). This rule covers the inverse, non-overlapping case: a new
issuer appears in the FederatedIdentityCredentials modified property
while no prior issuer was present (old_issuer is null) - i.e., the
credential was added, not modified.

Validation: `python -m detection_rules validate-rule` passes and the
full tests/test_all_rules.py suite passes (54 passed, 1 skipped).

Signed-off-by: earbona23 <[email protected]>
@terrancedejesus

Copy link
Copy Markdown
Contributor

@earbona23 - thanks for the callout! Taking a closer look and doing additional emulation, there are 3 instances total.

  • initial FIC added
  • FIC added alongside others
  • issuer change

Our original rule only detected the issuer change. However, we do not need to separate into new rules to match these behaviors. --> #6936 This should match all of these behaviors and still keep the rule rather straight forward. If you agree, please feel free to close this one and we will merge in the other when reviews are complete.

@earbona23

Copy link
Copy Markdown
Author

Agreed, consolidating into one rule beats splitting it into three. Go ahead and close this one in favour of #6936.

The initial-add case is what sent me here in the first place; good to see the emulation turned up the add-alongside-others variant as well.

@earbona23 earbona23 closed this Oct 17, 2026
@earbona23

Copy link
Copy Markdown
Author

@terrancedejesus a small bookkeeping question on this one, long after the fact and genuinely not a complaint about the technical call — consolidating into #6936 was the right shape and I said so.

When the two PRs I opened were superseded, the attribution came out differently between them, and I suspect it was not deliberate:

In #6936 that file is status: added (+190/-0) and the older persistence_entra_id_service_principal_federated_issuer_modified.toml was removed in the same PR, so the credit was not carried over from an existing file — it was a new file that happened to be written without the second name.

The behaviour that sent me here was the initial-add case, which the previous rule did not cover and which your emulation then widened to three instances. If adding the name is appropriate it would be one line; if Elastic's convention is that a tuned-and-rewritten rule is Elastic-authored, that is a perfectly good answer and I will stop wondering about the difference between the two.

Nothing else outstanding from my side on either PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants