feat: CdkNagValidationFailure
should use failing rule's ruleId
as findingId
#1818
Closed
1 of 2 tasks
Labels
feature-request
A feature should be added or improved.
Description
In order to allow fine-grained suppression of
CdkNagValidationFailure
annotations viaappliesTo
inNagSuppressions
,CdkNagValidationFailure
should treat the rule on which the error occurred as thefindingId
for the message and suppression evaluation.Further, if a suppression that has no
appliesTo
is already in place for the rule , theCdkNagValidationFailure
should also be suppressed .Use Case
Error suppression should be scoped as tightly as possible to avoid accidentally suppressing unexpected errors.
As an example, I have an
AwsCustomResource
construct, which usesFn::FindInMap
to find the latest node runtime by region. As a result, ruleAwsSolutions-L1
throws an error during validation, despite being suppressed for the custom resource.Hence I want to suppress
CdkNagValidationFailure
for this known and expected exception, but do not want to suppress any other validation failures on the same resource.Proposed Solution
Modify
CdkNagValidationFailure
to treat theruleId
as other rules treatfindingId
, allowing fine-grained suppression ofCdkNagValidationFailure
like so:Even better, if I already have the following suppression then validation failures for that rule on the given resource would be suppressed automatically:
Other information
No response
Acknowledge
The text was updated successfully, but these errors were encountered: