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が配置された実行中の Kubernetes クラスター。
The
Project OwnerorOrganization Ownerrole in Atlas.Amazon Web Services KMS の有効なキー管理認証情報と暗号化のキー。詳細については、 「 Amazon Web Servicesでカスタマー マネージド キーを有効にするための前提条件 」を参照してください。
Atlas アカウントの想定されたIAMロール。 Atlas Kubernetes Operator を使用して想定されたIAMロールを設定するには、「統合クラウドプロバイダー統合の設定 」を参照してください。 Amazon Web Services暗号化のキーのロールベースのアクセスの詳細については、「 Amazon Web Services KMSによるカスタマー キーの管理 」を参照してください。
重要
暗号化キーをロールベースのアクセスに切り替えた場合、そのプロジェクトでは、ロールベースのアクセス構成を取り消して、暗号化のキーの認証情報ベースのアクセスに戻すことはできません。
Atlas Kubernetes Operator でAzure Key Vault を使用して保管時の暗号化を構成するには、次のものが必要です。
Atlas Kubernetes Operatorが配置された実行中の Kubernetes クラスター。
The
Project OwnerorOrganization Ownerrole in Atlas.Azure Key Vault の有効なキー管理認証情報と暗号化のキー。詳しくは、「 Azureでカスタマー マネージド キーを有効にするための前提条件 」を参照してください。
Google Cloud PlatformKMSでAtlas Kubernetes Operator を使用して保管時の暗号化を構成するには、次の手順を実行する必要があります。
Atlas Kubernetes Operatorが配置された実行中の Kubernetes クラスター。
The
Project OwnerorOrganization Ownerrole in Atlas.Google Cloud Platform KMS の有効なキー管理認証情報と暗号化のキー。詳しくは、「 Google Cloud Platformでカスタマー マネージド キーを有効にするための前提条件 」を参照してください。
手順
次の手順で、カスタマー マネージド キーを使用して Atlas データを暗号化します。
Create a secret with your AWS credentials.
次のパラメーターの値で シークレット を作成します。
Parameter | 説明 |
|---|---|
| マスター キーを暗号化および復号化するために使用する Amazon Web ServicesカスタマーstringMongoDB マスター キーを識別する一意の英数字 。 |
| カスタマー マスターAmazon Web Services Amazon Web Servicesキーを管理する権限を持つAmazon Web Services IAM ロールを識別する一意の ARN 。この値を見つけるには、次の手順に従います。
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
spec.encryptionAtRest.awsKmsパラメータを指定します。
spec.encryptionAtRest.awsKmsオブジェクトをspec.encryptionAtRest に追加する
AtlasProjectカスタム リソース内の 配列(次のパラメータを含む)Parameter説明spec.encryptionAtRest.awsKms.enabledFlag 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 tofalse. If you disable encryption at rest using AWS KMS, Atlas Kubernetes Operator removes the configuration details.spec.encryptionAtRest.awsKms.regionCMK が存在するAmazon Web Servicesリージョンを示すラベル。
spec.encryptionAtRest.awsKms.secretRef.nameAmazon Web Servicesの認証情報を含むシークレットの名前。
spec.encryptionAtRest.awsKms.secretRef.namespaceNamespace that contains your AWS credentials. If unspecified, this parameter defaults to the namespace of the
AtlasProjectcustom resource.You must use a secret that contains the values for
AccessKeyID,SecretAccessKey,CustomerMasterKeyID, andRoleID.次のコマンドを実行します:
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
クラスターのカスタマー マネージド キーを使用して保管時の暗号化を有効にします。
プロジェクトでカスタマー マネージド キーを使用して保管時の暗号化を有効にした後、データを暗号化するには、クラスター レベルで有効にする必要があります。
次のコマンドを実行して、spec.deploymentSpec.encryptionAtRestProvider を AtlasDeployment カスタムリソース に追加します。これにより、このクラスターの 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
Create a secret with your Azure credentials.
次のパラメーターの値で シークレット を作成します。
Parameter | 説明 |
|---|---|
| Azure Key Vault を識別する一意のキーを持つウェブ アドレス。 |
| stringキーを含むAzure Key Vault を識別する一意の 。 |
| Private data associated with the Azure Key Vault tenant you specify in |
| サブスクリプションを識別する一意の 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
spec.encryptionAtRest.azureKeyVaultパラメータを指定します。
spec.encryptionAtRest.azureKeyVault を追加するオブジェクトからspec.encryptionAtRest
AtlasProjectカスタム リソース内の 配列(次のパラメータを含む)Parameter説明spec.encryptionAtRest.azureKeyVault.azureEnvironmentAzure deployment location where the Azure account credentials reside. Valid values include
AZURE,AZURE_CHINA, andAZURE_GERMANY.spec.encryptionAtRest.azureKeyVault.clientIDAzure アプリケーションを識別する一意の 36 桁の 16 進数文字列。
spec.encryptionAtRest.azureKeyVault.enabledFlag 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 tofalse. If you disable encryption at rest using Azure key vault, Atlas Kubernetes Operator removes the configuration details.spec.encryptionAtRest.azureKeyVault.resourceGroupNameLabel 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.nameAzure認証情報を含むシークレットの名前。
spec.encryptionAtRest.azureKeyVault.secretRef.namespaceNamespace that contains your Azure credentials. If unspecified, this parameter defaults to the namespace of the
AtlasProjectcustom resource.spec.encryptionAtRest.azureKeyVault.tenantIDAzureサブスクリプション内のAzure 36Active Directory テナントを識別する一意の 桁の 16 進数文字列。Azure は、テナント プロパティ ページにテナントIDを表示します。
You must use a secret that contains the values for
KeyVaultName,KeyIdentifier,Secret, andSubscriptionID.次のコマンドを実行します:
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
クラスターのカスタマー マネージド キーを使用して保管時の暗号化を有効にします。
プロジェクトでカスタマー マネージド キーを使用して保管時の暗号化を有効にした後、データを暗号化するには、クラスター レベルで有効にする必要があります。
次のコマンドを実行することで、spec.deploymentSpec.encryptionAtRestProvider を AtlasDeployment カスタム リソース に追加し、このクラスターの 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
Create a secret with your Google Cloud credentials.
次のパラメーターの値で シークレット を作成します。
Parameter | 説明 |
|---|---|
| のキー バージョン リソース を表示する一意のリソースID Google Cloud PlatformKMSパス。 |
| 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
spec.encryptionAtRest.googleCloudKmsパラメータを指定します。
spec.encryptionAtRest.googleCloudKms の追加オブジェクトからspec.encryptionAtRest
AtlasProjectカスタム リソース内の 配列(次のパラメータを含む)Parameter説明spec.encryptionAtRest.googleCloudKms.enabledFlag 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 tofalse. If you disable encryption at rest using Google Cloud KMS, Atlas Kubernetes Operator removes the configuration details.spec.encryptionAtRest.googleCloudKms.secretRef.nameGoogle Cloud Platformの認証情報を含むシークレットの名前。
spec.encryptionAtRest.googleCloudKms.secretRef.namespaceGoogle Cloud Platformの認証情報を含む名前空間。 指定されていない場合、このパラメータはデフォルトで
AtlasProjectカスタム リソースの名前空間になります。You must use a secret that contains the values for
KeyVersionResourceIDandServiceAccountKey.次のコマンドを実行します:
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
クラスターのカスタマー マネージド キーを使用して保管時の暗号化を有効にします。
プロジェクトでカスタマー マネージド キーを使用して保管時の暗号化を有効にした後、データを暗号化するには、クラスター レベルで有効にする必要があります。
次のコマンドを実行して、spec.deploymentSpec.encryptionAtRestProvider を AtlasDeployment カスタム リソース に追加します。これにより、このクラスターの 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