-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
AWS - AttributeError on generating report #6728
Comments
Hey! @rodjul we are reviewing this, thanks for the ping! |
Hello @rodjul, we are working in several fixes for the issues you shared, we will link them with the issue. |
Things that needs a review in this issue: Several
|
@rodjul I've created several sub-issues to keep track of each of them independently. Thanks! |
Hello @rodjul we've merged several fixes for the issues you shared with us, you can test it using the |
Hello @jfagoagas, tested and the fix works! Thanks |
@rodjul Could you please execute it again with
|
@jfagoagas Sure {"timestamp": "2025-01-30 12:02:28,098", "filename": "models.py:432", "level": "ERROR", "module": "models", "message": "Resource metadata <class 'NoneType'> in account_maintain_current_contact_details could not be converted to dict"}
{"timestamp": "2025-01-30 12:02:28,105", "filename": "models.py:432", "level": "ERROR", "module": "models", "message": "Resource metadata <class 'NoneType'> in account_security_contact_information_is_registered could not be converted to dict"}
{"timestamp": "2025-01-30 12:09:46,158", "filename": "ec2_elastic_ip_shodan.py:36", "level": "ERROR", "module": "ec2_elastic_ip_shodan", "message": "No Shodan API Key -- Please input a Shodan API Key with -N/--shodan or in config.yaml"}
{"timestamp": "2025-01-30 12:11:27,351", "filename": "check.py:604", "level": "ERROR", "module": "check", "message": "ecs_task_definitions_no_environment_secrets -- KeyError[50]: '8669a969932c16ae2529cbcda85d04da81416fd9'"}
{"timestamp": "2025-01-30 12:12:06,250", "filename": "models.py:432", "level": "ERROR", "module": "models", "message": "Resource metadata <class 'list'> in iam_root_credentials_management_enabled could not be converted to dict"}
{"timestamp": "2025-01-30 12:14:33,318", "filename": "outputs.py:69", "level": "ERROR", "module": "outputs", "message": "Exception[52]: Invalid Report Status. Must be PASS, FAIL or MANUAL."}
{"timestamp": "2025-01-30 12:16:30,819", "filename": "finding.py:261", "level": "ERROR", "module": "finding", "message": "ValidationError[259]: 1 validation error for Finding
status
value is not a valid enumeration member; permitted: 'PASS', 'FAIL', 'MANUAL', 'MUTED' (type=type_error.enum; enum_values=[<Status.PASS: 'PASS'>, <Status.FAIL: 'FAIL'>, <Status.MANUAL: 'MANUAL'>, <Status.MUTED: 'MUTED'>]) - {'metadata': CheckMetadata(Provider='aws', CheckID='rds_instance_critical_event_subscription', CheckTitle='Check if RDS Instances events are subscribed.', CheckType=['Software and Configuration Checks, AWS Security Best Practices'], CheckAliases=[], ServiceName='rds', SubServiceName='', ResourceIdTemplate='arn:aws:rds:region:account-id:db-instance', Severity=<Severity.low: 'low'>, ResourceType='AwsRdsEventSubscription', Description='Ensure that Amazon RDS event notification subscriptions are enabled for database database events, particularly maintenance, configuration change and failure.', Risk='Without event subscriptions for critical events, such as maintenance, configuration changes and failures, you may not be aware of issues affecting your RDS instances, leading to downtime or security vulnerabilities.', RelatedUrl='https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html', Remediation=Remediation(Code=Code(NativeIaC='', Terraform='', CLI="aws rds create-event-subscription --source-type db-instance --event-categories 'failure' 'maintenance' 'configuration change' --sns-topic-arn <sns-topic-arn>", Other='https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-20'), Recommendation=Recommendation(Text='To subscribe to RDS instance event notifications, see Subscribing to Amazon RDS event notification in the Amazon RDS User Guide.', Url='https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Subscribing.html')), Categories=[], DependsOn=[], RelatedTo=[], Notes='', Compliance=None), 'timestamp': '2025-01-30T12:02:18.187434', 'status': '', 'status_extended': '', 'muted': False, 'resource_details': '', 'resource': {'id': 'homolog3-event-low-storage', 'arn': 'arn:aws:rds:us-east-1:123456789012:es:homolog3-event-low-storage', 'sns_topic_arn': 'arn:aws:sns:us-east-1:123456789012:homolog3_rds_event-subscriptions', 'status': 'active', 'source_type': 'db-instance', 'source_id': ['homolog3-postgres'], 'event_list': ['low storage'], 'enabled': True, 'region': 'us-east-1', 'tags': [{'Key': 'aws:cloudformation:stack-name', 'Value': 'homolog3-crm-PostgresStack-IG1J9BZPZP91'}, {'Key': 'aws:cloudformation:logical-id', 'Value': 'EventSubscriptionRDS'}, {'Key': 'aws:cloudformation:stack-id', 'Value': 'arn:aws:cloudformation:us-east-1:123456789012:stack/homolog3-crm-PostgresStack-IG1J9BZPZP91/f3928010-f6ff-11eb-9856-12c40fdfd925'}, {'Key': 'ENV', 'Value': 'homolog3'}]}, 'resource_tags': {'aws:cloudformation:stack-name': 'homolog3-crm-PostgresStack-IG1J9BZPZP91', 'aws:cloudformation:logical-id': 'EventSubscriptionRDS', 'aws:cloudformation:stack-id': 'arn:aws:cloudformation:us-east-1:123456789012:stack/homolog3-crm-PostgresStack-IG1J9BZPZP91/f3928010-f6ff-11eb-9856-12c40fdfd925', 'ENV': 'homolog3'}, 'compliance': {}, 'provider': 'aws', 'resource_metadata': {'id': 'homolog3-event-low-storage', 'arn': 'arn:aws:rds:us-east-1:123456789012:es:homolog3-event-low-storage', 'sns_topic_arn': 'arn:aws:sns:us-east-1:123456789012:homolog3_rds_event-subscriptions', 'status': 'active', 'source_type': 'db-instance', 'source_id': ['homolog3-postgres'], 'event_list': ['low storage'], 'enabled': True, 'region': 'us-east-1', 'tags': [{'Key': 'aws:cloudformation:stack-name', 'Value': 'homolog3-crm-PostgresStack-IG1J9BZPZP91'}, {'Key': 'aws:cloudformation:logical-id', 'Value': 'EventSubscriptionRDS'}, {'Key': 'aws:cloudformation:stack-id', 'Value': 'arn:aws:cloudformation:us-east-1:123456789012:stack/homolog3-crm-PostgresStack-IG1J9BZPZP91/f3928010-f6ff-11eb-9856-12c40fdfd925'}, {'Key': 'ENV', 'Value': 'homolog3'}]}, 'account_uid': '123456789012', 'account_name': '', 'account_email': '', 'account_organization_uid': '', 'account_organization_name': '', 'account_tags': [], 'partition': 'aws', 'auth_method': 'profile: None', 'resource_name': 'homolog3-event-low-storage', 'resource_uid': 'arn:aws:rds:us-east-1:123456789012:es:homolog3-event-low-storage', 'region': 'us-east-1', 'uid': 'prowler-aws-rds_instance_critical_event_subscription-123456789012-us-east-1-homolog3-event-low-storage'}"}
{"timestamp": "2025-01-30 12:16:30,820", "filename": "finding.py:261", "level": "ERROR", "module": "finding", "message": "ValidationError[259]: 1 validation error for Finding
status
value is not a valid enumeration member; permitted: 'PASS', 'FAIL', 'MANUAL', 'MUTED' (type=type_error.enum; enum_values=[<Status.PASS: 'PASS'>, <Status.FAIL: 'FAIL'>, <Status.MANUAL: 'MANUAL'>, <Status.MUTED: 'MUTED'>]) - {'metadata': CheckMetadata(Provider='aws', CheckID='rds_instance_critical_event_subscription', CheckTitle='Check if RDS Instances events are subscribed.', CheckType=['Software and Configuration Checks, AWS Security Best Practices'], CheckAliases=[], ServiceName='rds', SubServiceName='', ResourceIdTemplate='arn:aws:rds:region:account-id:db-instance', Severity=<Severity.low: 'low'>, ResourceType='AwsRdsEventSubscription', Description='Ensure that Amazon RDS event notification subscriptions are enabled for database database events, particularly maintenance, configuration change and failure.', Risk='Without event subscriptions for critical events, such as maintenance, configuration changes and failures, you may not be aware of issues affecting your RDS instances, leading to downtime or security vulnerabilities.', RelatedUrl='https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html', Remediation=Remediation(Code=Code(NativeIaC='', Terraform='', CLI="aws rds create-event-subscription --source-type db-instance --event-categories 'failure' 'maintenance' 'configuration change' --sns-topic-arn <sns-topic-arn>", Other='https://docs.aws.amazon.com/securityhub/latest/userguide/rds-controls.html#rds-20'), Recommendation=Recommendation(Text='To subscribe to RDS instance event notifications, see Subscribing to Amazon RDS event notification in the Amazon RDS User Guide.', Url='https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.Subscribing.html')), Categories=[], DependsOn=[], RelatedTo=[], Notes='', Compliance=None), 'timestamp': '2025-01-30T12:02:18.187434', 'status': '', 'status_extended': '', 'muted': False, 'resource_details': '', 'resource': {'id': 'production3-event-low-storage', 'arn': 'arn:aws:rds:us-east-1:123456789012:es:production3-event-low-storage', 'sns_topic_arn': 'arn:aws:sns:us-east-1:123456789012:production3_rds_event-subscriptions', 'status': 'active', 'source_type': 'db-instance', 'source_id': ['production3-postgres-customer', 'production3-postgres-analytics', 'production3-postgres-btb', 'production3-postgres-opportunity', 'production3-postgres-user', 'production3-postgres-bragi', 'production3-postgres-bdd', 'production3-postgres-calendar', 'production3-postgres-thirdpartyintegration', 'production3-postgres-preference', 'production3-postgres-transformation', 'production3-postgres-forecast', 'production3-postgres-sales', 'production3-postgres-campaign', 'production3-postgres-quickedit', 'production3-postgres-integrationrouter', 'production3-postgres-documentmanager', 'production3-postgres-accesscontrol', 'production3-postgres-remoteservice', 'production3-postgres-product', 'production3-postgres-dataprotection', 'production3-postgres-financial', 'production3-postgres-mapping', 'production3-postgres-integrationhub', 'production3-postgres-administration', 'production3-postgres-document', 'production3-postgres-commondata', 'production3-postgres-bulkprocessor', 'production3-postgres-vessel', 'production3-postgres-dashboard', 'production3-postgres-analyticsstudio', 'production3-postgres-workflow', 'production3-postgres-notification', 'production3-postgres-bifrost', 'production3-postgres-datacatalog'], 'event_list': ['low storage'], 'enabled': True, 'region': 'us-east-1', 'tags': [{'Key': 'aws:cloudformation:stack-name', 'Value': 'production3-mastercrm-PostgresStack-1CDH013B13WSA'}, {'Key': 'aws:cloudformation:logical-id', 'Value': 'EventSubscriptionRDS'}, {'Key': 'aws:cloudformation:stack-id', 'Value': 'arn:aws:cloudformation:us-east-1:123456789012:stack/production3-mastercrm-PostgresStack-1CDH013B13WSA/ebff2030-1ebd-11eb-9d79-0acaf3694d17'}, {'Key': 'ENV', 'Value': 'production3'}]}, 'resource_tags': {'aws:cloudformation:stack-name': 'production3-mastercrm-PostgresStack-1CDH013B13WSA', 'aws:cloudformation:logical-id': 'EventSubscriptionRDS', 'aws:cloudformation:stack-id': 'arn:aws:cloudformation:us-east-1:123456789012:stack/production3-mastercrm-PostgresStack-1CDH013B13WSA/ebff2030-1ebd-11eb-9d79-0acaf3694d17', 'ENV': 'production3'}, 'compliance': {}, 'provider': 'aws', 'resource_metadata': {'id': 'production3-event-low-storage', 'arn': 'arn:aws:rds:us-east-1:123456789012:es:production3-event-low-storage', 'sns_topic_arn': 'arn:aws:sns:us-east-1:123456789012:production3_rds_event-subscriptions', 'status': 'active', 'source_type': 'db-instance', 'source_id': ['production3-postgres-customer', 'production3-postgres-analytics', 'production3-postgres-btb', 'production3-postgres-opportunity', 'production3-postgres-user', 'production3-postgres-bragi', 'production3-postgres-bdd', 'production3-postgres-calendar', 'production3-postgres-thirdpartyintegration', 'production3-postgres-preference', 'production3-postgres-transformation', 'production3-postgres-forecast', 'production3-postgres-sales', 'production3-postgres-campaign', 'production3-postgres-quickedit', 'production3-postgres-integrationrouter', 'production3-postgres-documentmanager', 'production3-postgres-accesscontrol', 'production3-postgres-remoteservice', 'production3-postgres-product', 'production3-postgres-dataprotection', 'production3-postgres-financial', 'production3-postgres-mapping', 'production3-postgres-integrationhub', 'production3-postgres-administration', 'production3-postgres-document', 'production3-postgres-commondata', 'production3-postgres-bulkprocessor', 'production3-postgres-vessel', 'production3-postgres-dashboard', 'production3-postgres-analyticsstudio', 'production3-postgres-workflow', 'production3-postgres-notification', 'production3-postgres-bifrost', 'production3-postgres-datacatalog'], 'event_list': ['low storage'], 'enabled': True, 'region': 'us-east-1', 'tags': [{'Key': 'aws:cloudformation:stack-name', 'Value': 'production3-mastercrm-PostgresStack-1CDH013B13WSA'}, {'Key': 'aws:cloudformation:logical-id', 'Value': 'EventSubscriptionRDS'}, {'Key': 'aws:cloudformation:stack-id', 'Value': 'arn:aws:cloudformation:us-east-1:123456789012:stack/production3-mastercrm-PostgresStack-1CDH013B13WSA/ebff2030-1ebd-11eb-9d79-0acaf3694d17'}, {'Key': 'ENV', 'Value': 'production3'}]}, 'account_uid': '123456789012', 'account_name': '', 'account_email': '', 'account_organization_uid': '', 'account_organization_name': '', 'account_tags': [], 'partition': 'aws', 'auth_method': 'profile: None', 'resource_name': 'production3-event-low-storage', 'resource_uid': 'arn:aws:rds:us-east-1:123456789012:es:production3-event-low-storage', 'region': 'us-east-1', 'uid': 'prowler-aws-rds_instance_critical_event_subscription-123456789012-us-east-1-production3-event-low-storage'}"} |
Hello @rodjul the above PR fixes the issue with the RDS check. |
Steps to Reproduce
prowler aws -R arn:aws:iam::123456789012:role/prowler --only-logs --log-level ERROR --log-file error.txt --output-formats csv --ignore-exit-code-3
Expected behavior
Generate the report after the scan is completed
Actual Result with Screenshots or Logs
How did you install Prowler?
From pip package (pip install prowler)
Environment Resource
AWS EC2
OS used
Ubuntu
Prowler version
5.2.1
Pip version
24.0 (python 3.12)
Context
No response
The text was updated successfully, but these errors were encountered: