Skip to content

Commit

Permalink
fix(eventbridge): Add permissions to describe rule and targets to CFTs (
Browse files Browse the repository at this point in the history
#115)

Adding the following permissions to EB role to be able to run thorough validations.
These permissions are read-only and targetted to only specific EB rule resource
created by the same CFT template :-
- events:DescribeRule
- events:ListTargetsByRule

Note:
- Fixing this for both single and org onboarding case.
- Validated the CFT templates using make validate.
  • Loading branch information
ravinadhruve10 committed Feb 7, 2024
1 parent e2343e1 commit c2bc433
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates_cspm_eventbridge/FullInstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ Resources:
- Effect: Allow
Action: 'events:PutEvents'
Resource: !Ref EventBusARN
- Effect: Allow
Action:
- "events:DescribeRule"
- "events:ListTargetsByRule"
Resource:
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
EventBridgeRule:
Type: AWS::Events::Rule
Properties:
Expand Down
12 changes: 12 additions & 0 deletions templates_cspm_eventbridge/OrgFullInstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ Resources:
- Effect: Allow
Action: 'events:PutEvents'
Resource: !Sub ${EventBusARN}
- Effect: Allow
Action:
- "events:DescribeRule"
- "events:ListTargetsByRule"
Resource:
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
RolesStackSet:
Type: AWS::CloudFormation::StackSet
Properties:
Expand Down Expand Up @@ -231,6 +237,12 @@ Resources:
- Effect: Allow
Action: 'events:PutEvents'
Resource: !Sub ${EventBusARN}
- Effect: Allow
Action:
- "events:DescribeRule"
- "events:ListTargetsByRule"
Resource:
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
EBRuleStackSet:
Type: AWS::CloudFormation::StackSet
Properties:
Expand Down
6 changes: 6 additions & 0 deletions templates_eventbridge/EventBridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ Resources:
- Effect: Allow
Action: 'events:PutEvents'
Resource: !Ref EventBusARN
- Effect: Allow
Action:
- "events:DescribeRule"
- "events:ListTargetsByRule"
Resource:
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
EventBridgeRule:
Type: AWS::Events::Rule
Properties:
Expand Down
12 changes: 12 additions & 0 deletions templates_eventbridge/OrgEventBridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ Resources:
- Effect: Allow
Action: 'events:PutEvents'
Resource: !Sub ${EventBusARN}
- Effect: Allow
Action:
- "events:DescribeRule"
- "events:ListTargetsByRule"
Resource:
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
MgmtAccEBRuleStackSet:
Type: AWS::CloudFormation::StackSet
Metadata:
Expand Down Expand Up @@ -275,6 +281,12 @@ Resources:
- Effect: Allow
Action: 'events:PutEvents'
Resource: !Sub ${EventBusARN}
- Effect: Allow
Action:
- "events:DescribeRule"
- "events:ListTargetsByRule"
Resource:
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
EBRuleStackSet:
Type: AWS::CloudFormation::StackSet
Properties:
Expand Down

0 comments on commit c2bc433

Please sign in to comment.