9.4.6. Vault で SSE-KMS を使用するための Ceph Object Gateway の設定
キー管理に SSE-KMS で HashiCorp Vault を使用するように Ceph Object Gateway を設定するには、それを暗号化キーストアとして設定する必要があります。現在、Ceph Object Gateway は 2 つの異なるシークレットエンジンと、2 つの異なる認証方法をサポートしています。
前提条件
- 稼働中の Red Hat Ceph Storage クラスターがある。
- Ceph Object Gateway ソフトウェアのインストール。
- Ceph Object Gateway ノードへのルートレベルのアクセス。
手順
ceph config set client.rgw OPTION VALUEコマンドを使用して、Vault を暗号化キーストアとして有効にします。構文
ceph config set client.rgw rgw_crypt_s3_kms_backend vault以下のオプションおよび値を追加します。
構文
ceph config set client.rgw rgw_crypt_vault_auth agent ceph config set client.rgw rgw_crypt_vault_addr http://VAULT_SERVER:8100- ユースケースに従ってポリシーをカスタマイズします。
role-id を取得します。
構文
vault read auth/approle/role/rgw-ap/role-id -format=json | \ jq -r .data.role_id > PATH_TO_FILEsecret-id を取得します。
構文
vault read auth/approle/role/rgw-ap/role-id -format=json | \ jq -r .data.secret_id > PATH_TO_FILEVault エージェントの設定を作成します。
例
pid_file = "/run/kv-vault-agent-pid" auto_auth { method "AppRole" { mount_path = "auth/approle" config = { role_id_file_path ="/root/vault_configs/kv-agent-role-id" secret_id_file_path ="/root/vault_configs/kv-agent-secret-id" remove_secret_id_file_after_reading ="false" } } } cache { use_auto_auth_token = true } listener "tcp" { address = "127.0.0.1:8100" tls_disable = true } vault { address = "http://10.8.128.9:8200" }systemctl を使用して永続デーモンを実行します。
例
[root@host03 ~]# /usr/local/bin/vault agent -config=/usr/local/etc/vault/rgw-agent.hcl- Vault エージェントの実行時に、トークンファイルに有効なトークンが設定されます。
Vault シークレットエンジン (キー/値または Transit) を選択します。
Key/Value を使用している場合は、以下の行を追加します。
例
[ceph: root@host03 /]# ceph config set client.rgw rgw_crypt_vault_secret_engine kvTransit を使用している場合は、以下の行を追加します。
例
[ceph: root@host03 /]# ceph config set client.rgw rgw_crypt_vault_secret_engine transit
ceph config set client.rgw OPTION VALUEコマンドを使用して、Vault 名前空間が暗号化の鍵を取得するように設定します。例
[ceph: root@host03 /]# ceph config set client.rgw rgw_crypt_vault_namespace testnamespace1パス接頭辞を設定し、Ceph Object Gateway が Vault から暗号化キーを取得する場所を制限します。
例
[ceph: root@host03 /]# ceph config set client.rgw rgw_crypt_vault_prefix /v1/secret/dataエクスポート可能な Transit キーの場合、以下のように接頭辞パスを設定します。
例
[ceph: root@host03 /]# ceph config set client.rgw rgw_crypt_vault_prefix /v1/transit/export/encryption-keyVault サーバーのドメイン名が
vault-serverである場合は、Ceph Object Gateway は以下の URL から暗号化されたトランジションキーを取得します。例
http://vault-server:8200/v1/transit/export/encryption-key
Ceph Object Gateway デーモンを再起動します。
ストレージクラスター内の個別のノードで Ceph Object Gateway を再起動するには、以下を実行します。
構文
systemctl restart ceph-CLUSTER_ID@SERVICE_TYPE.ID.service例
[root@host03 ~]# systemctl restart ceph-c4b34c6f-8365-11ba-dc31-529020a7702d@rgw.realm.zone.host01.gwasto.serviceストレージクラスター内のすべてのノードで Ceph Object Gateway を再起動するには、以下を実行します。
構文
ceph orch restart SERVICE_TYPE例
[ceph: root@host03 /]# ceph orch restart rgw