AI エージェント向け: ドキュメントインデックスは https://www.mongodb.com/ja-jp/docs/llms.txt で利用できます。すべてのページの markdown バージョンは、いずれかの URL パスに .md を追加することで利用できます。
Docs Menu

KMSを使用したデータの暗号化

Atlas は、デフォルトで保管中のすべてのクラスター ストレージとスナップショット ボリュームを暗号化します。クラウドプロバイダーの KMS と MongoDB 暗号化されたストレージ エンジンを併用することで、セキュリティをさらに強化できます。

Atlas での保管時の暗号化には、次のカスタマーKMSプロバイダーの 1 つ以上を使用できます。

注意

キー管理プロバイダーは、クラスター クラウド サービス プロバイダーと同じである必要はありません。

Atlas でKMSを使用する方法の詳細については、以下を参照してください。

To manage your KMS encryption with Atlas Kubernetes Operator, you can specify and update the spec.encryptionAtRest parameter for the AtlasProject Custom Resource. Each time you change the spec field in any of the supported custom resources, Atlas Kubernetes Operator creates or updates the corresponding Atlas configuration.

Amazon Web ServicesKMSでAtlas Kubernetes Operator を使用して保管時の暗号化を設定するには、次のものが必要です。

重要

暗号化キーをロールベースのアクセスに切り替えた場合、そのプロジェクトでは、ロールベースのアクセス構成を取り消して、暗号化のキーの認証情報ベースのアクセスに戻すことはできません。

Atlas Kubernetes Operator でAzure Key Vault を使用して保管時の暗号化を構成するには、次のものが必要です。

Google Cloud PlatformKMSでAtlas Kubernetes Operator を使用して保管時の暗号化を構成するには、次の手順を実行する必要があります。

次の手順で、カスタマー マネージド キーを使用して Atlas データを暗号化します。

1

次のパラメーターの値で シークレット を作成します。

Parameter
説明

CustomerMasterKeyID

マスター キーを暗号化および復号化するために使用する Amazon Web ServicesカスタマーstringMongoDB マスター キーを識別する一意の英数字 。

RoleID

カスタマー マスターAmazon Web Services Amazon Web Servicesキーを管理する権限を持つAmazon Web Services IAM ロールを識別する一意の ARNこの値を見つけるには、次の手順に従います。

  1. マネジメントGo コンソールのRolesAmazon Web Services セクションに します。

  2. Atlas アクセス用に編集または作成したIAMロールをクリックします。

AWS displays the ARN in the Summary section.

シークレットを作成してラベルを付けるには、 Amazon Web Servicesの認証情報を使用して次のコマンドを実行します。

kubectl create secret generic aws-ear-creds \
--from-literal="CustomerMasterKeyID=<customer-master-key>" \
--from-literal="RoleID=<aws-arn>" \
-n mongodb-atlas-system
kubectl label secret aws-ear-creds atlas.mongodb.com/type=credentials -n mongodb-atlas-system
2
  1. spec.encryptionAtRest.awsKmsオブジェクトをspec.encryptionAtRest に追加するAtlasProject カスタム リソース内の 配列(次のパラメータを含む)

    Parameter
    説明

    spec.encryptionAtRest.awsKms.enabled

    Flag that indicates whether this project uses AWS KMS to encrypt data at rest. To enable encryption at rest using AWS KMS, set this parameter to true. To disable encryption at rest using AWS KMS, set this parameter to false. If you disable encryption at rest using AWS KMS, Atlas Kubernetes Operator removes the configuration details.

    spec.encryptionAtRest.awsKms.region

    CMK が存在するAmazon Web Servicesリージョンを示すラベル。

    spec.encryptionAtRest.awsKms.secretRef.name

    Amazon Web Servicesの認証情報を含むシークレットの名前。

    spec.encryptionAtRest.awsKms.secretRef.namespace

    Namespace that contains your AWS credentials. If unspecified, this parameter defaults to the namespace of the AtlasProject custom resource.

    You must use a secret that contains the values for AccessKeyID, SecretAccessKey, CustomerMasterKeyID, and RoleID.

  2. 次のコマンドを実行します:

    cat <<EOF | kubectl apply -f -
    apiVersion: atlas.mongodb.com/v1
    kind: AtlasProject
    metadata:
    name: my-project
    spec:
    name: Test Atlas Operator Project
    encryptionAtRest:
    awsKms:
    enabled: true
    region: US_EAST_1
    secretRef:
    name: aws-ear-creds
    namespace: mongodb-atlas-system
    EOF
3

次のコマンドを実行して、 Atlas Kubernetes OperatorがプロジェクトのAmazon Web Services KMS構成を検出しているかどうかを確認します。

