Repository: bridgecrewio/checkov

Issue:
CKV_GCP_29 - Checks failed after GCP resource renamed
**Describe the bug**
Google has renamed the value
`bucket_policy_only ` to `uniform_bucket_level_access`.

When adding the new value in the configuration the check CKV_GCP_29 ( Ensure that Cloud Storage buckets have uniform bucket-level access enabled ) still fails as it is still looking for the old value

**To Reproduce**
Steps to reproduce the behavior:
1. On tearragoat, add the value `uniform_bucket_level_access = true` and the checks will still fail


**Expected behavior**
The check should pass.


Discussion:
metahertz: Thanks for the PR @hpapadopoulos 

Tested on the following sample with both `uniform_bucket_level_access = true` and `bucket_policy_only = true` and failure when none are present. LGTM.

```
Passed checks: 1, Failed checks: 1, Skipped checks: 0

Check: CKV_GCP_29: "Ensure that Cloud Storage buckets have uniform bucket-level access enabled"
	PASSED for resource: google_storage_bucket.static-site
	File: /589.tf:1-16
	Guide: https://docs.bridgecrew.io/docs/bc_gcp_gcs_2
```
hpapadopoulos: Have added the test for this. Could you have a look when you get a minute please?

Thank you
schosterbarak: @hpapadopoulos LGTM, Thank you!

Patch:
diff --git a/checkov/terraform/checks/resource/gcp/GoogleStorageBucketUniformAccess.py b/checkov/terraform/checks/resource/gcp/GoogleStorageBucketUniformAccess.py
index 9c11a8645..7fed77bcd 100644
--- a/checkov/terraform/checks/resource/gcp/GoogleStorageBucketUniformAccess.py
+++ b/checkov/terraform/checks/resource/gcp/GoogleStorageBucketUniformAccess.py
@@ -11,7 +11,7 @@ class GoogleStorageBucketUniformAccess(BaseResourceValueCheck):
         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
 
     def get_inspected_key(self):
-        return 'bucket_policy_only/[0]'
+        return 'uniform_bucket_level_access/[0]/bucket_policy_only/[0]'
 
 
 check = GoogleStorageBucketUniformAccess()


Test patch:
diff --git a/tests/terraform/checks/resource/gcp/test_GoogleStorageBucketUniformAccess.py b/tests/terraform/checks/resource/gcp/test_GoogleStorageBucketUniformAccess.py
index fab4827de..606d3460d 100644
--- a/tests/terraform/checks/resource/gcp/test_GoogleStorageBucketUniformAccess.py
+++ b/tests/terraform/checks/resource/gcp/test_GoogleStorageBucketUniformAccess.py
@@ -20,13 +20,13 @@ class TestGoogleStorageBucketUniformAccess(unittest.TestCase):
         scan_result = check.scan_resource_conf(conf=resource_conf)
         self.assertEqual(CheckResult.FAILED, scan_result)
 
-    def test_success(self):
+    def test_success_bucket_policy(self):
         hcl_res = hcl2.loads("""
                         resource "google_storage_bucket" "static-site" {
                           name          = "image-store.com"
                           location      = "EU"
                           force_destroy = true
-                          
+
                           bucket_policy_only = true
                         }
                         """)
@@ -34,6 +34,20 @@ class TestGoogleStorageBucketUniformAccess(unittest.TestCase):
         scan_result = check.scan_resource_conf(conf=resource_conf)
         self.assertEqual(CheckResult.PASSED, scan_result)
 
+    def test_success_bucket_uniform(self):
+         hcl_res = hcl2.loads("""
+                         resource "google_storage_bucket" "static-site" {
+                           name          = "image-store.com"
+                           location      = "EU"
+                           force_destroy = true
+
+                           uniform_bucket_level_access = true
+                         }
+                         """)
+         resource_conf = hcl_res['resource'][0]['google_storage_bucket']['static-site']
+         scan_result = check.scan_resource_conf(conf=resource_conf)
+         self.assertEqual(CheckResult.PASSED, scan_result)
+
 
 if __name__ == '__main__':
     unittest.main()