Repository: bridgecrewio/checkov

Issue:
ERROR:checkov.terraform.checks.resource.gcp.CloudStorageSelfLogging:Failed to run check: Bucket should not log to itself for configuration
**Describe the bug**
Error during check with rule CKV_GCP_63 (not clearly identify)

Here is the result of my terraform plan for my GCS resource using [terraform google storage module](https://github.com/terraform-google-modules/terraform-google-cloud-storage)
```
resource "google_storage_bucket" "buckets" {
  bucket_policy_only          = (known after apply)
      force_destroy               = false
      id                          = (known after apply)
      labels                      = {
          "name" = "xxxxxxxx-bucket"
      }
      location                    = "EU"
      name                        = "xxxxxxxx-bucket"
      project                     = "xxxxxxxx-project"
      self_link                   = (known after apply)
      storage_class               = "STANDARD"
      uniform_bucket_level_access = true
      url                         = (known after apply)
      versioning {
          enabled = true
      }
  }
```

```
ERROR:checkov.terraform.checks.resource.gcp.CloudStorageSelfLogging:Failed to run check: Bucket should not log to itself for configuration
[[]], 'default_event_based_hold': [None], 'encryption': [[]], 'force_destroy': [False], 'labels': [{'name': ['xxxxxxxx-bucket'], 'start_line': [158], 'end_line': [160]}], 'lifecycle_rule': [[]], 'location': ['EU'], 'logging': [[]], 'name': ['xxxxxxxx-bucket'], 'project': ['xxxxxxxx-project'], 'requester_pays': [None], 'retention_policy': [[]], 'storage_class': ['STANDARD'], 'uniform_bucket_level_access': [True], 'versioning': [{'enabled': [True], 'start_line': [171], 'end_line': [173]}], 'website': [[]], 'start_line': [153], 'end_line': [176]} at file: /checkov.tfplan.json
Traceback (most recent call last):
  File "/usr/local/bin/checkov", line 5, in <module>
    run()
  File "/usr/local/lib/python3.8/site-packages/checkov/main.py", line 96, in run
    scan_reports = runner_registry.run(external_checks_dir=external_checks_dir, files=args.file,
  File "/usr/local/lib/python3.8/site-packages/checkov/common/runners/runner_registry.py", line 34, in run
    scan_report = runner.run(root_folder, external_checks_dir=external_checks_dir, files=files,
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py", line 65, in run
    self.check_tf_definition(report, runner_filter)
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py", line 79, in check_tf_definition
    self.run_block(definition[block_type], full_file_path, report, scanned_file,
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/plan_runner.py", line 95, in run_block
    results = registry.scan(scanned_file, entity, [], runner_filter)
  File "/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check_registry.py", line 109, in scan
    result = self.run_check(check, entity_configuration, entity_name, entity_type, scanned_file, skip_info)
  File "/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check_registry.py", line 115, in run_check
    result = check.run(scanned_file=scanned_file, entity_configuration=entity_configuration,
  File "/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check.py", line 62, in run
    raise e
  File "/usr/local/lib/python3.8/site-packages/checkov/common/checks/base_check.py", line 42, in run
    check_result['result'] = self.scan_entity_conf(entity_configuration, entity_type)
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/checks/resource/base_resource_check.py", line 17, in scan_entity_conf
    return self.scan_resource_conf(conf, entity_type)
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/checks/resource/base_resource_check.py", line 33, in wrapper
    return wrapped(self, conf)
  File "/usr/local/lib/python3.8/site-packages/checkov/terraform/checks/resource/gcp/CloudStorageSelfLogging.py", line 17, in scan_resource_conf
    if conf['logging'][0]['log_bucket']:
TypeError: list indices must be integers or slices, not str
```

**To Reproduce**
Steps to reproduce the behavior:
1. Using [terraform GCS module](https://github.com/terraform-google-modules/terraform-google-cloud-storage) in your terraform
2. Run checkov scan
3. See error

**Informations**
 - Checkov Version 1.0.799 (from docker image)


Discussion:
when skipping  CKV_GCP_63 the error still occurs

checkov -d . --quiet --skip-check CKV_GCP_63


using  
terraform-compliance==1.3.13 
checkov==1.0.821 
tf 0.13.6
I also got the same problem and I found it's a small bug in the CloudStorageLogging check. I can push a quick PR later to fix it
@carlobongiovanni  a PR is highly appreciated 

Resolving patch:
diff --git a/checkov/terraform/checks/resource/gcp/CloudStorageLogging.py b/checkov/terraform/checks/resource/gcp/CloudStorageLogging.py
--- a/checkov/terraform/checks/resource/gcp/CloudStorageLogging.py
+++ b/checkov/terraform/checks/resource/gcp/CloudStorageLogging.py
@@ -11,9 +11,9 @@ def __init__(self):
         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
 
     def scan_resource_conf(self, conf):
-        #check fot logging
-        if 'logging' in conf.keys():
-            if conf['logging'][0]['log_bucket']:
+        #check for logging
+        if 'logging' in conf:
+            if conf['logging'][0]:
                 log_bucket_name = conf['logging'][0]['log_bucket']
                 if log_bucket_name != None:
                     return CheckResult.PASSED
diff --git a/checkov/terraform/checks/resource/gcp/CloudStorageSelfLogging.py b/checkov/terraform/checks/resource/gcp/CloudStorageSelfLogging.py
--- a/checkov/terraform/checks/resource/gcp/CloudStorageSelfLogging.py
+++ b/checkov/terraform/checks/resource/gcp/CloudStorageSelfLogging.py
@@ -12,9 +12,9 @@ def __init__(self):
 
     def scan_resource_conf(self, conf):
         bucket_name = conf['name']
-        #check fot logging
-        if 'logging' in conf.keys():
-            if conf['logging'][0]['log_bucket']:
+        #check for logging
+        if 'logging' in conf:
+            if conf['logging'][0]:
                 log_bucket_name = conf['logging'][0]['log_bucket']
                 if log_bucket_name != bucket_name:
                     return CheckResult.PASSED


Test patch: