forked from aws-samples/aws-cudos-framework-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cid-admin-policies.yaml
632 lines (589 loc) · 23.2 KB
/
cid-admin-policies.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
AWSTemplateFormatVersion: '2010-09-09'
Description: This template is for an Organization Admin who needs to delegate management of the Cloud Intelligence Dashboards Stacks. This stack adds a set of policies to an Existing Role to allow full autonomy in deployment.
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: 'Role'
Parameters:
- RoleName
- Label:
default: Permissions for the Data Collection Account (where the Dashboards will be deployed)
Parameters:
- CloudIntelligenceDashboardsCFNManagement
- CURDestination
- QuickSightManagement
- QuickSightAdmin
- Label:
default: Permissions for the CUR Source Account (typically a Payer Account)
Parameters:
- CURReplication
cfn-lint:
config:
ignore_checks:
- W2001
Parameters:
RoleName:
Type: String
Description: Name of the Existing IAM Role to grant the permissions to
QuickSightManagement:
Type: String
Description: "Choose Yes only when deploying this stack in the account where your Dashboards will be deployed. This grants the specified role above rights to all QuickSight Enterprise actions as per: https://docs.aws.amazon.com/quicksight/latest/user/iam-policy-examples.html#security_iam_id-based-policy-examples-all-access-enterprise-edition"
Default: 'no'
AllowedValues: ["yes", "no"]
QuickSightAdmin:
Type: String
Description: "(OPTIONAL) Choose Yes only when deploying this stack in the account where your Dashboards will be deployed. Grant all QuickSight permissions (QuickSight:*)"
Default: 'no'
AllowedValues: ["yes", "no"]
CloudIntelligenceDashboardsCFNManagement:
Type: String
Description: "Choose Yes only when deploying this stack in the account where your Dashboards will be deployed. This grants the specified role above rights to deploy the Cloud Intelligence Dashboards via CloudFormation"
Default: 'no'
AllowedValues: ["yes", "no"]
CURDestination:
Type: String
Description: "Choose Yes only when deploying this stack in the account where your Dashboards will be deployed. This grants the specified role above rights to create an S3 bucket for replicated CUR data Data Collection Account"
Default: 'no'
AllowedValues: ["yes", "no"]
CURReplication:
Type: String
Description: "Choose Yes only when deploying this stack in a Source/Payer account. This grants the specified role rights to create CUR & define Replication Rule in the Source Account"
Default: 'no'
AllowedValues: ["yes", "no"]
Conditions:
CreateQuickSightManagementPolicy: !Equals [ !Ref QuickSightManagement, "yes" ]
CreateCloudIntelligenceDashboardsCFNManagementPolicy: !Equals [ !Ref CloudIntelligenceDashboardsCFNManagement, "yes" ]
CreateQuickSightAdminPolicy: !Equals [ !Ref QuickSightAdmin, "yes" ]
CreateCURDestinationPolicy: !Equals [ !Ref CURDestination, "yes" ]
CreateCURReplicationPolicy: !Equals [ !Ref CURReplication, "yes" ]
Resources:
QuickSightAdminPolicy:
Type: AWS::IAM::ManagedPolicy
Condition: CreateQuickSightAdminPolicy
Properties:
ManagedPolicyName: CidQuickSightAdminPolicy
Description: 'CloudIntelligenceDashboards Policy for QuickSight Full Admin'
Roles:
- !Ref RoleName
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: DirectoryService
Effect: Allow
Action:
- QuickSight:*
Resource: '*' #Explicitly allow all on QuickSight for QuickSight Admin
Metadata:
cfn_nag:
rules_to_suppress:
- id: F5
reason: "Explicitly allow all on QuickSight for QuickSight Admin."
- id: W13
reason: "Explicitly allow all on QuickSight for QuickSight Admin."
- id: W28
reason: "No Replacement needed"
QuickSightManagementPolicy:
Type: AWS::IAM::ManagedPolicy
Condition: CreateQuickSightManagementPolicy
Properties:
ManagedPolicyName: CidQuickSightManagementPolicy
Description: 'CloudIntelligenceDashboards Policy for QuickSight initial setup'
Roles:
- !Ref RoleName
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: DirectoryService
Effect: Allow
Action:
- ds:AuthorizeApplication
- ds:CreateAlias
- ds:CreateIdentityPoolDirectory
- ds:DeleteDirectory
- ds:UnauthorizeApplication
Resource: '*' # as per doc https://docs.aws.amazon.com/quicksight/latest/user/iam-policy-examples.html#security_iam_id-based-policy-examples-all-access-enterprise-edition
- Sid: IAM
Action:
- iam:AttachRolePolicy
- iam:CreatePolicy
- iam:CreatePolicyVersion
- iam:CreateRole
- iam:PassRole
- iam:DeletePolicyVersion
- iam:DetachRolePolicy
Effect: Allow
Resource:
- !Sub arn:aws:iam::${AWS::AccountId}:role/service-role/aws-quicksight-service-role-v0
- Sid: QuickSight
Action:
- quicksight:CreateAccountSubscription
- quicksight:CreateAdmin
- quicksight:CreateUser
- quicksight:CreateNamespace
- quicksight:SearchDirectoryGroups
- quicksight:SetGroupMapping
- quicksight:Subscribe
- quicksight:Unsubscribe
- quicksight:UpdateAccountSettings
Effect: Allow
Resource: '*' # as per doc https://docs.aws.amazon.com/quicksight/latest/user/iam-policy-examples.html#security_iam_id-based-policy-examples-all-access-enterprise-edition
- Sid: S3
Action:
- s3:ListBucket
- s3:GetObject
- s3:GetObjectVersion
- s3:PutObject
- s3:ListBucketMultipartUploads
- s3:GetBucketLocation
- s3:AbortMultipartUpload
- s3:ListMultipartUploadParts
Effect: Allow
Resource:
- !Sub arn:aws:s3:::cid-${AWS::AccountId}-shared
- !Sub arn:aws:s3:::aws-athena-query-results-cid-${AWS::AccountId}-${AWS::Region}
- !Sub arn:aws:s3:::athena-query-result-${AWS::AccountId}
- Sid: ReadOnly
Action:
- ds:CheckAlias
- ds:DescribeDirectories
- ds:DescribeTrusts
- iam:GetPolicy
- iam:GetPolicyVersion
- iam:GetRole
- iam:ListAccountAliases
- iam:ListAttachedRolePolicies
- iam:ListEntitiesForPolicy
- iam:ListPolicyVersions
- iam:ListRoles
- quicksight:DescribeAccountSettings
- quicksight:DescribeAccountSubscription
- quicksight:GetGroupMapping
- quicksight:ListUsers
- s3:ListAllMyBuckets
Effect: Allow
Resource: '*' # as per doc https://docs.aws.amazon.com/quicksight/latest/user/iam-policy-examples.html#security_iam_id-based-policy-examples-all-access-enterprise-edition
Metadata:
cfn_nag:
rules_to_suppress:
- id: W13
reason: "Some resources are not possible to restrict. See comments."
- id: W28
reason: "No Replacement needed"
CloudIntelligenceDashboardsCFNManagementPolicy:
Type: AWS::IAM::ManagedPolicy
Condition: CreateCloudIntelligenceDashboardsCFNManagementPolicy
Properties:
ManagedPolicyName: CidCloudIntelligenceDashboardsCFNManagementPolicy
Description: 'CloudIntelligenceDashboards Policy for CFN deployment'
Roles:
- !Ref RoleName
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: Athena
Action:
- athena:CreateWorkGroup
- athena:UpdateWorkGroup
- athena:DeleteWorkGroup
- athena:GetWorkGroup
Effect: Allow
Resource:
- !Sub arn:aws:athena:${AWS::Region}:${AWS::AccountId}:workgroup/CID
- Sid: CloudFormation
Action:
- cloudformation:CreateStack
- cloudformation:DeleteStack
- cloudformation:DescribeStackEvents
- cloudformation:DescribeStackResource
- cloudformation:DescribeStacks
- cloudformation:GetStackPolicy
- cloudformation:ListChangeSets
- cloudformation:ListStackResources
- cloudformation:RollbackStack
- cloudformation:UpdateStack
Effect: Allow
Resource:
- !Sub arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/Cloud-Intelligence-Dashboards/*
- Sid: EventBridge
Action:
- events:DeleteRule
- events:DescribeRule
- events:EnableRule
- events:PutRule
- events:PutTargets
- events:RemoveTargets
Effect: Allow
Resource:
- !Sub arn:aws:events:${AWS::Region}:${AWS::AccountId}:rule/Cloud-Intelligence-Dashboards-SpiceRefreshRule-*
- Sid: GlueCrawler
Action:
- glue:CreateCrawler
- glue:DeleteCrawler
- glue:GetCrawler
- glue:StopCrawler
Effect: Allow
Resource:
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:crawler/CidCrawler
- Sid: GlueDatabase
Action:
- glue:CreateDatabase
- glue:UpdateDatabase
- glue:DeleteDatabase
- glue:GetDatabase
- glue:GetDatabases
Effect: Allow
Resource:
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:database/cid_cur
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:database/cid_cur/*
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:table/cid_cur/*
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:catalog
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:userDefinedFunction/cid_cur/*
- Sid: GlueTable
Action:
- glue:CreateTable
- glue:UpdateTable
- glue:DeleteTable
Effect: Allow
Resource:
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:database/cid_cur
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:table/cid_cur/*
- !Sub arn:aws:glue:${AWS::Region}:${AWS::AccountId}:catalog
- Sid: IAMForCFN
Action:
- iam:AttachRolePolicy
- iam:CreateRole
- iam:DeleteRole
- iam:DeleteRolePolicy
- iam:DetachRolePolicy
- iam:GetRole
- iam:GetRolePolicy
- iam:PassRole
- iam:PutRolePolicy
Effect: Allow
Resource:
- !Sub arn:aws:iam::${AWS::AccountId}:role/CidSpiceRefreshExecutionRole
- !Sub arn:aws:iam::${AWS::AccountId}:role/Cloud-Intelligence-*-* #Roles created by CFN stack. Name is hardcoded here
- !Sub arn:aws:iam::${AWS::AccountId}:role/CidQuickSightDataSourceRole
- !Sub arn:aws:iam::${AWS::AccountId}:role/CidExecRole
- Sid: LambdaForCFN
Action:
- lambda:AddPermission
- lambda:CreateFunction
- lambda:DeleteFunction
- lambda:GetFunction
- lambda:InvokeFunction
- lambda:RemovePermission
- lambda:UpdateFunctionConfiguration
- lambda:UpdateFunctionCode
- lambda:PublishLayerVersion
- lambda:GetLayerVersion
- lambda:DeleteLayerVersion
Effect: Allow
Resource:
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:Cid*
# - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:CidProcessPath-DoNotRun
# - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:CidCustomResourceProcessPath-DoNotRun
# - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:CidCustomResourceDashboard
# - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:CidCustomResourceFunctionInit-DoNotRun
# - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:CidInitialSetup-DoNotRun #legacy
# - !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:CidSpiceRefreshLambda
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:layer:CidLambdaLayer*
- Sid: QuickSightDashboard
Action:
- quicksight:CreateDashboard
- quicksight:DeleteDashboard
- quicksight:UpdateDashboard
- quicksight:DescribeDashboard
Effect: Allow
Resource:
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dashboard/cudos*
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dashboard/cost_intelligence_dashboard
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dashboard/kpi_dashboard
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dashboard/ta-organizational-view
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dashboard/trends-dashboard
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dashboard/compute-optimizer-dashboard
- Sid: QuickSightCreateDataSource
Action:
- quicksight:CreateDataSource
- quicksight:PassDataSource
- quicksight:UpdateDataSource
- quicksight:DeleteDataSource
- quicksight:DescribeDataSource
- quicksight:ListTagsForResource
- quicksight:DescribeDataSourcePermissions
- quicksight:UpdateDataSourcePermissions
Effect: Allow
Resource:
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:datasource/CID-*
- Sid: QuickSightDataSet
Action:
- quicksight:CreateDataSet
- quicksight:DeleteDataSet
- quicksight:PassDataSet
- quicksight:DescribeDataSet
- quicksight:DescribeDataSetPermissions
- quicksight:UpdateDataSetPermissions
Effect: Allow
Resource:
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dataset/* # DataSetIDs are dynamic
- Sid: QuickSightDataSetSchedule
Action:
- quicksight:CreateRefreshSchedule
- quicksight:UpdateRefreshSchedule
- quicksight:DeleteRefreshSchedule
- quicksight:DescribeRefreshSchedule
- quicksight:ListRefreshSchedules
- quicksight:CreateDataSetRefreshProperties
- quicksight:DescribeDataSetRefreshProperties
- quicksight:UpdateDataSetRefreshProperties
- quicksight:DeleteDataSetRefreshProperties
Effect: Allow
Resource:
- !Sub arn:aws:quicksight:${AWS::Region}:${AWS::AccountId}:dataset/*/refresh-schedule/* # DataSetIDs are dynamic as well as schedule ids
- Sid: CreateQueryResultsBucketS3
Action:
- s3:CreateBucket
- s3:DeleteBucket
- s3:GetBucketLocation
- s3:GetObject
- s3:ListBucket
- s3:PutBucketAcl
- s3:PutBucketOwnershipControls
- s3:PutBucketPolicy
- s3:PutBucketPublicAccessBlock
- s3:PutBucketVersioning
- s3:PutEncryptionConfiguration
- s3:PutLifecycleConfiguration
- s3:PutObject
Effect: Allow
Resource:
- !Sub arn:aws:s3:::aws-athena-query-results-cid-${AWS::AccountId}-${AWS::Region}
- !Sub arn:aws:s3:::aws-athena-query-results-cid-${AWS::AccountId}-${AWS::Region}/*
- Sid: ReadLambdaLayerS3
Action:
- s3:GetObject
Effect: Allow
Resource:
- !Sub arn:aws:s3:::aws-managed-cost-intelligence-dashboards-${AWS::Region}/cid-resource-lambda-layer/*
- Sid: ReadOnlyCFN
Action:
- cloudformation:GetTemplate
- cloudformation:GetTemplateSummary
- cloudformation:ListStacks
- cloudformation:ValidateTemplate
Effect: Allow
Resource: '*' # Read only Rights needed for CFN operator
Metadata:
cfn_nag:
rules_to_suppress:
- id: W13
reason: "Some resources are not possible to restrict. See comments."
- id: W28
reason: "No Replacement needed"
CURDestinationPolicy:
Type: AWS::IAM::ManagedPolicy
Condition: CreateCURDestinationPolicy
Properties:
ManagedPolicyName: CidCURDestinationPolicy
Description: 'CloudIntelligenceDashboards Policy for Deployment of CUR at Destination (Data Collection Account)'
Roles:
- !Ref RoleName
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: CloudFormation
Action:
- cloudformation:CreateChangeSet
- cloudformation:CreateStack
- cloudformation:DeleteStack
- cloudformation:DescribeStackEvents
- cloudformation:DescribeStacks
- cloudformation:GetStackPolicy
- cloudformation:ListStackResources
- cloudformation:RollbackStack
- cloudformation:UpdateStack
Effect: Allow
Resource:
- !Sub arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/CID-CUR-Destination/*
- Sid: IAMForCFN
Action:
- iam:CreateRole
- iam:DeleteRole
- iam:DeleteRolePolicy
- iam:GetRole
- iam:GetRolePolicy
- iam:PutRolePolicy
- iam:PassRole
Effect: Allow
Resource:
- !Sub arn:aws:iam::${AWS::AccountId}:role/cid/CID-CUR-Destination-CIDLambdaAnalyticsRole-*
- !Sub arn:aws:iam::${AWS::AccountId}:role/cid/CID-CUR-Destination-CIDLambdaCURCreatorRole-*
- Sid: Lambda
Action:
- lambda:CreateFunction
- lambda:DeleteFunction
- lambda:GetFunction
- lambda:InvokeFunction
- lambda:UpdateFunctionConfiguration
- lambda:UpdateFunctionCode
Effect: Allow
Resource:
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:cid-CID-Analytics
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:cid-CID-CURCreator
- Sid: S3
Action:
- s3:CreateBucket
- s3:DeleteBucket
- s3:GetBucketLocation
- s3:GetBucketPolicy
- s3:GetObject
- s3:ListBucket
- s3:ListBucketVersions
- s3:PutBucketAcl
- s3:PutBucketOwnershipControls
- s3:PutBucketPolicy
- s3:PutBucketPublicAccessBlock
- s3:PutBucketVersioning
- s3:PutEncryptionConfiguration
- s3:PutLifecycleConfiguration
- s3:PutObject
Effect: Allow
Resource:
- !Sub arn:aws:s3:::cid-${AWS::AccountId}-shared
- !Sub arn:aws:s3:::cid-${AWS::AccountId}-shared/*
- Sid: CostUsageReport
Action:
- cur:DeleteReportDefinition
- cur:DescribeReportDefinitions
- cur:PutReportDefinition
Effect: Allow
Resource:
- !Sub arn:aws:cur:*:${AWS::AccountId}:definition/cid
- Sid: CostUsageReportForDelete
Action:
- cur:DescribeReportDefinitions
Effect: Allow
Resource:
- !Sub arn:aws:cur:*:${AWS::AccountId}:definition/
- Sid: ReadOnly
Action:
- cloudformation:GetTemplate
- cloudformation:GetTemplateSummary
- cloudformation:ListStacks
- s3:ListAllMyBuckets #?
Effect: Allow
Resource: '*' # ReadOnly Policy for CFN
Metadata:
cfn_nag:
rules_to_suppress:
- id: W13
reason: "Some resources are not possible to restrict. See comments."
- id: W28
reason: "No Replacement needed"
CURReplicationPolicy:
Type: AWS::IAM::ManagedPolicy
Condition: CreateCURReplicationPolicy
Properties:
ManagedPolicyName: CidCURReplicationPolicy
Description: 'CloudIntelligenceDashboards Policy for CUR Creating and Setting Replication'
Roles:
- !Ref RoleName
PolicyDocument:
Version: '2012-10-17'
Statement:
- Sid: CloudFormation
Action:
- cloudformation:CreateChangeSet
- cloudformation:CreateStack
- cloudformation:DeleteStack
- cloudformation:DescribeStackEvents
- cloudformation:DescribeStacks
- cloudformation:GetStackPolicy
- cloudformation:ListStackResources
- cloudformation:RollbackStack
- cloudformation:UpdateStack
Effect: Allow
Resource:
- !Sub arn:aws:cloudformation:${AWS::Region}:${AWS::AccountId}:stack/CID-CUR-Replication/*
- Sid: CostUsageReport
Action:
- cur:DeleteReportDefinition
- cur:DescribeReportDefinitions
- cur:PutReportDefinition
Effect: Allow
Resource:
- !Sub arn:aws:cur:*:${AWS::AccountId}:definition/cid
- Sid: CostUsageReportForDelete
Action:
- cur:DescribeReportDefinitions
Effect: Allow
Resource:
- !Sub arn:aws:cur:*:${AWS::AccountId}:definition/
- Sid: IAMForCFN
Action:
- iam:CreateRole
- iam:DeleteRole
- iam:DeleteRolePolicy
- iam:GetRole
- iam:GetRolePolicy
- iam:ListRoles
- iam:PassRole
- iam:PutRolePolicy
Effect: Allow
Resource:
- !Sub arn:aws:iam::${AWS::AccountId}:role/cid/CID-CUR-Replication-*
- Sid: LambdaForCFN
Action:
- lambda:CreateFunction
- lambda:DeleteFunction
- lambda:GetFunction
- lambda:GetFunctionCodeSigningConfig
- lambda:GetRuntimeManagementConfig
- lambda:InvokeFunction
- lambda:UpdateFunctionConfiguration
- lambda:UpdateFunctionCode
Effect: Allow
Resource:
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:cid-CID-Analytics
- !Sub arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:cid-CID-CURCreator
- Sid: S3
Action:
- s3:CreateBucket
- s3:DeleteBucket
- s3:DeleteBucketPolicy
- s3:ListBucketVersions
- s3:DeleteObject
- s3:DeleteObjectVersion
- s3:GetBucketLocation
- s3:GetBucketPolicy
- s3:GetObject
- s3:ListBucket
- s3:PutBucketAcl
- s3:PutBucketOwnershipControls
- s3:PutBucketPolicy
- s3:PutBucketPublicAccessBlock
- s3:PutBucketVersioning
- s3:PutEncryptionConfiguration
- s3:PutLifecycleConfiguration
- s3:PutObject
- s3:PutReplicationConfiguration
Effect: Allow
Resource:
- !Sub arn:aws:s3:::cid-${AWS::AccountId}-local
- !Sub arn:aws:s3:::cid-${AWS::AccountId}-local/*
- Sid: ReadOnly
Action:
- cloudformation:GetTemplate
- cloudformation:GetTemplateSummary
- cloudformation:ListStacks
- s3:ListAllMyBuckets
Effect: Allow
Resource: '*' # ReadOnly Policy for CFN
Metadata:
cfn_nag:
rules_to_suppress:
- id: W13
reason: "Some resources are not possible to restrict. See comments."
- id: W28
reason: "No Replacement needed"