Skip to content

Commit a7cfe47

Browse files
review commit
1 parent a7c2c58 commit a7cfe47

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

1-org/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ to Bigquery and Pub/Sub. This will result in additional charges for those copies
8282

8383
- To use the **hub-and-spoke** architecture described in the **Networking** section of the [Google Cloud security foundations guide](https://cloud.google.com/architecture/security-foundations/networking#hub-and-spoke), set the `enable_hub_and_spoke` variable to `true`.
8484

85-
- As a KMS Administrator, you can [view all the keys in your organization from a centralized location](https://cloud.google.com/kms/docs/view-key-usage) by setting the `enable_kms_key_usage_tracking` variable to true.
86-
8785
- If you are using MacOS, replace `cp -RT` with `cp -R` in the relevant
8886
commands. The `-T` flag is required for Linux, but causes problems for MacOS.
8987

1-org/envs/shared/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
| create\_unique\_tag\_key | Creates unique organization-wide tag keys by adding a random suffix to each key. | `bool` | `false` | no |
99
| domains\_to\_allow | The list of domains to allow users from in IAM. Used by Domain Restricted Sharing Organization Policy. Must include the domain of the organization you are deploying the foundation. To add other domains you must also grant access to these domains to the Terraform Service Account used in the deploy. | `list(string)` | n/a | yes |
1010
| enable\_hub\_and\_spoke | Enable Hub-and-Spoke architecture. | `bool` | `false` | no |
11-
| enable\_kms\_key\_usage\_tracking | Enable KMS centralized key usage tracking system. | `bool` | `false` | no |
11+
| enable\_kms\_key\_usage\_tracking | Enable KMS centralized key usage tracking system. | `bool` | `true` | no |
1212
| enable\_scc\_resources\_in\_terraform | Create Security Command Center resources in Terraform. If your organization has newly enabled any preview features for SCC and get an error related to the v2 API, you must set this variable to false because the v2 API does not yet support Terraform resources. See [issue 1189](https://github.com/terraform-google-modules/terraform-example-foundation/issues/1189) for context. | `bool` | `false` | no |
1313
| enforce\_allowed\_worker\_pools | Whether to enforce the organization policy restriction on allowed worker pools for Cloud Build. | `bool` | `false` | no |
1414
| essential\_contacts\_domains\_to\_allow | The list of domains that email addresses added to Essential Contacts can have. | `list(string)` | n/a | yes |
1515
| essential\_contacts\_language | Essential Contacts preferred language for notifications, as a ISO 639-1 language code. See [Supported languages](https://cloud.google.com/resource-manager/docs/managing-notification-contacts#supported-languages) for a list of supported languages. | `string` | `"en"` | no |
1616
| folder\_deletion\_protection | Prevent Terraform from destroying or recreating the folder. | `string` | `true` | no |
17-
| gcp\_groups | Groups to grant specific roles in the Organization.<br> platform\_viewer: Google Workspace or Cloud Identity group that have the ability to view resource information across the Google Cloud organization.<br> security\_reviewer: Google Workspace or Cloud Identity group that members are part of the security team responsible for reviewing cloud security<br> network\_viewer: Google Workspace or Cloud Identity group that members are part of the networking team and review network configurations.<br> scc\_admin: Google Workspace or Cloud Identity group that can administer Security Command Center.<br> audit\_viewer: Google Workspace or Cloud Identity group that members are part of an audit team and view audit logs in the logging project.<br> global\_secrets\_admin: Google Workspace or Cloud Identity group that members are responsible for putting secrets into Secrets Management.<br> kms\_protected\_resources\_viewer: Google Workspace or Cloud Identity group that can search for kms protected resources. | <pre>object({<br> audit_viewer = optional(string, null)<br> security_reviewer = optional(string, null)<br> network_viewer = optional(string, null)<br> scc_admin = optional(string, null)<br> global_secrets_admin = optional(string, null)<br> kms_admin = optional(string, null)<br> kms_protected_resources_viewer = optional(string, null)<br> })</pre> | `{}` | no |
17+
| gcp\_groups | Groups to grant specific roles in the Organization.<br> platform\_viewer: Google Workspace or Cloud Identity group that have the ability to view resource information across the Google Cloud organization.<br> security\_reviewer: Google Workspace or Cloud Identity group that members are part of the security team responsible for reviewing cloud security<br> network\_viewer: Google Workspace or Cloud Identity group that members are part of the networking team and review network configurations.<br> scc\_admin: Google Workspace or Cloud Identity group that can administer Security Command Center.<br> audit\_viewer: Google Workspace or Cloud Identity group that members are part of an audit team and view audit logs in the logging project.<br> global\_secrets\_admin: Google Workspace or Cloud Identity group that members are responsible for putting secrets into Secrets Management. | <pre>object({<br> audit_viewer = optional(string, null)<br> security_reviewer = optional(string, null)<br> network_viewer = optional(string, null)<br> scc_admin = optional(string, null)<br> global_secrets_admin = optional(string, null)<br> kms_admin = optional(string, null)<br> })</pre> | `{}` | no |
1818
| log\_export\_storage\_force\_destroy | (Optional) If set to true, delete all contents when destroying the resource; otherwise, destroying the resource will fail if contents are present. | `bool` | `false` | no |
1919
| log\_export\_storage\_location | The location of the storage bucket used to export logs. | `string` | `null` | no |
2020
| log\_export\_storage\_retention\_policy | Configuration of the bucket's data retention policy for how long objects in the bucket should be retained. | <pre>object({<br> is_locked = bool<br> retention_period_days = number<br> })</pre> | `null` | no |

1-org/envs/shared/iam.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ resource "google_project_iam_member" "kms_admin" {
155155
member = "group:${var.gcp_groups.kms_admin}"
156156
}
157157

158+
resource "google_organization_iam_member" "kms_protected_resources_viewer" {
159+
count = var.gcp_groups.kms_admin != null && var.enable_kms_key_usage_tracking ? 1 : 0
160+
org_id = local.org_id
161+
role = "roles/cloudkms.protectedResourcesViewer"
162+
member = "group:${var.gcp_groups.kms_admin}"
163+
}
164+
158165
resource "google_project_iam_member" "cai_monitoring_builder" {
159166
project = module.scc_notifications.project_id
160167
for_each = toset(var.enable_scc_resources_in_terraform ?
@@ -166,10 +173,3 @@ resource "google_project_iam_member" "cai_monitoring_builder" {
166173
role = each.key
167174
member = "serviceAccount:${google_service_account.cai_monitoring_builder[0].email}"
168175
}
169-
170-
resource "google_organization_iam_member" "kms_protected_resources_viewer" {
171-
count = var.gcp_groups.kms_protected_resources_viewer != null && var.enable_kms_key_usage_tracking ? 1 : 0
172-
org_id = local.org_id
173-
role = "roles/cloudkms.protectedResourcesViewer"
174-
member = "group:${var.gcp_groups.kms_protected_resources_viewer}"
175-
}

1-org/envs/shared/variables.tf

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ variable "enable_scc_resources_in_terraform" {
2929
variable "enable_kms_key_usage_tracking" {
3030
description = "Enable KMS centralized key usage tracking system."
3131
type = bool
32-
default = false
32+
default = true
3333
}
3434

3535
variable "domains_to_allow" {
@@ -148,16 +148,14 @@ variable "gcp_groups" {
148148
scc_admin: Google Workspace or Cloud Identity group that can administer Security Command Center.
149149
audit_viewer: Google Workspace or Cloud Identity group that members are part of an audit team and view audit logs in the logging project.
150150
global_secrets_admin: Google Workspace or Cloud Identity group that members are responsible for putting secrets into Secrets Management.
151-
kms_protected_resources_viewer: Google Workspace or Cloud Identity group that can search for kms protected resources.
152151
EOT
153152
type = object({
154-
audit_viewer = optional(string, null)
155-
security_reviewer = optional(string, null)
156-
network_viewer = optional(string, null)
157-
scc_admin = optional(string, null)
158-
global_secrets_admin = optional(string, null)
159-
kms_admin = optional(string, null)
160-
kms_protected_resources_viewer = optional(string, null)
153+
audit_viewer = optional(string, null)
154+
security_reviewer = optional(string, null)
155+
network_viewer = optional(string, null)
156+
scc_admin = optional(string, null)
157+
global_secrets_admin = optional(string, null)
158+
kms_admin = optional(string, null)
161159
})
162160
default = {}
163161
}

0 commit comments

Comments
 (0)