-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: config application-level encryption for fl (#78)
- Loading branch information
1 parent
2e0c856
commit ce0b391
Showing
19 changed files
with
336 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ke/base/use-cases/federated-learning/terraform/key_management_service/.terraform.lock.hcl
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...e/base/use-cases/federated-learning/terraform/key_management_service/_cluster.auto.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../_shared_config/cluster.auto.tfvars |
1 change: 1 addition & 0 deletions
1
.../base/use-cases/federated-learning/terraform/key_management_service/_cluster_variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../_shared_config/cluster_variables.tf |
1 change: 1 addition & 0 deletions
1
.../base/use-cases/federated-learning/terraform/key_management_service/_platform.auto.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../_shared_config/platform.auto.tfvars |
1 change: 1 addition & 0 deletions
1
...base/use-cases/federated-learning/terraform/key_management_service/_platform_variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../_shared_config/platform_variables.tf |
1 change: 1 addition & 0 deletions
1
...base/use-cases/federated-learning/terraform/key_management_service/_terraform.auto.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../_shared_config/terraform.auto.tfvars |
1 change: 1 addition & 0 deletions
1
...ase/use-cases/federated-learning/terraform/key_management_service/_terraform_variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../_shared_config/terraform_variables.tf |
1 change: 1 addition & 0 deletions
1
...es/federated-learning/terraform/key_management_service/_uc_federated_learning.auto.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_shared_config/uc_federated_learning.auto.tfvars |
1 change: 1 addition & 0 deletions
1
...s/federated-learning/terraform/key_management_service/_uc_federated_learning_variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../_shared_config/uc_federated_learning_variables.tf |
57 changes: 57 additions & 0 deletions
57
platforms/gke/base/use-cases/federated-learning/terraform/key_management_service/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# KeyRings cannot be deleted; append a random suffix to the keyring name | ||
resource "random_id" "keyring_suffix" { | ||
byte_length = 4 | ||
} | ||
|
||
resource "google_kms_key_ring" "key_ring" { | ||
name = "${local.unique_identifier_prefix}-keyring-${random_id.keyring_suffix.hex}" | ||
project = google_project_service.cloudkms_googleapis_com.project | ||
location = var.cluster_region | ||
} | ||
|
||
resource "google_kms_crypto_key" "cluster_secrects_key" { | ||
name = "${local.unique_identifier_prefix}-clusterSecretsKey" | ||
key_ring = google_kms_key_ring.key_ring.id | ||
rotation_period = "7776000s" | ||
purpose = "ENCRYPT_DECRYPT" | ||
import_only = false | ||
skip_initial_version_creation = false | ||
|
||
lifecycle { | ||
prevent_destroy = false | ||
} | ||
|
||
version_template { | ||
# Ref: https://cloud.google.com/kms/docs/reference/rest/v1/CryptoKeyVersionAlgorithm | ||
algorithm = "GOOGLE_SYMMETRIC_ENCRYPTION" | ||
|
||
# Ref: https://cloud.google.com/kms/docs/reference/rest/v1/ProtectionLevel | ||
protection_level = "SOFTWARE" | ||
} | ||
} | ||
|
||
resource "google_kms_crypto_key_iam_binding" "cluster_secrets_decrypters" { | ||
role = "roles/cloudkms.cryptoKeyDecrypter" | ||
crypto_key_id = google_kms_crypto_key.cluster_secrects_key.id | ||
members = [local.gke_robot_service_account_iam_email] | ||
} | ||
|
||
resource "google_kms_crypto_key_iam_binding" "cluster_secrets_encrypters" { | ||
role = "roles/cloudkms.cryptoKeyEncrypter" | ||
crypto_key_id = google_kms_crypto_key.cluster_secrects_key.id | ||
members = [local.gke_robot_service_account_iam_email] | ||
} |
18 changes: 18 additions & 0 deletions
18
platforms/gke/base/use-cases/federated-learning/terraform/key_management_service/output.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
output "cluster_database_encryption_key_id" { | ||
description = "Id of the cluster database encryption key" | ||
value = google_kms_crypto_key.cluster_secrects_key.id | ||
} |
Oops, something went wrong.