豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Add FreeIPA detection rules (26 rules across 4 data streams)#5896

Draft
Oddly wants to merge 2 commits intoelastic:mainfrom
Oddly:freeipa-detection-rules
Draft

Add FreeIPA detection rules (26 rules across 4 data streams)#5896
Oddly wants to merge 2 commits intoelastic:mainfrom
Oddly:freeipa-detection-rules

Conversation

@Oddly
Copy link
Copy Markdown

@Oddly Oddly commented Mar 28, 2026

First detection rule coverage for FreeIPA (Red Hat IdM). 26 rules (20 ES|QL, 4 new_terms, 2 threshold) covering Kerberos authentication attacks, LDAP abuse, IPA API privilege escalation, certificate manipulation, and constrained delegation across 9 MITRE ATT&CK tactics.

All rules tested against a live FreeIPA 4.12.2 environment with Elastic Agent and confirmed firing. Zero false positives from normal operations after tuning.

Depends on the FreeIPA integration (elastic/integrations#17812) which collects from five FreeIPA subsystems: Kerberos KDC, 389 Directory Server (access + errors), Dogtag CA, and IPA JSON API.

Rules by data stream:

KDC (logs-freeipa.kdc-*) — 8 rules: brute force, password spraying, principal enumeration, account lockout storm, first auth from new source IP, S4U2Proxy from new client, slow brute force (24h), slow spray (24h).

LDAP (logs-freeipa.directory_access-*) — 6 rules: bind brute force, mass data exfiltration, anonymous enumeration, non-service account enumeration (LOOKUP JOIN), credential attribute search by external user (LOOKUP JOIN), server config modification.

IPA API (logs-freeipa.ipa_api-*) — 10 rules: password reset, admin group membership, RBAC modification, OTP token manipulation, auth type downgrade, password policy weakening, AD trust modification, mass account disable/deletion, new host enrollment from new IP, first API command by new user.

CA (logs-freeipa.ca_audit-*) — 2 rules: bulk certificate revocation, CA role assumption (excluding ipara/pkidbuser service accounts).

Notable implementation details:

  • FreeIPA locks accounts after ~6 failures, switching from PREAUTH_FAILED to LOCKED_OUT — brute force rule counts all failure types.
  • 389DS BIND and RESULT are separate events. Bind brute force matches RESULT with tag_number == 97 (bind response), not BIND events which lack result codes.
  • LOOKUP JOIN rules correlate BIND identity with SRCH activity via a transform-maintained lookup index (2-minute sync interval).
  • 24-hour threshold rules use 5-minute intervals with alert suppression to avoid duplicate storms.
  • Each rule includes setup guide, investigation guide, investigation_fields, and false positive documentation.

Test suite at Oddly/freeipa-detection-tests.

@Oddly Oddly force-pushed the freeipa-detection-rules branch from fcb300c to bb4f4ec Compare March 28, 2026 16:35
First detection rule coverage for FreeIPA identity management, covering
Kerberos authentication attacks, LDAP abuse, IPA API privilege escalation,
certificate infrastructure manipulation, and domain policy modification.

All rules use ES|QL queries with setup guides, investigation guides,
investigation_fields, and MITRE ATT&CK mappings across 9 tactics. All 16
rules confirmed firing on attack simulations against a live FreeIPA 4.12.2
environment with Elastic Agent 9.3.2, with zero false positives from
normal operations after tuning.

Key findings from live testing: FreeIPA accounts lock out after a few
PREAUTH_FAILED errors so the brute force rule counts all failure types;
LDAP BIND and RESULT are separate log events so bind brute force matches
RESULT tag=97; the IPA API uses ipauserauthtype not user_auth_type as the
parameter name; CA role assumption by ipara/pkidbuser is internal and
excluded; KDC krbMKey queries to cn=kerberos are internal and excluded.
@Oddly Oddly force-pushed the freeipa-detection-rules branch 14 times, most recently from 74074d6 to 4b58cf0 Compare March 30, 2026 14:35
Second wave of FreeIPA detection rules using ES|QL LOOKUP JOIN and
new_terms rule types for detections that require cross-event correlation
or behavioral baselines.

LOOKUP JOIN rules (5) use the existing latest_bind transform to enrich
directory_access RESULT events with the authenticated identity from the
corresponding BIND event. This enables rules that were previously
impossible due to BIND and RESULT being separate log events:

- Anonymous LDAP enumeration: join to identify anonymous sessions
- Credential attribute search by external user: exclude internal FreeIPA
  operations by bind DN
- Mass enumeration by non-service account: filter out SSSD and host
  principal queries, flag human-initiated enumeration
- CVE-2025-7493 krbCanonicalName modification: detect principal spoofing
  with authenticated identity context
- LDAP configuration modification: detect cn=config changes with who
  made the change

new_terms rules (4) use 14-30 day history windows to detect first
occurrences of security-relevant activity:

- First Kerberos auth from new source IP per principal
- First administrative API command for a user
- New host enrollment from previously unseen source IP
- New constrained delegation (S4U2Proxy) client-service pair

24-hour aggregation rules (2) catch patient attacks that stay below
per-interval thresholds:

- Slow brute force: 50+ failures per principal over 24 hours
- Slow password spray: 50+ failures across 10+ principals over 24 hours
@Oddly Oddly force-pushed the freeipa-detection-rules branch from 4b58cf0 to 48a9393 Compare March 30, 2026 15:26
@Oddly Oddly changed the title Add FreeIPA detection rules (16 ES|QL rules) Add FreeIPA detection rules (26 rules across 4 data streams) Apr 1, 2026
@Oddly
Copy link
Copy Markdown
Author

Oddly commented Apr 1, 2026

Two detection rules don't have working E2E tests yet, I'd appreciate input or help on these:

  • CA Administrative Role Assumed — Restarting pki-tomcatd only generates ROLE_ASSUME for ipara and pkidbuser (excluded by the rule). Is there a CA operation that triggers ROLE_ASSUME for an actual admin user, or does it only happen through the PKI console?

  • New Constrained Delegation (S4U2Proxy) — Test sets up a service delegation rule and runs kvno -U admin ldap/ipa.example.test as HTTP/ipa.example.test, but it fails with "client and server principal names must match." The delegation config looks right but the TGS_REQ never includes the CONSTRAINED-DELEGATION flag. Anyone got S4U2Proxy working in a FreeIPA test environment?

@terrancedejesus terrancedejesus self-requested a review April 6, 2026 13:38
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