Repository navigation
feat(cloudfront): detect Standard Logging v2 via CloudWatch Log Delivery - #10090
Merged
HugoPBrito merged 10 commits intoMar 25, 2026
Merged
Conversation
Fixes prowler-cloud#10004 The cloudfront_distributions_logging_enabled check only evaluated legacy Standard Logging (S3) and Real-time logging, missing Standard Logging v2 which is configured via CloudWatch Logs delivery sources. Changes: - Add _get_log_delivery_sources() to CloudFront service to query logs:DescribeDeliverySources and match resourceArns to distributions - Add logging_v2_enabled field to Distribution model - Update check to pass when any logging method is configured - Add unit tests for v2 logging scenarios
Contributor
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10090 +/- ##
===========================================
- Coverage 93.42% 6.51% -86.91%
===========================================
Files 219 834 +615
Lines 30698 23759 -6939
===========================================
- Hits 28679 1549 -27130
- Misses 2019 22210 +20191
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…oudfront-logging-v2-10004
Member
|
Hi @mcrolly apologies for the delay. I'm going to review changes and will make some edits if needed. Thanks! |
jfagoagas
reviewed
Mar 25, 2026
HugoPBrito
approved these changes
Mar 25, 2026
jfagoagas
approved these changes
Mar 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Fix #10004
CloudFront distributions using Standard Logging v2 (CloudWatch Log Delivery) are incorrectly flagged as having logging disabled. This is the current AWS-recommended logging method, configurable directly from the AWS Console.
Description
The
cloudfront_distributions_logging_enabledcheck only evaluated legacy Standard Logging (S3) and Real-time logging, missing Standard Logging v2 which uses CloudWatch Logs delivery sources (logs:DescribeDeliverySources).Changes:
cloudfront_service.py): Added_get_log_delivery_sources()method that querieslogs:DescribeDeliverySourcesand matchesresourceArnto CloudFront distribution ARNslogging_v2_enabled: boolfield toDistributionFixedin 5.19.0Steps to review
_get_log_delivery_sources()incloudfront_service.py— uses paginatedlogs:DescribeDeliverySourcesto detect v2 loggingpytest -xvs tests/providers/aws/services/cloudfront/Checklist
This feature/issue is listed in here
Is it assigned to me — requested via issue comment
Review if the code is being covered by tests.
Review if code is being documented following this specification https://github.com/google/styleguide/blob/gh-pages/pyguide.md#38-comments-and-docstrings
Review if backport is needed.
Review if is needed to change the Readme.md
Ensure new entries are added to CHANGELOG.md, if applicable.
SDK/CLI
logs:DescribeDeliverySourcesis read-onlyLicense
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.