CyberArk
Read scan credentials from CyberArk through the Central Credential Provider (CCP) REST API with a client certificate, or from CyberArk Conjur.
CyberArk
Central Credential Provider (CCP)
The runner calls the CCP REST API, GET /AIMWebService/api/Accounts?AppID=...&Safe=...&Object=..., authenticated by a client certificate, and reads the account's password (Content) or user name (UserName).
Reference
pam://cyberark-ccp/<AppID>/<Safe>/<Object>[?folder=<Folder>][#password|#username]Example: pam://cyberark-ccp/SafeguardScanner/DAST-Safe/app-login. Use pam://<name>/... with a configured name (for example pam://ccp-prod/...) when you run more than one CCP.
What the CyberArk administrator prepares
- An Application ID for Safeguard (for example
SafeguardScanner) with client certificate authentication, and Allowed Machines (or OS user) set to the runner host. - The Application ID and the Credential Provider added as members of the scan Safes, with Retrieve and List permission, and nothing else.
- The CCP address reachable from the runner over HTTPS, the CA that signed its certificate, and a client certificate and key for the runner.
Runner configuration
providers:
- name: ccp-prod
type: cyberark-ccp
url: https://ccp.example.internal
app_id: SafeguardScanner # references must use this AppID
client_cert: /etc/safeguard/ccp-client.pem
client_key: /etc/safeguard/ccp-client.key # unencrypted PEM, mode 600
ca_cert: /etc/safeguard/internal-root-ca.pem
reason: "Safeguard scan {{scan_ref}} on {{runner}}"
allowed_refs:
- "SafeguardScanner/DAST-Safe/*"
- "SafeguardScanner/Linux-Scan-Safe/*"Every request carries CCP's Reason parameter, so the Vault's own audit shows which Safeguard scan and runner retrieved the password. Without reason the text is Safeguard scan <scan> on <runner>.
Errors
CCP's ErrorCode decides the code. The message CCP returns is not shown, because it can echo the request.
| CCP answer | Code | What to check |
|---|---|---|
HTTP 401, or APPAP282E, APPAP306E (certificate, machine or AppID refused) | AUTH_FAILED | client_cert, client_key, and that this machine is allowed for the AppID |
HTTP 403, or APPAP004E | FORBIDDEN | The AppID's membership and Retrieve permission on the Safe |
HTTP 404, or APPAP227E, APPAP229E | NOT_FOUND | Safe, Object and folder names |
| Certificate not trusted | TLS | ca_cert |
CyberArk Conjur
The runner signs in to Conjur with a host API key (POST /authn/<account>/<login>/authenticate) or a JWT (POST /authn-jwt/<service_id>/<account>/authenticate), then reads GET /secrets/<account>/variable/<id>. The access token is reused for 5 minutes and renewed once on a 401.
Reference
pam://cyberark-conjur/<variable-id>Example: pam://cyberark-conjur/scanning/dast/app-login/password (percent-encode characters other than letters, digits, -, ., _ and /).
What the Conjur administrator prepares
A host for the runner whose policy grants read and execute on the scan variables only, and its API key; or a JWT authenticator (service_id) that trusts a token the runner can present.
Runner configuration
providers:
- type: cyberark-conjur
url: https://conjur.example.internal
account: myorg
auth: api-key # or: jwt
login: host/safeguard/runner-dc1
api_key: file:///etc/safeguard/conjur-api-key
# for auth: jwt
# service_id: safeguard
# jwt: file:///var/run/secrets/safeguard/jwt
ca_cert: /etc/safeguard/internal-root-ca.pem