Beta - Ensure Essential Contacts Is Configured For Organization
- Query id: 7bd9c6a8-3b1f-495c-9752-a4a9c4e1b29f
- Query name: Beta - Ensure Essential Contacts Is Configured For Organization
- Platform: Terraform
- Severity: Low
- Category: Access Control
- CWE: 862
- Risk score: 1.0
- URL: Github
Description¶
It is advisable to set up Essential Contacts to specify email addresses that Google Cloud can use to send important technical or security notifications.
Documentation
Code samples¶
Code samples with security vulnerabilities¶
Positive test num. 1 - tf file
data "google_organization" "org" {
organization = "123456789012"
}
resource "google_essential_contacts_contact" "positive1" {
parent = data.google_organization.org.name
email = "foo@bar.com"
language_tag = "en-GB"
notification_category_subscriptions = [
"LEGAL",
"SECURITY",
"SUSPENSION",
]
}
Positive test num. 2 - tf file
data "google_organization" "org" {
organization = "123456789012"
}
resource "google_essential_contacts_contact" "positive2" {
parent = data.google_organization.org.name
email = "foo@bar.com"
language_tag = "en-GB"
notification_category_subscriptions = [
"BILLING",
"PRODUCT_UPDATES",
]
}
Positive test num. 3 - tf file
resource "google_essential_contacts_contact" "positive3" {
parent = "organizations/123456789012"
email = "foo@bar.com"
language_tag = "en-GB"
notification_category_subscriptions = [
"LEGAL",
"SECURITY",
"SUSPENSION",
]
}
Positive test num. 4 - tf file
Code samples without security vulnerabilities¶
Negative test num. 1 - tf file
data "google_organization" "org" {
organization = "123456789012"
}
resource "google_essential_contacts_contact" "negative1" {
parent = data.google_organization.org.name
email = "foo@bar.com"
language_tag = "en-GB"
notification_category_subscriptions = [
"LEGAL",
"SECURITY",
"SUSPENSION",
"TECHNICAL"
]
}
Negative test num. 2 - tf file
data "google_organization" "org" {
organization = "123456789012"
}
resource "google_essential_contacts_contact" "negative2" {
parent = data.google_organization.org.name
email = "foo@bar.com"
language_tag = "en-GB"
notification_category_subscriptions = ["ALL"]
}
Negative test num. 3 - tf file
resource "google_essential_contacts_contact" "negative3" {
parent = "organizations/123456789012"
email = "foo@bar.com"
language_tag = "en-GB"
notification_category_subscriptions = [
"LEGAL",
"SECURITY",
"SUSPENSION",
"TECHNICAL"
]
}