We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Scanning IAM policy only takes First SID in json rather than looping through
**Describe the bug**
It seems when specifying more than one SID in a json, the policies do not loop through each one rather it just looks at the first one and ends. 

**To Reproduce**
Steps to reproduce the behavior:
1. Create policy with more than one SID
`{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "SqsAllow",
      "Effect": "Allow",
      "Action": [
        "sqs:GetQueueAttributes",
        "sqs:GetQueueUrl",
        "sqs:ListDeadLetterSourceQueues",
        "sqs:ListQueues",
        "sqs:ReceiveMessage",
        "sqs:SendMessage",
        "sqs:SendMessageBatch"
      ],
      "Resource": "*"
          },
    {
      "Sid": "ALL",
      "Effect": "Allow",
      "Action": [ "*"
      ],
      "Resource": ["*"]
    },`
2. Run Checkov against policy


**Expected behavior**
I would expect the scan to check each json within the policy rather than the first one



**Desktop (please complete the following information):**
 - OS: Mac
 - Checkov Version: 1.0.442




--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py`
Content:
```
1 from checkov.common.models.enums import CheckResult, CheckCategories
2 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
3 import json
4 
5 
6 class IAMStarActionPolicyDocument(BaseResourceCheck):
7 
8     def __init__(self):
9         name = "Ensure no IAM policies documents allow \"*\" as a statement's actions"
10         id = "CKV_AWS_63"
11         supported_resources = ['aws_iam_role_policy', 'aws_iam_user_policy', 'aws_iam_group_policy', 'aws_iam_policy']
12         categories = [CheckCategories.IAM]
13         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
14 
15     def scan_resource_conf(self, conf):
16         if 'policy' in conf.keys():
17             try:
18                 policy_block = json.loads(conf['policy'][0])
19                 if 'Statement' in policy_block.keys():
20                         if 'Action' in policy_block['Statement'][0] and \
21                                 policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \
22                                 policy_block['Statement'][0]['Action'][0] == "*":
23                             return CheckResult.FAILED
24             except: # nosec
25                 pass
26         return CheckResult.PASSED
27 
28 
29 check = IAMStarActionPolicyDocument()
30
```

Path: `checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py`
Content:
```
1 from checkov.common.models.enums import CheckResult, CheckCategories
2 from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
3 import json
4 
5 
6 class IAMAdminPolicyDocument(BaseResourceCheck):
7 
8     def __init__(self):
9         name = "Ensure IAM policies that allow full \"*-*\" administrative privileges are not created"
10         id = "CKV_AWS_62"
11         supported_resources = ['aws_iam_role_policy', 'aws_iam_user_policy', 'aws_iam_group_policy', 'aws_iam_policy']
12         categories = [CheckCategories.IAM]
13         super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)
14 
15     def scan_resource_conf(self, conf):
16         if 'policy' in conf.keys():
17             try:
18                 policy_block = json.loads(conf['policy'][0])
19                 if 'Statement' in policy_block.keys():
20                         if 'Action' in policy_block['Statement'][0] and \
21                                 policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \
22                                 policy_block['Statement'][0]['Action'][0] == "*" and \
23                                 'Resource' in policy_block['Statement'][0] and \
24                                 policy_block['Statement'][0]['Resource'] == '*':
25                             return CheckResult.FAILED
26             except: # nosec
27                 pass
28         return CheckResult.PASSED
29 
30 
31 check = IAMAdminPolicyDocument()
32
```

Path: `checkov/terraform/checks/data/aws/StarActionPolicyDocument.py`
Content:
```
1 from checkov.terraform.checks.data.base_check import BaseDataCheck
2 from checkov.common.models.enums import CheckResult, CheckCategories
3 
4 
5 class StarActionPolicyDocument(BaseDataCheck):
6     def __init__(self):
7         name = "Ensure no IAM policies documents allow \"*\" as a statement's actions"
8         id = "CKV_AWS_49"
9         supported_data = ['aws_iam_policy_document']
10         categories = [CheckCategories.IAM]
11         super().__init__(name=name, id=id, categories=categories, supported_data=supported_data)
12 
13     def scan_data_conf(self, conf):
14         """
15             validates iam policy document
16             https://learn.hashicorp.com/terraform/aws/iam-policy
17         :param conf: aws_kms_key configuration
18         :return: <CheckResult>
19         """
20         key = 'statement'
21         if key in conf.keys():
22             for statement in conf['statement']:
23                 if 'actions' in statement and '*' in statement['actions'][0] and statement.get('effect', ['Allow'])[0] == 'Allow':
24                     return CheckResult.FAILED
25         return CheckResult.PASSED
26 
27 
28 check = StarActionPolicyDocument()
29
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py b/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py
--- a/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py
+++ b/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py
@@ -19,7 +19,7 @@
         """
         key = 'statement'
         if key in conf.keys():
-            for statement in conf['statement']:
+            for statement in conf[key]:
                 if 'actions' in statement and '*' in statement['actions'][0] and statement.get('effect', ['Allow'])[0] == 'Allow':
                     return CheckResult.FAILED
         return CheckResult.PASSED
diff --git a/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py b/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py
--- a/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py
+++ b/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py
@@ -17,13 +17,13 @@
             try:
                 policy_block = json.loads(conf['policy'][0])
                 if 'Statement' in policy_block.keys():
-                        if 'Action' in policy_block['Statement'][0] and \
-                                policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \
-                                policy_block['Statement'][0]['Action'][0] == "*" and \
-                                'Resource' in policy_block['Statement'][0] and \
-                                policy_block['Statement'][0]['Resource'] == '*':
+                    for statement in policy_block['Statement']:
+                        if 'Action' in statement and \
+                                statement.get('Effect', ['Allow']) == 'Allow' and \
+                                '*' in statement.get('Action', ['']) and \
+                                '*' in statement.get('Resource', ['']):
                             return CheckResult.FAILED
-            except: # nosec
+            except:  # nosec
                 pass
         return CheckResult.PASSED
 
diff --git a/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py b/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py
--- a/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py
+++ b/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py
@@ -17,9 +17,10 @@
             try:
                 policy_block = json.loads(conf['policy'][0])
                 if 'Statement' in policy_block.keys():
-                        if 'Action' in policy_block['Statement'][0] and \
-                                policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \
-                                policy_block['Statement'][0]['Action'][0] == "*":
+                    for statement in policy_block['Statement']:
+                        if 'Action' in statement and \
+                                statement.get('Effect', ['Allow']) == 'Allow' and \
+                                '*' in statement.get('Action', ['']):
                             return CheckResult.FAILED
             except: # nosec
                 pass

{"golden_diff": "diff --git a/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py b/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py\n--- a/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py\n+++ b/checkov/terraform/checks/data/aws/StarActionPolicyDocument.py\n@@ -19,7 +19,7 @@\n         \"\"\"\n         key = 'statement'\n         if key in conf.keys():\n-            for statement in conf['statement']:\n+            for statement in conf[key]:\n                 if 'actions' in statement and '*' in statement['actions'][0] and statement.get('effect', ['Allow'])[0] == 'Allow':\n                     return CheckResult.FAILED\n         return CheckResult.PASSED\ndiff --git a/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py b/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py\n--- a/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py\n+++ b/checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py\n@@ -17,13 +17,13 @@\n             try:\n                 policy_block = json.loads(conf['policy'][0])\n                 if 'Statement' in policy_block.keys():\n-                        if 'Action' in policy_block['Statement'][0] and \\\n-                                policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \\\n-                                policy_block['Statement'][0]['Action'][0] == \"*\" and \\\n-                                'Resource' in policy_block['Statement'][0] and \\\n-                                policy_block['Statement'][0]['Resource'] == '*':\n+                    for statement in policy_block['Statement']:\n+                        if 'Action' in statement and \\\n+                                statement.get('Effect', ['Allow']) == 'Allow' and \\\n+                                '*' in statement.get('Action', ['']) and \\\n+                                '*' in statement.get('Resource', ['']):\n                             return CheckResult.FAILED\n-            except: # nosec\n+            except:  # nosec\n                 pass\n         return CheckResult.PASSED\n \ndiff --git a/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py b/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py\n--- a/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py\n+++ b/checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py\n@@ -17,9 +17,10 @@\n             try:\n                 policy_block = json.loads(conf['policy'][0])\n                 if 'Statement' in policy_block.keys():\n-                        if 'Action' in policy_block['Statement'][0] and \\\n-                                policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \\\n-                                policy_block['Statement'][0]['Action'][0] == \"*\":\n+                    for statement in policy_block['Statement']:\n+                        if 'Action' in statement and \\\n+                                statement.get('Effect', ['Allow']) == 'Allow' and \\\n+                                '*' in statement.get('Action', ['']):\n                             return CheckResult.FAILED\n             except: # nosec\n                 pass\n", "issue": "Scanning IAM policy only takes First SID in json rather than looping through\n**Describe the bug**\r\nIt seems when specifying more than one SID in a json, the policies do not loop through each one rather it just looks at the first one and ends. \r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Create policy with more than one SID\r\n`{\r\n  \"Version\": \"2012-10-17\",\r\n  \"Statement\": [\r\n    {\r\n      \"Sid\": \"SqsAllow\",\r\n      \"Effect\": \"Allow\",\r\n      \"Action\": [\r\n        \"sqs:GetQueueAttributes\",\r\n        \"sqs:GetQueueUrl\",\r\n        \"sqs:ListDeadLetterSourceQueues\",\r\n        \"sqs:ListQueues\",\r\n        \"sqs:ReceiveMessage\",\r\n        \"sqs:SendMessage\",\r\n        \"sqs:SendMessageBatch\"\r\n      ],\r\n      \"Resource\": \"*\"\r\n          },\r\n    {\r\n      \"Sid\": \"ALL\",\r\n      \"Effect\": \"Allow\",\r\n      \"Action\": [ \"*\"\r\n      ],\r\n      \"Resource\": [\"*\"]\r\n    },`\r\n2. Run Checkov against policy\r\n\r\n\r\n**Expected behavior**\r\nI would expect the scan to check each json within the policy rather than the first one\r\n\r\n\r\n\r\n**Desktop (please complete the following information):**\r\n - OS: Mac\r\n - Checkov Version: 1.0.442\r\n\r\n\r\n\n", "before_files": [{"content": "from checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\nimport json\n\n\nclass IAMStarActionPolicyDocument(BaseResourceCheck):\n\n    def __init__(self):\n        name = \"Ensure no IAM policies documents allow \\\"*\\\" as a statement's actions\"\n        id = \"CKV_AWS_63\"\n        supported_resources = ['aws_iam_role_policy', 'aws_iam_user_policy', 'aws_iam_group_policy', 'aws_iam_policy']\n        categories = [CheckCategories.IAM]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        if 'policy' in conf.keys():\n            try:\n                policy_block = json.loads(conf['policy'][0])\n                if 'Statement' in policy_block.keys():\n                        if 'Action' in policy_block['Statement'][0] and \\\n                                policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \\\n                                policy_block['Statement'][0]['Action'][0] == \"*\":\n                            return CheckResult.FAILED\n            except: # nosec\n                pass\n        return CheckResult.PASSED\n\n\ncheck = IAMStarActionPolicyDocument()\n", "path": "checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py"}, {"content": "from checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\nimport json\n\n\nclass IAMAdminPolicyDocument(BaseResourceCheck):\n\n    def __init__(self):\n        name = \"Ensure IAM policies that allow full \\\"*-*\\\" administrative privileges are not created\"\n        id = \"CKV_AWS_62\"\n        supported_resources = ['aws_iam_role_policy', 'aws_iam_user_policy', 'aws_iam_group_policy', 'aws_iam_policy']\n        categories = [CheckCategories.IAM]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        if 'policy' in conf.keys():\n            try:\n                policy_block = json.loads(conf['policy'][0])\n                if 'Statement' in policy_block.keys():\n                        if 'Action' in policy_block['Statement'][0] and \\\n                                policy_block['Statement'][0].get('Effect', ['Allow']) == 'Allow' and \\\n                                policy_block['Statement'][0]['Action'][0] == \"*\" and \\\n                                'Resource' in policy_block['Statement'][0] and \\\n                                policy_block['Statement'][0]['Resource'] == '*':\n                            return CheckResult.FAILED\n            except: # nosec\n                pass\n        return CheckResult.PASSED\n\n\ncheck = IAMAdminPolicyDocument()\n", "path": "checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py"}, {"content": "from checkov.terraform.checks.data.base_check import BaseDataCheck\nfrom checkov.common.models.enums import CheckResult, CheckCategories\n\n\nclass StarActionPolicyDocument(BaseDataCheck):\n    def __init__(self):\n        name = \"Ensure no IAM policies documents allow \\\"*\\\" as a statement's actions\"\n        id = \"CKV_AWS_49\"\n        supported_data = ['aws_iam_policy_document']\n        categories = [CheckCategories.IAM]\n        super().__init__(name=name, id=id, categories=categories, supported_data=supported_data)\n\n    def scan_data_conf(self, conf):\n        \"\"\"\n            validates iam policy document\n            https://learn.hashicorp.com/terraform/aws/iam-policy\n        :param conf: aws_kms_key configuration\n        :return: <CheckResult>\n        \"\"\"\n        key = 'statement'\n        if key in conf.keys():\n            for statement in conf['statement']:\n                if 'actions' in statement and '*' in statement['actions'][0] and statement.get('effect', ['Allow'])[0] == 'Allow':\n                    return CheckResult.FAILED\n        return CheckResult.PASSED\n\n\ncheck = StarActionPolicyDocument()\n", "path": "checkov/terraform/checks/data/aws/StarActionPolicyDocument.py"}], "after_files": [{"content": "from checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\nimport json\n\n\nclass IAMStarActionPolicyDocument(BaseResourceCheck):\n\n    def __init__(self):\n        name = \"Ensure no IAM policies documents allow \\\"*\\\" as a statement's actions\"\n        id = \"CKV_AWS_63\"\n        supported_resources = ['aws_iam_role_policy', 'aws_iam_user_policy', 'aws_iam_group_policy', 'aws_iam_policy']\n        categories = [CheckCategories.IAM]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        if 'policy' in conf.keys():\n            try:\n                policy_block = json.loads(conf['policy'][0])\n                if 'Statement' in policy_block.keys():\n                    for statement in policy_block['Statement']:\n                        if 'Action' in statement and \\\n                                statement.get('Effect', ['Allow']) == 'Allow' and \\\n                                '*' in statement.get('Action', ['']):\n                            return CheckResult.FAILED\n            except: # nosec\n                pass\n        return CheckResult.PASSED\n\n\ncheck = IAMStarActionPolicyDocument()\n", "path": "checkov/terraform/checks/resource/aws/IAMStarActionPolicyDocument.py"}, {"content": "from checkov.common.models.enums import CheckResult, CheckCategories\nfrom checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck\nimport json\n\n\nclass IAMAdminPolicyDocument(BaseResourceCheck):\n\n    def __init__(self):\n        name = \"Ensure IAM policies that allow full \\\"*-*\\\" administrative privileges are not created\"\n        id = \"CKV_AWS_62\"\n        supported_resources = ['aws_iam_role_policy', 'aws_iam_user_policy', 'aws_iam_group_policy', 'aws_iam_policy']\n        categories = [CheckCategories.IAM]\n        super().__init__(name=name, id=id, categories=categories, supported_resources=supported_resources)\n\n    def scan_resource_conf(self, conf):\n        if 'policy' in conf.keys():\n            try:\n                policy_block = json.loads(conf['policy'][0])\n                if 'Statement' in policy_block.keys():\n                    for statement in policy_block['Statement']:\n                        if 'Action' in statement and \\\n                                statement.get('Effect', ['Allow']) == 'Allow' and \\\n                                '*' in statement.get('Action', ['']) and \\\n                                '*' in statement.get('Resource', ['']):\n                            return CheckResult.FAILED\n            except:  # nosec\n                pass\n        return CheckResult.PASSED\n\n\ncheck = IAMAdminPolicyDocument()\n", "path": "checkov/terraform/checks/resource/aws/IAMAdminPolicyDocument.py"}, {"content": "from checkov.terraform.checks.data.base_check import BaseDataCheck\nfrom checkov.common.models.enums import CheckResult, CheckCategories\n\n\nclass StarActionPolicyDocument(BaseDataCheck):\n    def __init__(self):\n        name = \"Ensure no IAM policies documents allow \\\"*\\\" as a statement's actions\"\n        id = \"CKV_AWS_49\"\n        supported_data = ['aws_iam_policy_document']\n        categories = [CheckCategories.IAM]\n        super().__init__(name=name, id=id, categories=categories, supported_data=supported_data)\n\n    def scan_data_conf(self, conf):\n        \"\"\"\n            validates iam policy document\n            https://learn.hashicorp.com/terraform/aws/iam-policy\n        :param conf: aws_kms_key configuration\n        :return: <CheckResult>\n        \"\"\"\n        key = 'statement'\n        if key in conf.keys():\n            for statement in conf[key]:\n                if 'actions' in statement and '*' in statement['actions'][0] and statement.get('effect', ['Allow'])[0] == 'Allow':\n                    return CheckResult.FAILED\n        return CheckResult.PASSED\n\n\ncheck = StarActionPolicyDocument()\n", "path": "checkov/terraform/checks/data/aws/StarActionPolicyDocument.py"}]}