Skip to content

Commit 12e002e

Browse files
committed
merge with main
2 parents b3490ab + a4ea938 commit 12e002e

File tree

21 files changed

+1731
-303
lines changed

21 files changed

+1731
-303
lines changed

0-bootstrap/README-GitHub.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ See the shared folder [README.md](../1-org/envs/shared/README.md#inputs) for add
360360
```bash
361361
export ORG_STEP_SA=$(terraform -chdir="../gcp-bootstrap/envs/shared" output -raw organization_step_terraform_service_account_email)
362362
363-
gcloud scc notifications describe "scc-notify" --format="value(name)" --organization=${ORGANIZATION_ID} --impersonate-service-account=${ORG_STEP_SA}
363+
gcloud scc notifications describe "scc-notify" --format="value(name)" --organization=${ORGANIZATION_ID} --location=global --impersonate-service-account=${ORG_STEP_SA}
364364
```
365365

366366
1. If the notification exists the output will be:

0-bootstrap/README-GitLab.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ See the shared folder [README.md](../1-org/envs/shared/README.md#inputs) for add
417417
```bash
418418
export ORG_STEP_SA=$(terraform -chdir="../gcp-bootstrap/envs/shared" output -raw organization_step_terraform_service_account_email)
419419
420-
gcloud scc notifications describe "scc-notify" --format="value(name)" --organization=${ORGANIZATION_ID} --impersonate-service-account=${ORG_STEP_SA}
420+
gcloud scc notifications describe "scc-notify" --format="value(name)" --organization=${ORGANIZATION_ID} --location=global --impersonate-service-account=${ORG_STEP_SA}
421421
```
422422

423423
1. If the notification exists the output will be:

0-bootstrap/README-Jenkins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
397397

398398
```bash
399399
export ORGANIZATION_ID=$(terraform -chdir="../gcp-bootstrap/envs/shared" output -json common_config | jq '.org_id' --raw-output)
400-
gcloud scc notifications describe "scc-notify" --organization=${ORGANIZATION_ID}
400+
gcloud scc notifications describe "scc-notify" --organization=${ORGANIZATION_ID} --location=global
401401
```
402402

403403
1. Check if your organization already has an Access Context Manager Policy.

0-bootstrap/README-Terraform-Cloud.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ See the shared folder [README.md](../1-org/envs/shared/README.md#inputs) for add
329329
```bash
330330
export ORG_STEP_SA=$(terraform -chdir="../gcp-bootstrap/envs/shared" output -raw organization_step_terraform_service_account_email)
331331
332-
gcloud scc notifications describe "scc-notify" --format="value(name)" --organization=${ORGANIZATION_ID} --impersonate-service-account=${ORG_STEP_SA}
332+
gcloud scc notifications describe "scc-notify" --format="value(name)" --organization=${ORGANIZATION_ID} --location=global --impersonate-service-account=${ORG_STEP_SA}
333333
```
334334

335335
1. If the notification exists the output will be:

1-org/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ If required, run `terraform output cloudbuild_project_id` in the `0-bootstrap` f
146146

147147
```bash
148148
export ORGANIZATION_ID=$(terraform -chdir="../terraform-example-foundation/0-bootstrap/" output -json common_config | jq '.org_id' --raw-output)
149-
gcloud scc notifications describe "scc-notify" --organization=${ORGANIZATION_ID}
149+
gcloud scc notifications describe "scc-notify" --organization=${ORGANIZATION_ID} --location=global
150150
```
151151

152152
1. Check if your organization already has an Access Context Manager policy.
@@ -254,7 +254,7 @@ Create `gcp-org` folder, copy `1-org` content and Terraform wrapper script; ensu
254254

255255
```bash
256256
export ORGANIZATION_ID=$(terraform -chdir="../gcp-bootstrap/envs/shared" output -json common_config | jq '.org_id' --raw-output)
257-
gcloud scc notifications describe "scc-notify" --organization=${ORGANIZATION_ID}
257+
gcloud scc notifications describe "scc-notify" --organization=${ORGANIZATION_ID} --location=global
258258
```
259259

260260
1. Check if your organization already has an Access Context Manager policy.

1-org/envs/shared/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
| egress\_policies\_keys\_dry\_run | (Dry-run) A list of keys to use for the Terraform state. The order should correspond to var.egress\_policies\_dry\_run and the keys must not be dynamically computed. If `null`, var.egress\_policies\_dry\_run will be used as keys. | `list(string)` | `[]` | no |
1717
| enable\_hub\_and\_spoke | Enable Hub-and-Spoke architecture. | `bool` | `false` | no |
1818
| enable\_kms\_key\_usage\_tracking | Enable KMS centralized key usage tracking system. | `bool` | `true` | no |
19-
| 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 |
19+
| enable\_scc\_resources\_in\_terraform | Create Security Command Center resources in Terraform. Security Command Center must be activated before the creation of the resources. See [Overview of activating Security Command Center](https://cloud.google.com/security-command-center/docs/activate-scc-overview) before enabling this feature. | `bool` | `false` | no |
2020
| enforce\_allowed\_worker\_pools | Whether to enforce the organization policy restriction on allowed worker pools for Cloud Build. | `bool` | `false` | no |
2121
| essential\_contacts\_domains\_to\_allow | The list of domains that email addresses added to Essential Contacts can have. | `list(string)` | n/a | yes |
2222
| 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 |
@@ -42,7 +42,7 @@
4242
| resources | A list of GCP resources that are inside of the service perimeter. Currently only projects and VPC networks are allowed. | `list(string)` | `[]` | no |
4343
| resources\_dry\_run | A list of GCP resources that are inside of the service perimeter. Currently only projects and VPC networks are allowed. If set, a dry-run policy will be set. | `list(string)` | `[]` | no |
4444
| scc\_notification\_filter | Filter used to create the Security Command Center Notification, you can see more details on how to create filters in https://cloud.google.com/security-command-center/docs/how-to-api-filter-notifications#create-filter | `string` | `"state = \"ACTIVE\""` | no |
45-
| scc\_notification\_name | Name of the Security Command Center Notification. It must be unique in the organization. Run `gcloud scc notifications describe <scc_notification_name> --organization=org_id` to check if it already exists. | `string` | n/a | yes |
45+
| scc\_notification\_name | Name of the Security Command Center Notification. It must be unique in the organization. Run `gcloud scc notifications describe <scc_notification_name> --organization=org_id --location=global` to check if it already exists. | `string` | n/a | yes |
4646
| tfc\_org\_name | Name of the TFC organization | `string` | `""` | no |
4747

4848
## Outputs

1-org/envs/shared/scc_notification.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ resource "google_pubsub_subscription" "scc_notification_subscription" {
3131
project = module.scc_notifications.project_id
3232
}
3333

34-
resource "google_scc_notification_config" "scc_notification_config" {
34+
resource "google_scc_v2_organization_notification_config" "scc_notification_config" {
3535
count = var.enable_scc_resources_in_terraform ? 1 : 0
3636
config_id = var.scc_notification_name
3737
organization = local.org_id

1-org/envs/shared/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ variable "enable_hub_and_spoke" {
2727
}
2828

2929
variable "enable_scc_resources_in_terraform" {
30-
description = "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."
30+
description = "Create Security Command Center resources in Terraform. Security Command Center must be activated before the creation of the resources. See [Overview of activating Security Command Center](https://cloud.google.com/security-command-center/docs/activate-scc-overview) before enabling this feature."
3131
type = bool
3232
default = false
3333
}
@@ -44,7 +44,7 @@ variable "domains_to_allow" {
4444
}
4545

4646
variable "scc_notification_name" {
47-
description = "Name of the Security Command Center Notification. It must be unique in the organization. Run `gcloud scc notifications describe <scc_notification_name> --organization=org_id` to check if it already exists."
47+
description = "Name of the Security Command Center Notification. It must be unique in the organization. Run `gcloud scc notifications describe <scc_notification_name> --organization=org_id --location=global` to check if it already exists."
4848
type = string
4949
}
5050

1-org/modules/cai-monitoring/function-source/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const uuid4 = require('uuid4')
2121
const moment = require('moment')
2222

2323
// SCC client
24-
const { SecurityCenterClient } = require('@google-cloud/security-center');
24+
const { SecurityCenterClient } = require('@google-cloud/security-center').v2;
2525
const client = new SecurityCenterClient();
2626

2727
// Environment variables

0 commit comments

Comments
 (0)