Skip to content
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

feat(eventbridge): add EventBridge checks #4020

Merged
merged 7 commits into from
May 21, 2024

Conversation

sergargar
Copy link
Member

@sergargar sergargar commented May 16, 2024

Description

Add the following EventBridge checks:

  • eventbridge_bus_exposed: Ensure that your AWS EventBridge event bus is not exposed to everyone.

  • eventbridge_bus_cross_account_access: Ensure that AWS EventBridge event buses do not allow unknown cross-account access for the delivery of events.

  • eventbridge_schema_registry_cross_account_access: Ensure that access to EventBridge schema registries is restricted to accounts within your AWS Organization or specifically authorized accounts.

License

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

@sergargar sergargar requested review from a team as code owners May 16, 2024 15:19
@github-actions github-actions bot added the provider/aws Issues/PRs related with the AWS provider label May 16, 2024
Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 80.47337% with 33 lines in your changes are missing coverage. Please review.

Project coverage is 86.29%. Comparing base (db29c75) to head (62d7285).
Report is 1 commits behind head on master.

Files Patch % Lines
...rs/aws/services/eventbridge/eventbridge_service.py 74.73% 24 Missing ⚠️
prowler/providers/aws/services/iam/lib/policy.py 72.72% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4020      +/-   ##
==========================================
- Coverage   86.34%   86.29%   -0.05%     
==========================================
  Files         778      783       +5     
  Lines       24368    24537     +169     
==========================================
+ Hits        21040    21175     +135     
- Misses       3328     3362      +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @sergargar 👏 Please review my comments when you get a chance, thanks!

"CheckTitle": "Ensure that your AWS EventBridge event bus is not exposed to everyone",
"CheckType": [],
"ServiceName": "eventbridge",
"SubServiceName": "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"SubServiceName": "",
"SubServiceName": "eventbus",

maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that not a resource type?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, could be.

@sergargar sergargar requested a review from jfagoagas May 20, 2024 12:35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we put this into the IAM service folder like prowler/providers/aws/services/iam/lib/policy.py

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests for this function not just the ones used in the checks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@sergargar sergargar requested a review from jfagoagas May 20, 2024 16:52
Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @sergargar 👏

@jfagoagas jfagoagas merged commit f4eaf2d into master May 21, 2024
9 of 11 checks passed
@jfagoagas jfagoagas deleted the PRWLR-3651-oss-event-bridge-checks branch May 21, 2024 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
provider/aws Issues/PRs related with the AWS provider
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants