Skip to content

Commit c2bc433

Browse files
fix(eventbridge): Add permissions to describe rule and targets to CFTs (#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.
1 parent e2343e1 commit c2bc433

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

templates_cspm_eventbridge/FullInstall.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ Resources:
9797
- Effect: Allow
9898
Action: 'events:PutEvents'
9999
Resource: !Ref EventBusARN
100+
- Effect: Allow
101+
Action:
102+
- "events:DescribeRule"
103+
- "events:ListTargetsByRule"
104+
Resource:
105+
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
100106
EventBridgeRule:
101107
Type: AWS::Events::Rule
102108
Properties:

templates_cspm_eventbridge/OrgFullInstall.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ Resources:
142142
- Effect: Allow
143143
Action: 'events:PutEvents'
144144
Resource: !Sub ${EventBusARN}
145+
- Effect: Allow
146+
Action:
147+
- "events:DescribeRule"
148+
- "events:ListTargetsByRule"
149+
Resource:
150+
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
145151
RolesStackSet:
146152
Type: AWS::CloudFormation::StackSet
147153
Properties:
@@ -231,6 +237,12 @@ Resources:
231237
- Effect: Allow
232238
Action: 'events:PutEvents'
233239
Resource: !Sub ${EventBusARN}
240+
- Effect: Allow
241+
Action:
242+
- "events:DescribeRule"
243+
- "events:ListTargetsByRule"
244+
Resource:
245+
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
234246
EBRuleStackSet:
235247
Type: AWS::CloudFormation::StackSet
236248
Properties:

templates_eventbridge/EventBridge.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ Resources:
7272
- Effect: Allow
7373
Action: 'events:PutEvents'
7474
Resource: !Ref EventBusARN
75+
- Effect: Allow
76+
Action:
77+
- "events:DescribeRule"
78+
- "events:ListTargetsByRule"
79+
Resource:
80+
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
7581
EventBridgeRule:
7682
Type: AWS::Events::Rule
7783
Properties:

templates_eventbridge/OrgEventBridge.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ Resources:
142142
- Effect: Allow
143143
Action: 'events:PutEvents'
144144
Resource: !Sub ${EventBusARN}
145+
- Effect: Allow
146+
Action:
147+
- "events:DescribeRule"
148+
- "events:ListTargetsByRule"
149+
Resource:
150+
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
145151
MgmtAccEBRuleStackSet:
146152
Type: AWS::CloudFormation::StackSet
147153
Metadata:
@@ -275,6 +281,12 @@ Resources:
275281
- Effect: Allow
276282
Action: 'events:PutEvents'
277283
Resource: !Sub ${EventBusARN}
284+
- Effect: Allow
285+
Action:
286+
- "events:DescribeRule"
287+
- "events:ListTargetsByRule"
288+
Resource:
289+
- !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
278290
EBRuleStackSet:
279291
Type: AWS::CloudFormation::StackSet
280292
Properties:

0 commit comments

Comments
 (0)