Skip to content

Chore/cdk nag gen fixes#925

Merged
ybezsonov merged 3 commits into
mainfrom
chore/cdk-nag-gen-fixes
Jul 3, 2026
Merged

Chore/cdk nag gen fixes#925
ybezsonov merged 3 commits into
mainfrom
chore/cdk-nag-gen-fixes

Conversation

@ybezsonov

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Yuriy Bezsonov added 3 commits July 3, 2026 11:20
jqwik was used for a single "property" whose input space was just the
three IdeArch enum values - equivalent to a JUnit @ParameterizedTest
with @EnumSource, and with no extra dependency.

- Convert IdePropsTest.architectureDeterminesInstanceTypes to
  @ParameterizedTest + @EnumSource(IdeArch.class).
- Remove the net.jqwik:jqwik-engine test dependency.
- Remove the now-unused .jqwik-database .gitignore entry.

Also removes the jqwik-engine 1.10.1 anti-AI-agent banner it printed to
test stdout during synth. All 7 tests pass.
`npm run gen` synthesizes WorkshopStack with template.type=java-on-aws
(and 4 other template types), which create far more IAM than the default
synth. The previous enumerated appliesTo lists only matched the default
template's findings, so cdk synth failed with 87 uncovered
AwsSolutions-IAM4/IAM5 errors (Ide/UserPolicy, WorkshopBoundary, EKS,
Unicorn, ThreadAnalysis, AiJvmAnalyzer, PerfPlatform roles).

Replace the brittle enumerated appliesTo with RegexAppliesTo so the
suppressions match every IAM4 (Policy::*) and IAM5 (Action::* / Resource::*)
finding, robust across all template types and generated resource names.
Broad IAM is intentional for the ephemeral workshop environment.

Verified: cdk synth passes (rc=0, 0 non-compliant) for all five template
types - java-on-aws, java-on-amazon-eks, java-spring-ai-agents,
java-ai-agents, java-ai-agents-advanced.
Now that IAM4/IAM5 are suppressed via regex appliesTo, cdk-nag 2.38.2
works on the latest aws-cdk-lib. Verified: cdk synth passes with 0
non-compliant findings for all five template types on 2.260.

The earlier 2.250 "ceiling" was wrong - it was caused by enumerated
appliesTo not matching the full template's findings, not by the native
Validations framework introduced in 2.251. Rewrite NAG.md accordingly:
no aws-cdk-lib ceiling on the 2.x line; cdk-nag stays 2.x (3.x is
plugin-only and unneeded).
@ybezsonov ybezsonov merged commit 67cbeae into main Jul 3, 2026
49 checks passed
@ybezsonov ybezsonov deleted the chore/cdk-nag-gen-fixes branch July 3, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant