1. Resources
  2. Detection sources
  3. 428

428: A private SSH key was retrieved from the Vault

Code 428 (Retrieve SSH Key): a private SSH key stored as an account in a Safe was retrieved. Whoever holds the key can log on to the machines that trust its public key, so retrievals outside the session manager need a reason.

Log source
Idira (formerly CyberArk) Vault audit log
Detection value
High
Volume
Low (estimate)
Last updated
Log
Idira Vault audit (Idira Vault audit, on by default)
Service
Idira Vault audit
Operation
428
Detects
4 attacks (2 rules · 5 detection logic)
MITRE ATT&CK
4 techniques in 5 tactics
Threat groups
14 groups that MITRE ATT&CK records using these techniques
Fields the rules read
deviceEventClassIdsuser

When it is written

The SSH Key Manager stores private SSH keys in the Vault as accounts, while their public keys sit on the target machines (by default in ~/.ssh/authorized_keys). CyberArk lists four ways to use a stored key: through PSM for SSH, through PSM, by applications and scripts that fetch it with Secrets Manager, and by retrieving the private key file to the user's own computer. A user retrieves the file from the web portal (the Retrieve button, or Download SSH key in the Versions tab, which also offers earlier versions) or with the REST method "Retrieve private SSH key account", which takes an optional reason, a ticket ID and a version number. Retrieving accounts takes the Retrieve accounts permission in the Safe, and the Master Policy's rule that users give a reason before they retrieve an account is active by default.

