Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.2.256 introduces some errors while scanning Terraform s3 module #6841

Closed
sleepwithcoffee opened this issue Nov 14, 2024 · 1 comment · Fixed by #6874
Closed

Version 3.2.256 introduces some errors while scanning Terraform s3 module #6841

sleepwithcoffee opened this issue Nov 14, 2024 · 1 comment · Fixed by #6874
Labels

Comments

@sleepwithcoffee
Copy link

Describe the issue
Explain what you expected to happen when checkov crashed.

When I use checkov to scan Terraform S3 public module v4.2.2, checkov throws some errors:

Exception Trace

checkov -d . --compact --quiet

2024-11-14 08:00:34,407 [MainThread  ] [ERROR]  Failed to run check CKV_AWS_375 on /modules/utils/terraform-aws-s3-bucket/v4.2.2/main.tf:aws_s3_bucket_acl.this[0]
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/checkov/common/checks/base_check.py", line 68, in run
    check_result["result"] = self.scan_entity_conf(entity_configuration, entity_type)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/checkov/terraform/checks/resource/base_resource_check.py", line 43, in scan_entity_conf
    return self.scan_resource_conf(conf)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/checkov/terraform/checks/resource/aws/S3GlobalViewACL.py", line 22, in scan_resource_conf
    if 'permission' in grant and ('FULL_CONTROL' in grant.get('permission') or 'READ_ACP' in grant.get('permission')):
                                                    ^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'
2024-11-14 08:00:34,414 [MainThread  ] [ERROR]  Failed to run check CKV_AWS_375 on /modules/utils/terraform-aws-s3-bucket/v4.2.2/main.tf:aws_s3_bucket_acl.this[0]
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/checkov/common/checks/base_check.py", line 68, in run
    check_result["result"] = self.scan_entity_conf(entity_configuration, entity_type)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/checkov/terraform/checks/resource/base_resource_check.py", line 43, in scan_entity_conf
    return self.scan_resource_conf(conf)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/checkov/terraform/checks/resource/aws/S3GlobalViewACL.py", line 22, in scan_resource_conf
    if 'permission' in grant and ('FULL_CONTROL' in grant.get('permission') or 'READ_ACP' in grant.get('permission')):
                                                    ^^^^^^^^^
AttributeError: 'str' object has no attribute 'get'

Desktop (please complete the following information):

  • OS: MacOS
  • Checkov Version 3.2.256

Additional context
Tested fine with version 3.2.255 and earlier

@matansha
Copy link
Contributor

Hi @sleepwithcoffee,
Can you share the file? it will help us to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants