Skip to content

Commit 13f56b4

Browse files
committed
Remove obsolete NAG suppression paths
1 parent 1c1da19 commit 13f56b4

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

packages/cdk/nagSuppressions.ts

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable max-len */
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
22
import {Stack} from "aws-cdk-lib"
33
import {NagPackSuppression, NagSuppressions} from "cdk-nag"
44

@@ -33,18 +33,6 @@ export const nagSuppressions = (stack: Stack) => {
3333
]
3434
)
3535

36-
// Suppress API Gateway validation warning
37-
safeAddNagSuppression(
38-
stack,
39-
"/EpsAssistMeStack/EpsAssistApiGateway/ApiGateway/Resource",
40-
[
41-
{
42-
id: "AwsSolutions-APIG2",
43-
reason: "Validation is handled within Lambda; request validation is intentionally omitted."
44-
}
45-
]
46-
)
47-
4836
// Suppress API Gateway validation warning for Apis construct
4937
safeAddNagSuppression(
5038
stack,
@@ -70,12 +58,9 @@ export const nagSuppressions = (stack: Stack) => {
7058
)
7159

7260
// Suppress unauthenticated API route warnings
73-
safeAddNagSuppressionGroup(
61+
safeAddNagSuppression(
7462
stack,
75-
[
76-
"/EpsAssistMeStack/EpsAssistApiGateway/ApiGateway/Default/slack/ask-eps/POST/Resource",
77-
"/EpsAssistMeStack/Apis/EpsAssistApiGateway/ApiGateway/Default/slack/ask-eps/POST/Resource"
78-
],
63+
"/EpsAssistMeStack/Apis/EpsAssistApiGateway/ApiGateway/Default/slack/ask-eps/POST/Resource",
7964
[
8065
{
8166
id: "AwsSolutions-APIG4",
@@ -108,18 +93,6 @@ export const nagSuppressions = (stack: Stack) => {
10893
]
10994
)
11095

111-
// Suppress missing WAF on API stage
112-
safeAddNagSuppression(
113-
stack,
114-
"/EpsAssistMeStack/EpsAssistApiGateway/ApiGateway/DeploymentStage.prod/Resource",
115-
[
116-
{
117-
id: "AwsSolutions-APIG3",
118-
reason: "WAF not in current scope; may be added later."
119-
}
120-
]
121-
)
122-
12396
// Suppress missing WAF on API stage for Apis construct
12497
safeAddNagSuppression(
12598
stack,
@@ -286,7 +259,6 @@ export const nagSuppressions = (stack: Stack) => {
286259
const safeAddNagSuppression = (stack: Stack, path: string, suppressions: Array<NagPackSuppression>) => {
287260
try {
288261
NagSuppressions.addResourceSuppressionsByPath(stack, path, suppressions)
289-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
290262
} catch (err) {
291263
console.log(`Could not find path ${path}`)
292264
}

0 commit comments

Comments
 (0)