kubectl get atlasprojects my-project -n mongodbatlas-system -o=jsonpath='{.status.conditions[?(@.type=="EncryptionAtRestReady")].status}'
true
4

プロジェクトでカスタマー マネージド キーを使用して保管時の暗号化を有効にした後、データを暗号化するには、クラスター レベルで有効にする必要があります。

次のコマンドを実行して、spec.deploymentSpec.encryptionAtRestProviderAtlasDeployment カスタムリソース に追加します。これにより、このクラスターの AWS キーを使用した保管時の暗号化が有効になります。

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
name: my-cluster
spec:
name: Test Atlas Operator Cluster
DeploymentSpec:
encryptionAtRestProvider: "AWS"
EOF
1

次のパラメーターの値で シークレット を作成します。

Parameter
説明

KeyIdentifier

Azure Key Vault を識別する一意のキーを持つウェブ アドレス。

KeyVaultName

stringキーを含むAzure Key Vault を識別する一意の 。

Secret

Private data associated with the Azure Key Vault tenant you specify in spec.encryptionAtRest.azureKeyVault.tenantID.

SubscriptionID

サブスクリプションを識別する一意の Azure36桁の 16 進数文字 。stringAzureでは、サブスクリプションの詳細ページにサブスクリプション ID が表示されます。

シークレットを作成してラベルを付けるには、 Azure認証情報を使用して次のコマンドを実行します。

kubectl create secret generic azure-ear-creds \
--from-literal="KeyIdentifier=<web-address>" \
--from-literal="KeyVaultName=<key-vault>" \
--from-literal="Secret=<secret>" \
--from-literal="SubscriptionID=<subscription>" \
-n mongodb-atlas-system
kubectl label secret azure-ear-creds atlas.mongodb.com/type=credentials -n mongodb-atlas-system
2
  1. spec.encryptionAtRest.azureKeyVault を追加するオブジェクトからspec.encryptionAtRestAtlasProject カスタム リソース内の 配列(次のパラメータを含む)

    Parameter
    説明

    spec.encryptionAtRest.azureKeyVault.azureEnvironment

    Azure deployment location where the Azure account credentials reside. Valid values include AZURE, AZURE_CHINA, and AZURE_GERMANY.

    spec.encryptionAtRest.azureKeyVault.clientID

    Azure アプリケーションを識別する一意の 36 桁の 16 進数文字列。

    spec.encryptionAtRest.azureKeyVault. enabled

    Flag that indicates whether this project uses Azure Key Vault to encrypt data at rest. To enable encryption at rest using Azure Key Vault, set this parameter to true. To disable encryption at rest using Azure Key Vault, set this parameter to false. If you disable encryption at rest using Azure key vault, Atlas Kubernetes Operator removes the configuration details.

    spec.encryptionAtRest.azureKeyVault.resourceGroupName

    Label that identifies the Azure resource group that contains your Azure Key Vault. Azure displays the resource group name on the resource group's details page.

    spec.encryptionAtRest.azureKeyVault.secretRef.name

    Azure認証情報を含むシークレットの名前。

    spec.encryptionAtRest.azureKeyVault.secretRef.namespace

    Namespace that contains your Azure credentials. If unspecified, this parameter defaults to the namespace of the AtlasProject custom resource.

    spec.encryptionAtRest.azureKeyVault. tenantID

    Azureサブスクリプション内のAzure 36Active Directory テナントを識別する一意の 桁の 16 進数文字列。Azure は、テナント プロパティ ページにテナントIDを表示します。

    You must use a secret that contains the values for KeyVaultName, KeyIdentifier, Secret, and SubscriptionID.

  2. 次のコマンドを実行します:

    cat <<EOF | kubectl apply -f -
    apiVersion: atlas.mongodb.com/v1
    kind: AtlasProject
    metadata:
    name: my-project
    spec:
    name: Test Atlas Operator Project
    encryptionAtRest:
    azureKeyVault:
    azureEnvironment: AZURE
    clientID: "12345678-90ab-cdef-1234-567890abcdef"
    enabled: true
    resourceGroupName: "myResourceGroup"
    tenantID: "e8e4b6ba-ff32-4c88-a9af-EXAMPLEID"
    secretRef:
    name: azure-ear-creds
    namespace: mongodb-atlas-system
    EOF
3

次のコマンドを実行して、Atlas Kubernetes Operator がプロジェクトのAzure Key Vault 構成を検出しているかどうかを確認します。

kubectl get atlasprojects my-project -o=jsonpath='{.status.conditions[?(@.type=="EncryptionAtRestReadyType")].status}
true
4

プロジェクトでカスタマー マネージド キーを使用して保管時の暗号化を有効にした後、データを暗号化するには、クラスター レベルで有効にする必要があります。

次のコマンドを実行することで、spec.deploymentSpec.encryptionAtRestProviderAtlasDeployment カスタム リソース に追加し、このクラスターの Azure キーを使用した保管時の暗号化を有効にします。

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
name: my-cluster
spec:
name: Test Atlas Operator Cluster
DeploymentSpec:
encryptionAtRestProvider: "AZURE"
EOF
1

次のパラメーターの値で シークレット を作成します。

Parameter
説明

KeyVersionResourceID

のキー バージョン リソース を表示する一意のリソースID Google Cloud PlatformKMSパス。

ServiceAccountKey

JSONGoogle Cloud PlatformKMSアカウントの 認証情報を含むGoogle Cloud Platform ファイル。

重要: JSONオブジェクトは適切に形式する必要があります。 ファイル内の認証情報フィールドを適切にインデントしていることを確認してください。

次の例は、 ServiceAccountKey JSONファイルの内容を示しています。

{
"type": "service_account",
"project_id": "my-project-common-0",
"private_key_id": "e120598ea4f88249469fcdd75a9a785c1bb3\",
"private_key": "-----BEGIN PRIVATE KEY-----\\nMIIEuwIBA(truncated)SfecnS0mT94D9\\n-----END PRIVATE KEY-----\\n\",
"client_email": "my-email-kms-0@my-project-common-0.iam.gserviceaccount.com\",
"client_id": "10180967717292066",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/my-email-kms-0%40my-project-common-0.iam.gserviceaccount.com"
"universe_domain": "googleapis.com"
}

シークレットを作成してラベルを付けるには、 Google Cloud Platformの認証情報を使用して次のコマンドを実行します。

kubectl create secret generic azure-ear-creds \
--from-literal="KeyVersionResourceID=<resource-id>" \
--from-file="ServiceAccountKey=<your-service-account-key-files.json>" \
-n mongodb-atlas-system
kubectl label secret gcp-ear-creds atlas.mongodb.com/type=credentials -n mongodb-atlas-system
2
  1. spec.encryptionAtRest.googleCloudKms の追加オブジェクトからspec.encryptionAtRestAtlasProject カスタム リソース内の 配列(次のパラメータを含む)

    Parameter
    説明

    spec.encryptionAtRest.googleCloudKms.enabled

    Flag that indicates whether this project uses Google Cloud KMS to encrypt data at rest. To enable encryption at rest using Google Cloud KMS, set this parameter to true. To disable encryption at rest using Google Cloud KMS, set this parameter to false. If you disable encryption at rest using Google Cloud KMS, Atlas Kubernetes Operator removes the configuration details.

    spec.encryptionAtRest.googleCloudKms.secretRef.name

    Google Cloud Platformの認証情報を含むシークレットの名前。

    spec.encryptionAtRest.googleCloudKms.secretRef.namespace

    Google Cloud Platformの認証情報を含む名前空間。 指定されていない場合、このパラメータはデフォルトでAtlasProjectカスタム リソースの名前空間になります。

    You must use a secret that contains the values for KeyVersionResourceID and ServiceAccountKey.

  2. 次のコマンドを実行します:

    cat <<EOF | kubectl apply -f -
    apiVersion: atlas.mongodb.com/v1
    kind: AtlasProject
    metadata:
    name: my-project
    spec:
    name: Test Atlas Operator Project
    encryptionAtRest:
    googleCloudKms:
    enabled: true
    secretRef:
    name: gcp-ear-creds
    namespace: mongodb-atlas-system
    EOF
3

次のコマンドを実行して、 Atlas Kubernetes OperatorがプロジェクトのGoogle Cloud Platform KMS構成を検出しているかどうかを確認します。

kubectl get atlasprojects my-project -o=jsonpath='{.status.conditions[?(@.type=="EncryptionAtRestReadyType")].status}
true
4

プロジェクトでカスタマー マネージド キーを使用して保管時の暗号化を有効にした後、データを暗号化するには、クラスター レベルで有効にする必要があります。

次のコマンドを実行して、spec.deploymentSpec.encryptionAtRestProviderAtlasDeployment カスタム リソース に追加します。これにより、このクラスターの Google Cloud キーを使用した保管時の暗号化が有効になります。

cat <<EOF | kubectl apply -f -
apiVersion: atlas.mongodb.com/v1
kind: AtlasDeployment
metadata:
name: my-cluster
spec:
name: Test Atlas Operator Cluster
DeploymentSpec:
encryptionAtRestProvider: "GCP"
EOF
このページを評価

項目一覧