1. Resources
  2. Detection rules
  3. SSH Public Key Added to a Vault User in Idira (formerly CyberArk)

SSH Public Key Added to a Vault User in Idira (formerly CyberArk) detection rules

An attacker with the Reset Users' Passwords authorization adds a public SSH key to another Vault user. The matching private key then authenticates to the Vault through PSM for SSH as that user, without its password.

Platform
Idira (formerly CyberArk)
Severity
High
Log source
Idira (formerly CyberArk) Vault audit log
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft Sentinel
What an attacker needs
A Vault user with the Reset Users' Passwords authorization and a target user in the same Vault Location or lower that can authenticate through PSM for SSH.
Impact
Key-based authentication to the Vault through PSM for SSH as the target user, which keeps working after the owner changes the password.
Response
Delete the public SSH key from the target user, list the keys of the other users the issuer could reach and suspend the issuer.
Mitigation
Give Reset Users' Passwords to few named administrators and place the users of Vault administrators in a Location above the help desk's.
Vault event codes
442441

How the attack works

Privileged Session Manager for SSH lets a user authenticate to the Vault with a private SSH key instead of a password. For that, a corresponding public key must be assigned to the Vault user, and a user can have several. Adding one is an administrative action: the REST method needs the Reset Users' Passwords authorization and a target in the same Vault Location or lower, and CyberArk states that a user cannot manage their own public SSH keys.

An attacker who controls a user with that authorization adds a key of their own to a more useful Vault user. Unlike a password reset, the owner notices nothing: the password still works and nothing is locked. The attacker's private key now opens connections to target systems through PSM for SSH as that user, with the privileged accounts the user is allowed to use, and it keeps working after the owner changes the password. The Vault records the action with code 441 (Add SSH Public Keys Succeeded) and a failed attempt with code 442 (Add SSH Public Keys Failed). Keys of directory users can also be managed in the LDAP directory, in which case a new key is a change of a directory attribute and never reaches the Vault's audit.

What must be collected. The rules read 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 and the extension key suser carries the issuer, the Vault user who added the key. SyslogMessageCodeFilter must not exclude codes 441 and 442. By default all codes are sent.

What an attacker needs

  • A Vault user with the Reset Users' Passwords authorization.
  • A target user in the same Vault Location or lower. The attacker's own user does not qualify, because a user cannot manage their own public SSH keys.
  • A PSM for SSH server that accepts SSH key authentication for the target user, and network access to it.

Impact

Key-based authentication to the Vault through PSM for SSH as the target user, and with it sessions to the target systems that user may connect to, with the privileged accounts of its Safes. The key is independent of the user's password, so a password change does not remove it. CyberArk lists the SSH key as an authentication method of its own next to password, LDAP and RADIUS, so the controls that protect the user's other logons have to be checked separately for the key.

Detection rules

Adding an SSH Public Key to a CyberArk Vault User Failed

Detects a failed attempt to add a public SSH key to a user of the CyberArk Digital Vault (audit action code 442, Add SSH Public Keys Failed). The code table flags the code in its Alert column, which CyberArk explains as an unauthorized operation, and gives two user names in Info1 and Info2. Adding a key needs the Reset Users' Passwords authorization and a target in the same Vault Location or lower, and a user cannot manage their own keys. A failure means that someone tried to give a Vault user a key without meeting those conditions. No key was added. Look for a successful addition (code 441) for the same target by another issuer afterwards. The code table gives no reason for the failure, so the rule matches the code alone. 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: Adding an SSH Public Key to a CyberArk Vault User Failed
id: d8f3341b-9712-49e5-b726-77f4947b2d7f
status: experimental
description: >-
  Detects a failed attempt to add a public SSH key to a user of the CyberArk
  Digital Vault (audit action code 442, Add SSH Public Keys Failed). The code
  table flags the code in its Alert column, which CyberArk explains as an
  unauthorized operation, and gives two user names in Info1 and Info2. Adding
  a key needs the Reset Users' Passwords authorization and a target in the
  same Vault Location or lower, and a user cannot manage their own keys. A
  failure means that someone tried to give a Vault user a key without
  meeting those conditions. No key was added. Look for a successful
  addition (code 441) for the same target by another issuer afterwards. The
  code table gives no reason for the failure, so the rule matches the code
  alone. 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/webservices/add%20public%20ssh%20keys.htm
  - https://attack.mitre.org/techniques/T1098/004/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.004
logsource:
  product: cyberark
  service: vault
detection:
  selection:
    deviceEventClassId: '442'
  condition: selection
falsepositives:
  - A user who tries to add a key to their own Vault user, which CyberArk does not allow, or an administrator who tries it for a user in a Location above their own.
  - A key in a format the method does not accept. CyberArk documents that the key must not contain new lines or options. The code table does not say whether such a request writes this code.
level: low

False positives

  • A user who tries to add a key to their own Vault user, which CyberArk does not allow, or an administrator who tries it for a user in a Location above their own.
  • A key in a format the method does not accept. CyberArk documents that the key must not contain new lines or options. The code table does not say whether such a request writes this code.

SSH Public Key Added to a CyberArk Vault User

Detects a public SSH key being added to a user of the CyberArk Digital Vault (audit action code 441, Add SSH Public Keys Succeeded). CyberArk documents that a public key assigned to a Vault user allows authentication to the Vault through PSM for SSH with the corresponding private key, that adding one needs the Reset Users' Passwords authorization and a target in the same Vault Location or lower, and that a user cannot manage their own keys. Whoever holds the private key can then connect through PSM for SSH as that user, and the key keeps working after a password change. The code table gives two user names, in Info1 and Info2, without saying which is the target. deviceEventClassId is the CEF header's Device Event Class ID, which CyberArk's syslog translator fills with the Vault audit action code; the issuer who added the key is in suser.

LevelMediumStatusExperimentalLog sourceIdira (formerly CyberArk) Vault audit log
title: SSH Public Key Added to a CyberArk Vault User
id: 68102413-6958-40aa-9a69-8bc82412776b
status: experimental
description: >-
  Detects a public SSH key being added to a user of the CyberArk Digital
  Vault (audit action code 441, Add SSH Public Keys Succeeded). CyberArk
  documents that a public key assigned to a Vault user allows authentication
  to the Vault through PSM for SSH with the corresponding private key, that
  adding one needs the Reset Users' Passwords authorization and a target in
  the same Vault Location or lower, and that a user cannot manage their own
  keys. Whoever holds the private key can then connect through PSM for SSH
  as that user, and the key keeps working after a password change. The code
  table gives two user names, in Info1 and Info2, without saying which is
  the target. deviceEventClassId is the CEF header's Device Event Class ID,
  which CyberArk's syslog translator fills with the Vault audit action code;
  the issuer who added the key is in suser.
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/webservices/add%20public%20ssh%20keys.htm
  - https://docs.cyberark.com/pam-self-hosted/latest/en/content/pasimp/configuring-management-of-users-public-ssh-keys.htm
  - https://attack.mitre.org/techniques/T1098/004/
author: Forestall
date: 2026-11-18
tags:
  - attack.persistence
  - attack.privilege-escalation
  - attack.t1098.004
logsource:
  product: cyberark
  service: vault
detection:
  selection:
    deviceEventClassId: '441'
  condition: selection
falsepositives:
  - Administrators who assign a key to a user that asked for SSH key authentication to PSM for SSH. Confirm with the owner of the user that they hold the private key.
  - Onboarding scripts that assign keys to new users through the REST API.
level: medium

False positives

  • Administrators who assign a key to a user that asked for SSH key authentication to PSM for SSH. Confirm with the owner of the user that they hold the private key.
  • Onboarding scripts that assign keys to new users through the REST API.

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.

Public SSH key added to a user who then logs on from a station it has not used before

Detection hypothesisSequence of eventsNeeds a baseline

A key that the owner asked for is used from the owner's own workstation. A key that an attacker added is used from wherever the attacker is. The added key and the later logon are separate records, and the logon looks normal on its own. Together with the user's earlier stations they show a key in other hands.

  1. A public SSH key is added: code 441 (Add SSH Public Keys Succeeded). Keep the issuer (suser) and the user who received the key.
  2. Within 7 days that user logs on to the Vault: code 7 (Logon) with the user as suser. Read the Station of the audit record, which CyberArk's sample CEF translator sends as src.
  3. Compare the station with the stations of that user's logons in the 30 days before the key was added. Flag a station that was not seen before.

Events4417

LimitsCyberArk documents the Station as the real client address for web portal sessions only. For a logon through PSM for SSH it may be the address of the proxy, in which case every user shares it and the comparison shows nothing. The logon record does not say which authentication method was used. The 7 and 30 days are starting points.

Triage

  • Read the issuer (suser) and the station of the audit record. The code table gives two user names in Info1 and Info2 without saying which is which, so identify the user who received the key from the record and from the user's list of authorized keys.
  • Confirm with the owner of the target user that they asked for the key and hold the private key.
  • Check what the target is. A member of Vault Admins, or a user of Safes that hold Tier 0 accounts, raises the priority.
  • Look for sessions through PSM for SSH by the target user after the key was added, and for the client addresses they came from.
  • Look for other actions on the same target by the same issuer, such as a password reset (codes 316 and 317) or an activated Trusted Network Area (code 318).

Response

Once the attack is confirmed:

  1. Delete the public SSH key from the target user. CyberArk documents a REST method for it that needs the same authorization.
  2. List all authorized keys of the target user and of the other users the issuer could reach, and delete every key that has no owner.
  3. Suspend the issuer until the key is explained and take away its Reset Users' Passwords authorization.
  4. Review the PSM for SSH sessions the target user opened since the key was added, with their recordings, and start a password change for the accounts used in them.
  5. On the target systems of those sessions, remove what was set up during them, such as new accounts or keys.

Mitigation

  • Give the Reset Users' Passwords authorization to as few named administrators as possible. It manages public SSH keys as well as passwords.
  • Place the users of Vault administrators in a Location above the Location of the help desk, so that help desk users cannot add keys to them.
  • Set the AuthenticationMethod of the SSH proxy on purpose. Its default lets users authenticate with the method configured for them, and the Vault administrator can enforce one method for all users instead.
  • Review the public SSH keys of Vault users on a schedule and remove the ones nobody can account for.
  • Forward the Vault audit to your SIEM and alert on every added public SSH key.

Frequently asked questions

Does changing the Vault user's password remove an added SSH key?

No. The public key is assigned to the Vault user separately from its password, and a user can have several keys. The key works until someone deletes it. CyberArk documents a REST method that deletes an authorized public SSH key of a user, which needs the Reset Users' Passwords authorization.

Can a user add a public SSH key to their own Vault user?

No. CyberArk states that a user cannot manage their own public SSH keys. The key is added by another user who holds the Reset Users' Passwords authorization and is in the same Vault Location as the target or higher. For this reason the issuer and the user who received the key are always two different users.

Why does the rule not see keys of directory users in some environments?

By default the public SSH keys of LDAP users are managed in the Vault like those of other users, and the rule sees them. The setting LDAPUserSSHKeysManagement can move their management to the LDAP directory, where the key is read from a user attribute, sshPublicKey by default. A new key is then a change in the directory and must be detected there.

Is there a public incident report that describes this path?

No public incident report describes this at the audit event level. The page rests on what CyberArk documents about SSH key authentication to the Vault through PSM for SSH and about the REST methods that manage a user's public keys.

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.