The Vault writes code 428 when an SSH key is retrieved. The code table gives no Info value and no description beyond the name, so it says neither where the record names the key nor whether component work (the CPM rotating a key, a PSM connection) or an application's retrieval through Secrets Manager writes it too. The key is expected in the record's File element (fname, the name of the target file in CyberArk's field list); confirm it with one record of your own. CyberArk also describes its REST method for passwords (Get password value) as returning the password or SSH key of an account, without saying which code such a call writes. The detection rule leaves out issuers whose names start with PasswordManager or PSMApp_, which it treats as the default names of the CPM user and the PSM application users, and reports the rest; a threshold rule counts 20 or more retrievals of passwords and SSH keys (codes 295 and 428) by one user within 15 minutes.

On Privilege Cloud, CyberArk's two lists disagree about this code: the table of audit action codes lists 427 (Store SSH Key) and 428, while the Audit service's list of Privilege Cloud events has neither PAM427 nor PAM428. CyberArk does not explain the difference, so check in your own tenant where key retrievals appear.

How to turn it on

Idira Vault audit records 428 calls to Idira Vault audit without any setup. Vendor documentation

The Vault writes an audit record, identified by its audit action code, for every user and Safe activity. The records appear in the User and Safe Activities report and in Export Vault Data (EVD) output, where the code table's Info1 and Info2 values are separate columns. They stay for the Master Policy's Activities audit retention period (90 days by default); a user's own activity records stay for the History days of its Time Limitations tab. CyberArk notes that a value of zero in either setting stops those activities from being written to the audit log.

The Vault is not a collection point. To send the records to a SIEM:

  • PAM Self-Hosted: on every Vault server, set the syslog parameters in Server\Conf\DBParm.ini (SyslogServerIP, SyslogServerPort, SyslogServerProtocol, SyslogTranslatorFile, UseLegacySyslogFormat, and SyslogTrustedCAPath for TLS) and restart the Vault. TLS, TCP and UDP are supported; UDP is the default.
  • SyslogMessageCodeFilter lists the codes that are sent. By default all codes of user and Safe activities are sent; a filter that leaves out the codes a rule reads silences that rule.
  • The translator decides the field names. An XSL file turns the Vault's XML record into the syslog message. These pages name the fields as CyberArk's sample CEF translator writes them. The Vault's record has more elements than that translator writes: OSUser, PvwaDetails (the user's reason, the ticket ID and connection details of web portal operations), GatewayStation (the address of the web portal server) and CAProperties (the account's own properties). They reach a SIEM only through a translator that adds them. Sample files for ArcSight, QRadar, McAfee ESM, RSA enVision and a generic format are copied to Server\Syslog on installation, and a SIEM's own add-on may ship another translator with other keys, so check one record of your own.
  • Privilege Cloud (Standard): deploy the Secure Tunnel and give Technical Support the SIEM server, port, protocol (TLS is recommended; TCP risks losing messages; UDP is not supported), the SIEM type (one of the same translators) and the TLS certificate. Up to five syslog servers can be connected.
  • Privilege Cloud on the Identity Security Platform also lists most of these events in the Audit service, with codes written as PAM<code>. Its list does not have every code of the Vault's tables (460 and 461, and 427 and 428, are missing from it), and the pages of those codes say so. Its SIEM export is a JSON API with its own field names, which these pages do not describe.
  • CyberArk states no delivery delay. The Vault queues syslog messages and writes a notification to its ITALog when more than SyslogMsgsQueueNotificationThreshold (1,000 by default) are waiting.
Show the syslog settings of the Vault (run on each Vault server, read only)
Select-String -Path 'C:\Program Files (x86)\PrivateArk\Server\Conf\DBParm.ini' -Pattern '^\s*(Syslog|UseLegacySyslogFormat)'
Based on vendor documentation.
List the translator files on the Vault server (read only)
Get-ChildItem -Path 'C:\Program Files (x86)\PrivateArk\Server\Syslog' -Filter '*.xsl'
Based on vendor documentation.

Fields

The operation’s own fields first, then the fields every Idira Vault audit record has. Field names are the JSON paths of the record as the vendor documents it.

FieldWhat it holds
msg.ReasonWhere the reason the user entered is expected: Reason in CyberArk's field list, which the REST method takes as its reason parameter. No vendor example shows this code's record. CyberArk's example record leaves Reason empty and shows a user's reason and a ticket ID inside its PvwaDetails element, which the sample CEF translator does not write, so confirm with one record of your own where the reason arrives.
Fields every Idira Vault audit record has (12)
FieldWhat it holds
deviceVendorDevice Vendor of the CEF header, from the record's Vendor element (a static value). CyberArk's two copies of its sample record disagree: one shows CyberArk, the other Idira. The samples of Splunk and Microsoft show Cyber-Ark. Read the value in a record of your own.
deviceProductDevice Product, Vault for audit records (VaultMonitor for the Vault's performance messages).
deviceVersionDevice Version, the version of the Vault.
deviceEventClassIdRead by 2 rulesDevice Event Class ID, from the MessageID element: the audit action code. The operation this page is about. The rules match this number, not the name.
nameName, from the Desc element: a static description of the code. CyberArk's wording varies (code 4 is "User Authentication" in one table, "User Authentication Failure" in another and "Authentication failed" in the sample record), so match on the code.
severitySeverity. The record's Severity element is Error or Info; the sample translator writes Critical as 10, Error as 7, Info as 5 and anything else as 0. CyberArk does not list the severity of each code.
suserRead by 2 rulesThe Issuer element: the Vault user who wrote the audit record, which CyberArk says is usually the user who performed the operation.
actThe Action element, a description of the audit record.
duserThe SourceUser element, which CyberArk's field list describes as the name of the Vault user who performed the operation.
fnameThe File element, the name of the target file (for account operations, expected to be the account's object in the Safe; CyberArk maps none of the code table's Info columns to it).
srcThe Station element, the address the operation came from. For sessions of the web portal (PVWA) it is the address of the user's own machine, not of the PVWA server.
msgOne string with nine parts separated by commas: TargetUser (the Vault user the operation was performed on), Safe (the target Safe), Location, Category, RequestId (the dual control request), Note, Reason (the reason the user entered), ExtraDetails and Message (the description again). The sample shows each part by name.

Values to know

suser

ValueMeaningSignal
a user that is not a CPM or PSM component userA person or script took a private key out of the VaultThe case the rule for retrievals by non-component users reports. Confirm the user needed the key file and not a PSM session.Attack signal
one user, 20 or more retrievals (codes 295 and 428) within 15 minutesCredentials taken in bulkThe case the threshold rule for retrievals reports.Attack signal
a name starting with PasswordManager or PSMApp_A component user, as the rule's filter treats itCheck that the name belongs to a component you run.Expected

Volume and noise

Depends on how keys are used. Where people connect through PSM for SSH, a retrieval of the key file is rare; where scripts or administrators take keys, it is routine for those users. A retrieval by a user that has not retrieved that key before, from an unusual address or hour, or in a burst, is the record to read first.

Keeping it manageable

  • List the users and scripts expected to retrieve key files, and the component users your deployment runs; compare the issuer with both.
  • Read the key (expected in fname), its Safe and the reason entered.
  • Look for a Master Policy change (code 385) by the same issuer before and after the retrieval.

Sample event

A Idira Vault audit record in the vendor’s format, with made-up values.

{
  "deviceVendor": "Cyber-Ark",
  "deviceProduct": "Vault",
  "deviceVersion": "14.6.0000",
  "deviceEventClassId": "428",
  "name": "Retrieve SSH Key",
  "severity": 5,
  "suser": "j.doe",
  "act": "",
  "duser": "",
  "fname": "db01.corp.example.com-svc-backup-sshkey",
  "src": "203.0.113.24",
  "msg": {
    "TargetUser": "",
    "Safe": "",
    "Location": "",
    "Category": "",
    "RequestId": "",
    "Note": "",
    "Reason": "Restore test on db01",
    "ExtraDetails": "",
    "Message": ""
  }
}

Attacks this event reveals

Detection rules that read this event:

Detection logic (hypotheses that join this event with others) for:

References