CyberArk configuration

This section explains how to configure Zabbix to retrieve secrets from CyberArk Vault CV12.

The vault should be installed and configured as per the official CyberArk documentation.

To learn about configuring TLS in Zabbix, see Storage of secrets section.

Database credentials

Access to a secret with database credentials is configured for each Zabbix component separately.

Server and proxies

To obtain database credentials for Zabbix server or proxy from the vault, specify the following configuration parameters in the configuration file:

  • Vault - specifies which vault provider should be used.

  • VaultURL - vault server HTTP[S] URL.

  • VaultDBPath - query to the vault secret containing database credentials. The credentials will be retrieved by keys ‘Content’ and ‘UserName’.
  • VaultTLSCertFile, VaultTLSKeyFile - SSL certificate and key file names. Setting up these options is not mandatory, but highly recommended.

Zabbix server also uses these configuration parameters (except VaultDBPath) for vault authentication when processing vault secret macros.

Zabbix server and Zabbix proxy read the vault-related configuration parameters from zabbix_server.conf and zabbix_proxy.conf upon startup.

Example

In zabbix_server.conf, specify:

  1. Vault=CyberArk
  2. VaultURL=https://127.0.0.1:1858
  3. VaultDBPath=zabbix_server&Query=Safe=passwordSafe;Object=zabbix_server_database
  4. VaultTLSCertFile=cert.pem
  5. VaultTLSKeyFile=key.pem

Zabbix will send the following API request to the vault:

  1. $ curl \
  2. --header "Content type: application/json" \
  3. --cert cert.pem \
  4. --key key.pem \
  5. https://127.0.0.1:1858/AIMWebService/api/Accounts?AppID=zabbix_server&Query=Safe=passwordSafe;Object=zabbix_server_database

Vault response, from which the keys “Content” and “UserName” should be retrieved:

  1. {
  2. "Content": <password>,
  3. "UserName": <username>,
  4. "Address": <address>,
  5. "Database" :<Database>,
  6. "PasswordChangeInProcess":<PasswordChangeInProcess>
  7. }

As a result, Zabbix will use the following credentials for database authentication:

  • Username: <username>
  • Password: <password>

Frontend

To obtain database credentials for Zabbix frontend from the vault, specify required settings during frontend installation.

At the Configure DB Connection step, set Store credentials in parameter to CyberArk Vault.

CyberArk configuration - 图1

Then, fill in additional parameters:

ParameterMandatoryDefault valueDescription
Vault API endpointyeshttps://localhost:1858Specify the URL for connecting to the vault in the format scheme://host:port
Vault secret query stringyesA query, which specifies from where database credentials should be retrieved.
Example: AppID=foo&Query=Safe=bar;Object=buzz:key
Vault certificatesnoAfter marking the checkbox, additional parameters will appear allowing to configure client authentication.
While this parameter is optional, it is highly recommended to enable it for communication with the CyberArk Vault.
SSL certificate filenoconf/certs/cyberark-cert.pemPath to SSL certificate file. The file must be in PEM format.
If the certificate file contains also the private key, leave the SSL key file parameter empty.
SSL key filenoconf/certs/cyberark-key.pemName of the SSL private key file used for client authentication. The file must be in PEM format.

User macro values

To use CyberArk Vault for storing Vault secret user macro values:

  • Set the Vault provider parameter in the Administration -> General -> Other web interface section to CyberArk Vault.

CyberArk configuration - 图2

  • Make sure that Zabbix server is configured to work with CyberArk Vault.

The macro value should contain a query (as query:key).

See Vault secret macros for detailed information about macro value processing by Zabbix.

Query syntax

The colon symbol (:) is reserved for separating the query from the key. If a query itself contains a forward slash or a colon, these symbols should be URL-encoded (/ is encoded as %2F, : is encoded as %3A).

Example

In Zabbix: add user macro {$PASSWORD} with type Vault secret and value: AppID=zabbix_server&Query=Safe=passwordSafe;Object=zabbix:Content

CyberArk configuration - 图3

Zabbix will send API request to the vault:

  1. $ curl \
  2. --header "Content type: application/json" \
  3. --cert cert.pem \
  4. --key key.pem \
  5. https://127.0.0.1:1858/AIMWebService/api/Accounts?AppID=zabbix_server&Query=Safe=passwordSafe;Object=zabbix

Vault response, from which the key “Content” should be retrieved:

  1. {
  2. "Content": <password>,
  3. "UserName": <username>,
  4. "Address": <address>,
  5. "Database" :<Database>,
  6. "PasswordChangeInProcess":<PasswordChangeInProcess>
  7. }

Macro resolves to the value: <password>