This is a translation of the original English documentation page. Help us make it better.

1 CyberArkの設定

このセクションでは、CyberArk Vault CV12からシークレットを取得するようにZabbixを構成する方法について説明します。

Vaultは、公式のCyberArkドキュメントの説明に従ってインストールおよび構成する必要があります。

ZabbixでのTLSの構成については、シークレットの保存を参照してください。

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.

  1. zabbix_server.conf で、以下のパラメータを指定します。
Vault=CyberArk
       VaultURL=https://127.0.0.1:1858
       VaultDBPath=AppID=zabbix_server&Query=Safe=passwordSafe;Object=zabbix_server_database
       VaultTLSCertFile=cert.pem
       VaultTLSKeyFile=key.pem
       VaultPrefix=/AIMWebService/api/Accounts?
  1. Zabbix は以下の API リクエストを Vault に送信します。
curl \
       --header "Content-Type: application/json" \
       --cert cert.pem \
       --key key.pem \
       https://127.0.0.1:1858/AIMWebService/api/Accounts?AppID=zabbix_server&Query=Safe=passwordSafe;Object=zabbix_server_database
  1. Vault のレスポンスには、キー"Content"と"UserName"が含まれます。
{
       "Content": <パスワード>,
       "UserName": <ユーザー名>,
       "Address": <アドレス>,
       "Database": <データベース>,
       "PasswordChangeInProcess":<パスワード変更プロセス>
       }
  1. 結果として、Zabbix は以下のデータベース認証情報を使用します。認証:
  • Username: <ユーザー名>
  • 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.

Then, fill in additional parameters:

Parameter Mandatory Default value Description
Vault API endpoint yes https://localhost:1858 Specify the URL for connecting to the vault in the format scheme://host:port
Vault secret query string yes A query, which specifies from where database credentials should be retrieved.
Example: AppID=foo&Query=Safe=bar;Object=buzz:key
Vault certificates no After 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 file no conf/certs/cyberark-cert.pem Path 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 file no conf/certs/cyberark-key.pem Name of the SSL private key file used for client authentication. The file must be in PEM format.

ユーザーマクロ値

CyberArk Vault を使用して Vault シークレット ユーザーマクロ値を保存するには、以下の点を確認してください。

  • Zabbix サーバーが CyberArk Vault と連携するように 設定 されている。
  • 管理 → 一般 → その他Vault プロバイダー パラメータが「CyberArk Vault」に設定されている。

Vault の Vault シークレット マクロ値へのアクセスが必要なのは Zabbix サーバーのみです。

その他の Zabbix コンポーネント (プロキシ、フロントエンド) は、このようなアクセスを必要としません。

マクロ値にはクエリ(query:key 形式)を含める必要があります。

Zabbix によるマクロ値の処理の詳細については、Vault secret マクロ を参照してください。

クエリ構文

コロン記号 (":") は、クエリとキーを区切るために予約されています。

クエリ自体にスラッシュまたはコロンが含まれている場合、これらの記号は URL エンコードする必要があります ("/"は"%2F"、":"は"%3A"としてエンコードされます)

  1. Zabbix で、タイプが Vault secret で、値が AppID=zabbix_server&Query=Safe=passwordSafe;Object=zabbix:Content であるユーザーマクロ {$PASSWORD} を追加します。

  1. Zabbix は Vault に次の API リクエストを送信します。
curl \
       --header "Content-Type: application/json" \
       --cert cert.pem \
       --key key.pem \
       https://127.0.0.1:1858/AIMWebService/api/Accounts?AppID=zabbix_server&Query=Safe=passwordSafe;Object=zabbix_server_database
  1. Vault のレスポンスに "Content"キーが含まれます。:
{
           "Content": <パスワード>,
           "UserName": <ユーザー名>,
           "Address": <アドレス>,
           "Database" :<データベース>,
           "PasswordChangeInProcess":<パスワード変更プロセス>
       }
  1. その結果、Zabbix はマクロ {$PASSWORD} を値 <パスワード> に解決します。

Update existing configuration

To update an existing configuration for retrieving secrets from a CyberArk Vault:

  1. Update the Zabbix server or proxy configuration file parameters as described in the Database credentials section.

  2. Update the DB connection settings by reconfiguring Zabbix frontend and specifying the required parameters as described in the Frontend section. To reconfigure Zabbix frontend, open the frontend setup URL in the browser:

  • for Apache: http://<server_ip_or_name>/zabbix/setup.php
  • for Nginx: http://<server_ip_or_name>/setup.php

Alternatively, these parameters can be set in the frontend configuration file (zabbix.conf.php):

$DB['VAULT']                    = 'CyberArk';
       $DB['VAULT_URL']                = 'https://127.0.0.1:1858';
       $DB['VAULT_DB_PATH']            = 'AppID=foo&Query=Safe=bar;Object=buzz';
       $DB['VAULT_TOKEN']              = '';
       $DB['VAULT_CERT_FILE']          = 'conf/certs/cyberark-cert.pem';
       $DB['VAULT_KEY_FILE']           = 'conf/certs/cyberark-key.pem';
  1. Configure user macros as described in the User macro values section, if necessary.

To update an existing configuration for retrieving secrets from a HashiCorp Vault, see HashiCorp configuration.