1. Resources
  2. Detection rules
  3. Idira (formerly CyberArk) Directory Mapping Added or Changed

Idira (formerly CyberArk) Directory Mapping Added or Changed detection rules

A directory map decides which LDAP or Active Directory users are created in the Vault and with which authorizations. An attacker who changes one turns a directory group they control into Vault administrators.

Platform
Idira (formerly CyberArk)
Severity
High
Log source
Idira (formerly CyberArk) Vault audit log
Last updated
MITRE ATT&CK technique
T1098Account Manipulation
Rule formats
Sigmaand queries for: SplunkMicrosoft Sentinel
What an attacker needs
A Vault user with the Manage Directory Mapping authorization, and control of or membership in the directory group that the map names.
Impact
Every member of the mapped directory group becomes a Vault user with the map's authorizations, up to control of the Vault's users, Safes and policy.
Response
Restore the map from the last approved configuration or delete it, and disable the external users that were created through the map since the change.
Mitigation
Keep Vault administrators as native accounts instead of mapping a directory group to Vault Admins, and give Manage Directory Mapping to only a few administrators.
Vault event codes
2172182522541219280

How the attack works

When the Vault is integrated with an LDAP directory, directory maps provision users transparently: a map names an LDAP group or branch, the Vault location, the user type, the authentication method and the Vault authorizations that users created through it receive. Mapped external groups are added to Vault groups, and the built-in Vault admins mapping gives all Vault authorizations and membership of Vault Admins. Creating or changing a map needs the Manage Directory Mapping authorization.

An attacker with that authorization, or with a Vault Admins session, can add a map or edit an existing one so that a directory group they control, or a broad group such as all staff, is provisioned with administrative authorizations. Nobody is added to a Vault group by hand, so reviews that only look at group members miss it, and from then on control of the directory group is control of the Vault. Two further rules read codes 1 and 219 (Delete Directory Map, Delete Directory Map LDAP Branch) and codes 2 and 80 (Add External User, Add External Group). Maps are matched in the order of the list and the first one has the highest priority, so a deletion changes which map applies, and the external users and groups created after a change show whom it let in.

What must be collected. The rule reads the Vault's audit records forwarded by syslog in CEF format (SIEM integration, configured in DBParm.ini). The CEF header's Device Event Class ID carries the Vault audit action code: 254 is Add Directory Map, 252 is Update Directory Map, 217 and 218 are Add and Update Directory Map LDAP Branch. SyslogMessageCodeFilter must not exclude these codes.

What an attacker needs

  • A Vault user with the Manage Directory Mapping authorization. The REST API for creating a map also requires membership of Vault Admins and the Audit Users and Add/Update Users authorizations, and the caller can only put authorizations it holds itself into the map.
  • Control of, or membership in, the directory group that the map names.

Impact

Every member of the mapped directory group becomes a Vault user with the map's authorizations at next logon or synchronization. With the administrator mapping that is control of the Vault's users, Safes and policy, reachable by anyone who can change that group's membership in the directory.

Detection rules

CyberArk Directory Map Added or Updated

Detects a directory map being added or updated in the CyberArk Digital Vault (audit action codes 254, Add Directory Map; 252, Update Directory Map; 217, Add Directory Map LDAP Branch; 218, Update Directory Map LDAP Branch). A directory map decides which LDAP users are created in the Vault and which authorizations they receive. deviceEventClassId is the CEF header's Device Event Class ID, which CyberArk's syslog translator fills with the Vault audit action code.

LevelHighStatusExperimentalLog sourceIdira (formerly CyberArk) Vault audit log
title: CyberArk Directory Map Added or Updated
id: 155e33fa-e858-46d1-84fd-36f7ed084eaf
status: experimental
description: >-
  Detects a directory map being added or updated in the CyberArk Digital Vault
  (audit action codes 254, Add Directory Map; 252, Update Directory Map; 217,
  Add Directory Map LDAP Branch; 218, Update Directory Map LDAP Branch). A
  directory map decides which LDAP users are created in the Vault and which
  authorizations they receive. deviceEventClassId is the CEF header's Device
  Event Class ID, which CyberArk's syslog translator fills with the Vault
  audit action code.
references:
  - https://docs.cyberark.com/pam-self-hosted/latest/en/content/pasref/vault%20audit%20action%20codes.htm
  - https://docs.cyberark.com/pam-self-hosted/latest/en/content/landing%20pages/lpldapintegration.htm
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-11
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: cyberark
  service: vault
detection:
  selection:
    deviceEventClassId:
      - '217'
      - '218'
      - '252'
      - '254'
  condition: selection
falsepositives:
  - Setting up or reworking the LDAP integration; these changes are rare, so confirm each one with the administrator who made it.
level: high

False positives

  • Setting up or reworking the LDAP integration; these changes are rare, so confirm each one with the administrator who made it.

CyberArk Directory Map Deleted

Detects a directory map being deleted in the CyberArk Digital Vault (audit action codes 1, Delete Directory Map, and 219, Delete Directory Map LDAP Branch). CyberArk matches directory maps with users and groups from the external directory in the order of the list, and the first map has the highest priority. Deleting a map therefore changes which of the remaining maps decides the authorizations of a directory user, and a deleted map is also what is left when someone removes a map that was added for an attack. The code table gives the map name in Info1. deviceEventClassId is the CEF header's Device Event Class ID, which CyberArk's syslog translator fills with the Vault audit action code.

LevelMediumStatusExperimentalLog sourceIdira (formerly CyberArk) Vault audit log
title: CyberArk Directory Map Deleted
id: 0a3f5921-e6fd-48ad-82b7-bb0cb51cc974
status: experimental
description: >-
  Detects a directory map being deleted in the CyberArk Digital Vault (audit
  action codes 1, Delete Directory Map, and 219, Delete Directory Map LDAP
  Branch). CyberArk matches directory maps with users and groups from the
  external directory in the order of the list, and the first map has the
  highest priority. Deleting a map therefore changes which of the remaining
  maps decides the authorizations of a directory user, and a deleted map is
  also what is left when someone removes a map that was added for an attack.
  The code table gives the map name in Info1. deviceEventClassId is the CEF
  header's Device Event Class ID, which CyberArk's syslog translator fills
  with the Vault audit action code.
references:
  - https://docs.cyberark.com/pam-self-hosted/latest/en/content/pasref/vault%20audit%20action%20codes.htm
  - https://docs.cyberark.com/pam-self-hosted/latest/en/content/landing%20pages/lpldapintegration.htm
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: cyberark
  service: vault
detection:
  selection:
    deviceEventClassId:
      - '1'
      - '219'
  condition: selection
falsepositives:
  - Reworking the LDAP integration or removing a domain, which deletes all the maps of that domain at once. These changes are rare, so confirm each one with the administrator who made it.
level: medium

False positives

  • Reworking the LDAP integration or removing a domain, which deletes all the maps of that domain at once. These changes are rare, so confirm each one with the administrator who made it.

CyberArk External User or External Group Added

Detects a user or a group from an LDAP directory being created in the CyberArk Digital Vault (audit action codes 2, Add External User, and 80, Add External Group). These records are the effect of a directory map: the map decides who is created and with which authorizations. Each one is ordinary on its own, so the rule is for review and correlation. After a directory map was added or changed, the external users and groups that appear next show whom the change let in. The code table gives the user or group name in Info1. Codes 256 and 257 (Update External User, Update External Group) are left out: CyberArk applies a map's properties again when an existing LDAP user logs on, and the code table does not say when those codes are written. deviceEventClassId is the CEF header's Device Event Class ID, which CyberArk's syslog translator fills with the Vault audit action code.

LevelLowStatusExperimentalLog sourceIdira (formerly CyberArk) Vault audit log
title: CyberArk External User or External Group Added
id: 5b18c381-fe23-47ab-8efe-5d0b42539e4d
status: experimental
description: >-
  Detects a user or a group from an LDAP directory being created in the
  CyberArk Digital Vault (audit action codes 2, Add External User, and 80, Add
  External Group). These records are the effect of a directory map: the map
  decides who is created and with which authorizations. Each one is ordinary
  on its own, so the rule is for review and correlation. After a directory map
  was added or changed, the external users and groups that appear next show
  whom the change let in. The code table gives the user or group name in
  Info1. Codes 256 and 257 (Update External User, Update External Group) are
  left out: CyberArk applies a map's properties again when an existing LDAP
  user logs on, and the code table does not say when those codes are written.
  deviceEventClassId is the CEF header's Device Event Class ID, which
  CyberArk's syslog translator fills with the Vault audit action code.
references:
  - https://docs.cyberark.com/pam-self-hosted/latest/en/content/pasref/vault%20audit%20action%20codes.htm
  - https://docs.cyberark.com/pam-self-hosted/latest/en/content/landing%20pages/lpldapintegration.htm
  - https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098
logsource:
  product: cyberark
  service: vault
detection:
  selection:
    deviceEventClassId:
      - '2'
      - '80'
  condition: selection
falsepositives:
  - Every directory user who is provisioned through a map, which happens when the user first logs on or is added as a Safe member or group member. Expect regular volume and use the rule next to the directory map rules, or alert only on names that are not on your list of expected PAM users.
level: low

False positives

  • Every directory user who is provisioned through a map, which happens when the user first logs on or is added as a Safe member or group member. Expect regular volume and use the rule next to the directory map rules, or alert only on names that are not on your list of expected PAM users.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Directory map changed and external users or groups created shortly after

Detection hypothesisSequence of eventsNeeds your own lists

A changed map shows its purpose in who is provisioned next. External users or groups that the Vault creates in the hours after a directory map was added, updated or deleted, and that were not PAM users before, are the identities the change let in.

  1. The Vault records a directory map change: code 254 or 252 (Add or Update Directory Map), 217 or 218 (Add or Update Directory Map LDAP Branch), or 1 or 219 (the two deletions). The code table gives the map name in Info1.
  2. Within the next 24 hours the Vault records code 2 (Add External User) or code 80 (Add External Group), with the user or group name in Info1.
  3. Compare the new names with your list of expected PAM users and groups, and check in the directory when each new user joined the group that the map names.
  4. Follow each unexpected user in the Vault audit: its logons (code 7), its retrievals (codes 295 and 428) and the Safes it was added to (code 32).

Events2542522172181219280

LimitsA user who is covered by an older map and is provisioned for the first time in the same hours produces the same pair of events, so your list of expected users carries the hypothesis. Membership changes of the mapped directory group happen in the directory and are not in the Vault audit, so a new external user long after the last map change is not covered. The 24 hours are a starting point.

Triage

  • Open User Provisioning, LDAP Integration in the PVWA and read the changed map, including the LDAP group, the Vault groups and the authorizations in its user template.
  • Compare it with the previous configuration and ask who requested the change; identify the issuer (suser) of the audit record.
  • List the current members of the mapped directory group and recent membership changes to it in the directory.
  • If it was not approved, restore the map, then review the external users created through it and what they did.

Response

Once the attack is confirmed:

  1. Restore the map from the last approved configuration or delete it, and remove the mapped external group from the Vault groups it was added to.
  2. Disable the external users that were created through the map since the change, and remove the authorizations and group memberships they received.
  3. Suspend the Vault user that changed the map until the change is explained and take away its Manage Directory Mapping authorization.
  4. In the directory, remove the accounts that were added to the mapped group and find out who changed its membership. Control of that group was control of the Vault.
  5. Start a password change for the privileged accounts those users retrieved or connected with, and reverse the Safe member, user and policy changes they made.
  6. Review every other directory map and its user template, and confirm that no user provisioned through the changed map can still log on.

Mitigation

  • Follow CyberArk's design guidance and keep Vault administrators as native accounts instead of mapping a directory group to Vault Admins.
  • Give Manage Directory Mapping only to the few administrators who run the LDAP integration.
  • Where a directory group must be mapped to an administrative role, use a dedicated group that is protected as Tier 0 in the directory, and match it exactly rather than with a contains search.
  • Review the directory maps, their groups and their authorizations on a schedule, and alert on every change.

Frequently asked questions

Why do reviews of Vault Admins membership miss this change?

Nobody is added to a Vault group by hand. The map provisions users from a directory group with the map's authorizations, so a review that only looks at group members misses it. From then on, whoever can change the membership of that directory group decides who administers the Vault.

Does the alert show which group and authorizations the map now holds?

No. The rule matches the audit action codes for adding or updating a directory map or its LDAP branch, which are 254, 252, 217 and 218. Open User Provisioning, LDAP Integration in the PVWA to read the LDAP group, the Vault groups and the authorizations in the user template, and compare them with the previous configuration.

Is fixing the map enough once it has been abused?

No. In the Vault, external users may already have been created through the map and may have acted with its authorizations. In the directory, the attacker may still control or belong to the mapped group. Review the users created since the change and the recent membership changes of that group.

Who is able to add or change a directory map?

A Vault user with the Manage Directory Mapping authorization. The REST API for creating a map also requires membership of Vault Admins and the Audit Users and Add/Update Users authorizations, and the caller can only put authorizations it holds itself into the map. Give Manage Directory Mapping only to the few administrators who run the LDAP integration.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.