I have this error: aws securityhub get-findings --filters…
- User
I have this error: aws securityhub get-findings --filters '{"ComplianceSecurityControlId":{"EQUALS":"EC2.19"}}'
Parameter validation failed: Invalid type for parameter Filters.ComplianceSecurityControlId, value: OrderedDict([('EQUALS', 'EC2.19')]), type: <class 'collections.OrderedDict'>, valid types: <class 'list'>, <class 'tuple'>
- Assistant
The error message is indicating that the value for the
ComplianceSecurityControlIdfilter in your AWS Security Hub command is not in the correct format. Theget-findingscommand expects the filter value to be a list or tuple.To resolve the error, you need to change the format of the filter value. Here's an example of the corrected command:
bashaws securityhub get-findings --filters '[{"ComplianceSecurityControlId": ["EC2.19"]}]'In this example, the
ComplianceSecurityControlIdfilter value is specified as a list with a single element being "EC2.19".