-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathmain.tf
More file actions
31 lines (27 loc) · 878 Bytes
/
main.tf
File metadata and controls
31 lines (27 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
terraform {
required_version = ">= 1.3.0"
required_providers {
google = {
source = "hashicorp/google"
version = "~> 5.0"
}
}
}
provider "google" {
project = "demo-project-id" # placeholder; not used by Checkov
region = "us-central1"
}
# Deliberately misconfigured GCS bucket to trigger findings:
# - uniform_bucket_level_access = false (bad)
# - public IAM member (bad)
resource "google_storage_bucket" "bad_bucket" {
name = "demo-checkov-bad-bucket-12345"
location = "US"
force_destroy = true
uniform_bucket_level_access = false # Checkov should flag CKV_GCP_31
}
resource "google_storage_bucket_iam_member" "public_reader" {
bucket = google_storage_bucket.bad_bucket.name
role = "roles/storage.objectViewer"
member = "allUsers" # Checkov should flag public access
}