@@ -7,13 +7,15 @@ Metadata:
7
7
default : " "
8
8
Parameters :
9
9
- RuleEventPattern
10
+ - RateLimit
10
11
- Label :
11
12
default : " Sysdig Settings (Do not change)"
12
13
Parameters :
13
14
- NameSuffix
14
15
- ExternalID
15
16
- TrustedIdentity
16
- - TargetEventBusARN
17
+ - ApiKey
18
+ - IngestionUrl
17
19
- Regions
18
20
- RuleState
19
21
- IsOrganizational
@@ -30,8 +32,12 @@ Metadata:
30
32
default : External ID
31
33
TrustedIdentity :
32
34
default : Trusted Identity
33
- TargetEventBusARN :
34
- default : Target Event Bus
35
+ ApiKey :
36
+ default : " API Key (Sysdig use only)"
37
+ IngestionUrl :
38
+ default : " Ingestion URL (Sysdig use only)"
39
+ RateLimit :
40
+ default : " Api Destinations Rate Limit"
35
41
Regions :
36
42
default : Instrumented Regions
37
43
RuleState :
@@ -65,9 +71,16 @@ Parameters:
65
71
TrustedIdentity :
66
72
Type : String
67
73
Description : The Role in Sysdig's AWS Account with permissions to your account
68
- TargetEventBusARN :
74
+ ApiKey :
69
75
Type : String
70
- Description : The destination in Sysdig's AWS account where your events are sent
76
+ Description : API key for Sysdig Secure authentication
77
+ IngestionUrl :
78
+ Type : String
79
+ Description : Sysdig Secure API ingestion URL
80
+ RateLimit :
81
+ Type : Number
82
+ Description : Maximum invocations per second for the API destination
83
+ Default : 300
71
84
Regions :
72
85
Type : CommaDelimitedList
73
86
Description : Comma separated list of regions to monitor with EventBridge
@@ -245,14 +258,22 @@ Resources:
245
258
Version : " 2012-10-17"
246
259
Statement :
247
260
- Effect : Allow
248
- Action : ' events:PutEvents'
249
- Resource : !Ref TargetEventBusARN
261
+ Action :
262
+ - " events:InvokeApiDestination"
263
+ Resource :
264
+ - !Sub " arn:${Partition}:events:*:*:api-destination/sysdig-secure-events-${NameSuffix}-destination/*"
250
265
- Effect : Allow
251
266
Action :
252
267
- " events:DescribeRule"
253
268
- " events:ListTargetsByRule"
254
269
Resource :
255
270
- !Sub arn:${Partition}:events:*:*:rule/sysdig-secure-events-${NameSuffix}
271
+ - Effect : Allow
272
+ Action :
273
+ - " events:DescribeApiDestination"
274
+ - " events:DescribeConnection"
275
+ - " cloudwatch:GetMetricStatistics"
276
+ Resource : " *"
256
277
EventBridgeRuleStackSet :
257
278
Type : AWS::CloudFormation::StackSet
258
279
Metadata :
@@ -282,8 +303,12 @@ Resources:
282
303
Parameters :
283
304
- ParameterKey : Name
284
305
ParameterValue : !Sub sysdig-secure-events-${NameSuffix}
285
- - ParameterKey : TargetEventBusARN
286
- ParameterValue : !Ref TargetEventBusARN
306
+ - ParameterKey : ApiKey
307
+ ParameterValue : !Ref ApiKey
308
+ - ParameterKey : IngestionUrl
309
+ ParameterValue : !Ref IngestionUrl
310
+ - ParameterKey : RateLimit
311
+ ParameterValue : !Ref RateLimit
287
312
- ParameterKey : RuleState
288
313
ParameterValue : !Ref RuleState
289
314
- ParameterKey : RuleEventPattern
@@ -302,9 +327,15 @@ Resources:
302
327
Name:
303
328
Type: String
304
329
Description: resource name identifier
305
- TargetEventBusARN :
330
+ ApiKey :
306
331
Type: String
307
- Description: The destination in Sysdig's AWS account where your events are sent
332
+ Description: API key for authentication
333
+ IngestionUrl:
334
+ Type: String
335
+ Description: Target endpoint URL for the API destination
336
+ RateLimit:
337
+ Type: Number
338
+ Description: Maximum invocations per second for the API destination
308
339
RuleState:
309
340
Type: String
310
341
Description: The state of the EventBridge Rule
@@ -320,17 +351,36 @@ Resources:
320
351
Type: String
321
352
Description: AWS Partition of your account or organization to create resources in
322
353
Resources:
354
+ EventBridgeConnection:
355
+ Type: AWS::Events::Connection
356
+ Properties:
357
+ Name: !Sub ${Name}-connection
358
+ AuthorizationType: API_KEY
359
+ AuthParameters:
360
+ ApiKeyAuthParameters:
361
+ ApiKeyName: X-Api-Key
362
+ ApiKeyValue: !Ref ApiKey
363
+
364
+ EventBridgeApiDestination:
365
+ Type: AWS::Events::ApiDestination
366
+ Properties:
367
+ Name: !Sub ${Name}-destination
368
+ ConnectionArn: !GetAtt EventBridgeConnection.Arn
369
+ InvocationEndpoint: !Ref IngestionUrl
370
+ HttpMethod: POST
371
+ InvocationRateLimitPerSecond: !Ref RateLimit
372
+
323
373
EventBridgeRule:
324
- Type: " AWS::Events::Rule"
374
+ Type: AWS::Events::Rule
325
375
Properties:
326
- Name: !Ref Name
327
- Description: Capture all CloudTrail events
376
+ Name: !Sub ${ Name}
377
+ Description: Forwards events to Sysdig via API Destination
328
378
EventPattern: !Ref RuleEventPattern
329
- State: !Sub ${ RuleState}
379
+ State: !Ref RuleState
330
380
Targets:
331
- - Id: !Ref Name
332
- Arn: !Sub ${TargetEventBusARN}
333
- RoleArn: !Sub arn:${Partition}:iam::${AWS::AccountId}:role/${Name}
381
+ - Id: !Sub ${ Name}
382
+ Arn: !GetAtt EventBridgeApiDestination.Arn
383
+ RoleArn: !Sub " arn:${Partition}:iam::${AWS::AccountId}:role/${Name}"
334
384
OrganizationRoleStackSet :
335
385
Type : AWS::CloudFormation::StackSet
336
386
Condition : IsOrganizational
@@ -356,8 +406,12 @@ Resources:
356
406
ParameterValue : !Ref TrustedIdentity
357
407
- ParameterKey : ExternalID
358
408
ParameterValue : !Ref ExternalID
359
- - ParameterKey : TargetEventBusARN
360
- ParameterValue : !Ref TargetEventBusARN
409
+ - ParameterKey : ApiKey
410
+ ParameterValue : !Ref ApiKey
411
+ - ParameterKey : IngestionUrl
412
+ ParameterValue : !Ref IngestionUrl
413
+ - ParameterKey : RateLimit
414
+ ParameterValue : !Ref RateLimit
361
415
- ParameterKey : Partition
362
416
ParameterValue : !Ref Partition
363
417
StackInstancesGroup :
@@ -400,9 +454,15 @@ Resources:
400
454
Name:
401
455
Type: String
402
456
Description: A unique identifier used to create and reference resources
403
- TargetEventBusARN:
457
+ ApiKey:
458
+ Type: String
459
+ Description: API key for Sysdig Secure authentication
460
+ IngestionUrl:
404
461
Type: String
405
- Description: The destination in Sysdig's AWS account where your events are sent
462
+ Description: Sysdig Secure API endpoint URL
463
+ RateLimit:
464
+ Type: Number
465
+ Description: Maximum invocations per second for the API destination
406
466
Partition:
407
467
Type: String
408
468
Description: AWS Partition of your account or organization to create resources in
@@ -430,15 +490,26 @@ Resources:
430
490
PolicyDocument:
431
491
Version: "2012-10-17"
432
492
Statement:
433
- - Effect: Allow
434
- Action: 'events:PutEvents'
435
- Resource: !Sub ${TargetEventBusARN}
436
- - Effect: Allow
437
- Action:
438
- - "events:DescribeRule"
439
- - "events:ListTargetsByRule"
440
- Resource:
441
- - !Sub arn:${Partition}:events:*:*:rule/${Name}
493
+ - Sid: "InvokeApiDestination"
494
+ Effect: Allow
495
+ Action:
496
+ - "events:InvokeApiDestination"
497
+ Resource:
498
+ - !Sub "arn:${Partition}:events:*:*:api-destination/${Name}-destination/*"
499
+ - Sid: "CloudTrailEventRuleAccess"
500
+ Effect: Allow
501
+ Action:
502
+ - "events:DescribeRule"
503
+ - "events:ListTargetsByRule"
504
+ Resource:
505
+ - !Sub "arn:${Partition}:events:*:*:rule/${Name}"
506
+ - Sid: "ValidationAccess"
507
+ Effect: Allow
508
+ Action:
509
+ - "events:DescribeApiDestination"
510
+ - "events:DescribeConnection"
511
+ - "cloudwatch:GetMetricStatistics"
512
+ Resource: "*"
442
513
OrganizationRuleStackSet :
443
514
Type : AWS::CloudFormation::StackSet
444
515
Condition : IsOrganizational
@@ -463,8 +534,12 @@ Resources:
463
534
Parameters :
464
535
- ParameterKey : Name
465
536
ParameterValue : !Sub sysdig-secure-events-${NameSuffix}
466
- - ParameterKey : TargetEventBusARN
467
- ParameterValue : !Ref TargetEventBusARN
537
+ - ParameterKey : ApiKey
538
+ ParameterValue : !Ref ApiKey
539
+ - ParameterKey : IngestionUrl
540
+ ParameterValue : !Ref IngestionUrl
541
+ - ParameterKey : RateLimit
542
+ ParameterValue : !Ref RateLimit
468
543
- ParameterKey : RuleState
469
544
ParameterValue : !Ref RuleState
470
545
- ParameterKey : RuleEventPattern
@@ -505,9 +580,15 @@ Resources:
505
580
Name:
506
581
Type: String
507
582
Description: A unique identifier used to create and reference resources
508
- TargetEventBusARN :
583
+ ApiKey :
509
584
Type: String
510
- Description: The destination in Sysdig's AWS account where your events are sent
585
+ Description: API key for Sysdig Secure authentication
586
+ IngestionUrl:
587
+ Type: String
588
+ Description: Sysdig Secure API endpoint URL
589
+ RateLimit:
590
+ Type: Number
591
+ Description: Maximum invocations per second for the API destination
511
592
RuleState:
512
593
Type: String
513
594
Description: The state of the EventBridge Rule
@@ -523,19 +604,38 @@ Resources:
523
604
Type: String
524
605
Description: AWS Partition of your account or organization to create resources in
525
606
Resources:
607
+ EventBridgeConnection:
608
+ Type: AWS::Events::Connection
609
+ Properties:
610
+ Name: !Sub ${Name}-connection
611
+ AuthorizationType: API_KEY
612
+ AuthParameters:
613
+ ApiKeyAuthParameters:
614
+ ApiKeyName: X-Api-Key
615
+ ApiKeyValue: !Ref ApiKey
616
+
617
+ EventBridgeApiDestination:
618
+ Type: AWS::Events::ApiDestination
619
+ Properties:
620
+ Name: !Sub ${Name}-destination
621
+ ConnectionArn: !GetAtt EventBridgeConnection.Arn
622
+ InvocationEndpoint: !Ref IngestionUrl
623
+ HttpMethod: POST
624
+ InvocationRateLimitPerSecond: !Ref RateLimit
625
+
526
626
EventBridgeRule:
527
- Type: " AWS::Events::Rule"
627
+ Type: AWS::Events::Rule
528
628
Properties:
529
629
Name: !Ref Name
530
- Description: Capture all CloudTrail events
630
+ Description: Forwards events to Sysdig via API Destination for Sysdig Secure
531
631
EventPattern: !Ref RuleEventPattern
532
632
State: !Ref RuleState
533
633
Targets:
534
634
- Id: !Ref Name
535
- Arn: !Ref TargetEventBusARN
635
+ Arn: !GetAtt EventBridgeApiDestination.Arn
536
636
RoleArn: !Sub "arn:${Partition}:iam::${AWS::AccountId}:role/${Name}"
537
637
Outputs :
538
638
EventBridgeRoleARN :
539
639
Description : Sysdig Secure EventBridge Role ARN
540
640
Value :
541
- Fn::Sub : ${EventBridgeRole.Arn}
641
+ Fn::Sub : ${EventBridgeRole.Arn}
0 commit comments