11AWSTemplateFormatVersion : " 2010-09-09"
2- Description : EventBridge resources that forward CloudTrail logs to Sysdig Secure
2+ Description : EventBridge resources that forward CloudTrail logs to Sysdig Secure via API Destination
33
44Metadata :
55 AWS::CloudFormation::Interface :
@@ -10,7 +10,9 @@ Metadata:
1010 - EventBridgeRoleName
1111 - ExternalID
1212 - TrustedIdentity
13- - EventBusARN
13+ - ApiKey
14+ - IngestionUrl
15+ - RateLimit
1416 - EventBridgeState
1517 - EventBridgeEventPattern
1618
@@ -19,8 +21,12 @@ Metadata:
1921 default : " External ID (Sysdig use only)"
2022 TrustedIdentity :
2123 default : " Trusted Identity (Sysdig use only)"
22- EventBusARN :
23- default : " Target Event Bus (Sysdig use only)"
24+ ApiKey :
25+ default : " API Key (Sysdig use only)"
26+ IngestionUrl :
27+ default : " Ingestion URL (Sysdig use only)"
28+ RateLimit :
29+ default : " Rate Limit (Sysdig use only)"
2430 EventBridgeRoleName :
2531 default : " Integration Name (Sysdig use only)"
2632 EventBridgeState :
@@ -38,15 +44,21 @@ Parameters:
3844 TrustedIdentity :
3945 Type : String
4046 Description : The Role in Sysdig's AWS Account with permissions to your account
41- EventBusARN :
47+ ApiKey :
4248 Type : String
43- Description : The destination in Sysdig's AWS account where your events are sent
49+ Description : API key for Sysdig Secure authentication
50+ IngestionUrl :
51+ Type : String
52+ Description : Sysdig Secure API ingestion URL
53+ RateLimit :
54+ Type : Number
55+ Description : Maximum invocations per second for the API destination
56+ Default : 300
4457 EventBridgeState :
4558 Type : String
4659 Description : The state of the EventBridge Rule
47- Default : ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS
60+ Default : ENABLED
4861 AllowedValues :
49- - ENABLED_WITH_ALL_CLOUDTRAIL_MANAGEMENT_EVENTS
5062 - ENABLED
5163 - DISABLED
5264 EventBridgeEventPattern :
@@ -73,6 +85,25 @@ Parameters:
7385 }
7486
7587Resources :
88+ EventBridgeConnection :
89+ Type : AWS::Events::Connection
90+ Properties :
91+ Name : !Sub ${EventBridgeRoleName}-connection
92+ AuthorizationType : API_KEY
93+ AuthParameters :
94+ ApiKeyAuthParameters :
95+ ApiKeyName : X-Api-Key
96+ ApiKeyValue : !Ref ApiKey
97+
98+ EventBridgeApiDestination :
99+ Type : AWS::Events::ApiDestination
100+ Properties :
101+ Name : !Sub ${EventBridgeRoleName}-destination
102+ ConnectionArn : !GetAtt EventBridgeConnection.Arn
103+ InvocationEndpoint : !Ref IngestionUrl
104+ HttpMethod : POST
105+ InvocationRateLimitPerSecond : !Ref RateLimit
106+
76107 EventBridgeRole :
77108 Type : AWS::IAM::Role
78109 Properties :
@@ -89,31 +120,40 @@ Resources:
89120 Action : " sts:AssumeRole"
90121 Condition :
91122 StringEquals :
92- sts:ExternalId : !Ref ExternalID
123+ sts:ExternalId : !Ref ExternalID
93124 Policies :
94125 - PolicyName : !Ref EventBridgeRoleName
95126 PolicyDocument :
96127 Version : " 2012-10-17"
97128 Statement :
98- - Effect : Allow
99- Action : ' events:PutEvents'
100- Resource : !Ref EventBusARN
101- - Effect : Allow
129+ - Sid : " InvokeApiDestination"
130+ Effect : Allow
131+ Action :
132+ - " events:InvokeApiDestination"
133+ Resource :
134+ - !Sub " arn:aws:events:*:*:api-destination/${EventBridgeRoleName}-destination/*"
135+ - Sid : " CloudTrailEventRuleAccess"
136+ Effect : Allow
102137 Action :
103138 - " events:DescribeRule"
104139 - " events:ListTargetsByRule"
105140 Resource :
106- - !Sub arn:aws:events:*:*:rule/${EventBridgeRoleName}
141+ - !Sub " arn:aws:events:*:*:rule/${EventBridgeRoleName}"
142+ - Sid : " ValidationAccess"
143+ Effect : Allow
144+ Action :
145+ - " events:DescribeApiDestination"
146+ - " events:DescribeConnection"
147+ Resource : " *"
148+
107149 EventBridgeRule :
108150 Type : AWS::Events::Rule
109151 Properties :
110152 Name : !Ref EventBridgeRoleName
111- Description : Capture all CloudTrail events
153+ Description : Capture all CloudTrail events for Sysdig Secure
112154 EventPattern : !Ref EventBridgeEventPattern
113155 State : !Ref EventBridgeState
114156 Targets :
115157 - Id : !Ref EventBridgeRoleName
116- Arn : !Ref EventBusARN
117- RoleArn : !GetAtt
118- - EventBridgeRole
119- - Arn
158+ Arn : !GetAtt EventBridgeApiDestination.Arn
159+ RoleArn : !GetAtt EventBridgeRole.Arn
0 commit comments