-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugprovider/awsIssues/PRs related with the AWS providerIssues/PRs related with the AWS providerseverity/mediumResults in some unexpected or undesired behavior.Results in some unexpected or undesired behavior.
Description
Steps to Reproduce
- Create two hosted zones in Route53 (without query logging set up)
- Run
prowler aws --checks route53_public_hosted_zones_cloudwatch_logging_enabled route53_public_hosted_zones_cloudwatch_logging_enabledfails for both zones- Set up query logging for only one of the zones
- Run
prowler aws --checks route53_public_hosted_zones_cloudwatch_logging_enabled
Expected behavior
route53_public_hosted_zones_cloudwatch_logging_enabled should pass for the zone with the logging configuration and fail for the zone without the logging configuration
Actual Result with Screenshots or Logs
route53_public_hosted_zones_cloudwatch_logging_enabled passes for both zones
How did you install Prowler?
From brew (brew install prowler)
Environment Resource
Workstation
OS used
MacOS
Prowler version
5.3.0
Pip version
25.0
Context
It seems the issue hides in _list_query_logging_configs in route53_service.py:
prowler/prowler/providers/aws/services/route53/route53_service.py
Lines 83 to 95 in b7bce60
| for hosted_zone in self.hosted_zones.values(): | |
| list_query_logging_configs_paginator = self.client.get_paginator( | |
| "list_query_logging_configs" | |
| ) | |
| for page in list_query_logging_configs_paginator.paginate(): | |
| for logging_config in page["QueryLoggingConfigs"]: | |
| self.hosted_zones[hosted_zone.id].logging_config = ( | |
| LoggingConfig( | |
| cloudwatch_log_group_arn=logging_config[ | |
| "CloudWatchLogsLogGroupArn" | |
| ] | |
| ) | |
| ) |
The code reads like this:
for every hosted zone
for every query logging config
use the configuration as the query logging config for the hosted zone
I think it needs to be something like this:
for every hosted zone
for every query logging config
**if the HostedZoneId of the config matches the hosted zone**
use the configuration as the query logging config for the hosted zone
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugprovider/awsIssues/PRs related with the AWS providerIssues/PRs related with the AWS providerseverity/mediumResults in some unexpected or undesired behavior.Results in some unexpected or undesired behavior.