-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
After setting up the CloudFormation hook and creating a stack with an S3 bucket with public access, the following was logged to CloudWatch for the hook:
Exception caught sequence item 0: expected str instance, dict found
Traceback (most recent call last):
File "/var/task/cloudformation_cli_python_lib/hook.py", line 273, in __call__
raise error
File "/var/task/cloudformation_cli_python_lib/hook.py", line 262, in __call__
caller_sess, request, invocation_point, callback, type_configuration
File "/var/task/cloudformation_cli_python_lib/hook.py", line 100, in _invoke_handler
return handler(session, request, callback_context, type_configuration)
File "/var/task/styra_opa_hook/handlers.py", line 127, in pre_handler
return opa_query(request, session, type_configuration, action)
File "/var/task/styra_opa_hook/handlers.py", line 97, in opa_query
message = " | ".join(body["violations"])
TypeError: sequence item 0: expected str instance, dict found
For reference, the OPA agent returned the following:
{"allow":false,"violations":[{"allowed":false,"message":"public access not blocked for bucket testing"}]}
Metadata
Metadata
Assignees
Labels
No labels