Skip to content

Conversation

@mohd4adil
Copy link

Context

As of present, cross account checks for aws in s3, eventbridge bus, eventbridge schema and dynamodb do not support a trusted account list. A trusted account list would help to reduce the noise on findings that have policies that have principals from other trusted accounts have them pass instead of fail.

Description

The major change made is to the is_policy_public function (line 384 - 518) in prowler/providers/aws/services/iam/lib/policy.py. The following checks make use of the is_policy_public function while passing through the argument is_cross_account_allowed=False:

  • s3_bucket_cross_account_access
  • eventbridge_schema_registry_cross_account_access
  • eventbridge_bus_cross_account_access
  • dynamodb_table_cross_account_access

The change majorly involves a logic change in adding a trusted account list that is iterated over and decides to flag the resource as public or private based on the passed trusted account list from the config.yaml file.

Steps to review

  • Review the changes in the is_policy_public function of prowler/providers/aws/services/iam/lib/policy.py
  • Review the changes made to the four checks that are mentioned above
  • Cross verify the changes with the added tests in tests/providers/aws/services/iam/lib/policy_test.py with functions test_cross_account_access_trusted_account_list and test_cross_account_access_with_principal_list_trusted_account_list lines (1656 - 1697)

Checklist

UI

  • All issue/task requirements work as expected on the UI
  • Screenshots/Video of the functionality flow (if applicable) - Mobile (X < 640px)
  • Screenshots/Video of the functionality flow (if applicable) - Table (640px > X < 1024px)
  • Screenshots/Video of the functionality flow (if applicable) - Desktop (X > 1024px)
  • Ensure new entries are added to CHANGELOG.md, if applicable.

API

  • Verify if API specs need to be regenerated.
  • Check if version updates are required (e.g., specs, Poetry, etc.).
  • Ensure new entries are added to CHANGELOG.md, if applicable.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…3, dynamodb, eventbridge bus, eventbridge schema. Changes made to is_policy_public function under the iam lib and added the necessary tests for the modifications
@mohd4adil mohd4adil requested review from a team as code owners December 25, 2025 07:51
@github-actions github-actions bot added provider/aws Issues/PRs related with the AWS provider community Opened by the Community labels Dec 25, 2025
@github-actions
Copy link
Contributor

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@danibarranqueroo danibarranqueroo changed the title Adding support for trusted aws accounts in cross account checks for s3, eventbridge bus, eventbridge schema and dynamodb chore(aws): add support for trusted aws accounts in cross account checks for s3, eventbridge bus, eventbridge schema and dynamodb Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Opened by the Community provider/aws Issues/PRs related with the AWS provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant