Skip to content

Commit c379a1f

Browse files
Update: [AEA-6211] - INT specific doc sync role perms (#355)
## Summary - Routine Change ### Details imports ci-resources role and gives it needed permissions.
1 parent 8faef12 commit c379a1f

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

packages/cdk/nagSuppressions.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,21 @@ export const nagSuppressions = (stack: Stack, account: string) => {
444444
]
445445
)
446446

447+
// Suppress DocumentSyncRole wildcard permissions
448+
const docSyncRole = stack.node.tryFindChild("AssistMeDocumentSyncRole")
449+
if (docSyncRole) {
450+
NagSuppressions.addResourceSuppressions(
451+
docSyncRole,
452+
[
453+
{
454+
id: "AwsSolutions-IAM5",
455+
reason: "Document Sync Role requires wildcard permissions for S3 sync operations."
456+
}
457+
],
458+
true
459+
)
460+
}
461+
447462
}
448463

449464
const safeAddNagSuppression = (stack: Stack, path: string, suppressions: Array<NagPackSuppression>) => {

packages/cdk/stacks/EpsAssistMeStack.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ export class EpsAssistMeStack extends Stack {
4141
const regressionTestRoleArn = Fn.importValue("ci-resources:AssistMeRegressionTestRole")
4242
const auditLoggingBucketImport = Fn.importValue("account-resources:AuditLoggingBucket")
4343

44+
// document sync role
45+
const assistMeDocumentSyncRoleArn = Fn.importValue("ci-resources:AssistMeDocumentSyncRole")
46+
4447
// Get variables from context
4548
const region = Stack.of(this).region
4649
const account = Stack.of(this).account
@@ -260,6 +263,16 @@ export class EpsAssistMeStack extends Stack {
260263
regressionTestRole.addManagedPolicy(regressionTestPolicy)
261264
}
262265

266+
// Grant Access to Document Sync Role
267+
const assistMeDocumentSyncRole = Role.fromRoleArn(
268+
this,
269+
"AssistMeDocumentSyncRole",
270+
assistMeDocumentSyncRoleArn
271+
)
272+
273+
storage.kbDocsBucket.grantRead(assistMeDocumentSyncRole)
274+
storage.kbDocsKmsKey.grantDecrypt(assistMeDocumentSyncRole)
275+
263276
// Output: SlackBot Endpoint
264277
new CfnOutput(this, "SlackBotEventsEndpoint", {
265278
value: `https://${apis.apis["api"].api.domainName?.domainName}/slack/events`,

0 commit comments

Comments
 (0)