Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(core): CDK Synth Generates report for CFN guards #31798

Closed
2 tasks
justin-masse opened this issue Oct 17, 2024 · 5 comments
Closed
2 tasks

(core): CDK Synth Generates report for CFN guards #31798

justin-masse opened this issue Oct 17, 2024 · 5 comments
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. p3

Comments

@justin-masse
Copy link

Describe the feature

There are plenty of tools that let you check CFN Templates against defined (or generic) policies to make sure things like * do not end up in APIGW resource policies for example. But right now nothing exists to point this back to CDK code. I can highlight for dev teams in their CFN templates where the problem is but would like a way to also point to the actual CDK code in question.

Use Case

Looking to validate CDK code against company defined policies for what should be able to synth out to a CFN template (or at least provide a report of warnings/etc).

Proposed Solution

At synth time, allow a flag to be passed that would generate a report for warnings either with a "default (AWS defined)" policy of best practices or let users provide some sort of list/json of rules.

Something similar to using: https://github.com/aws-cloudformation/cloudformation-guard

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

doesnt matter

Environment details (OS name and version, etc.)

doesnt matter

@justin-masse justin-masse added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2024
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Oct 17, 2024
@adamjkeller
Copy link
Contributor

adamjkeller commented Oct 17, 2024

Hey @justin-masse, have you seen the policy validation at synthesis feature? If i'm understanding your ask correctly, you are looking for the ability to run the synthesized CloudFormation template against policy as code definitions using something like CloudFormation Guard. If that's the case, the policy at synth feature will help you accomplish that. Today there are a couple of supported plugins, check em out and hopefully they can help you.

CFN Guard Plugin
KICS CDK Validator Plugin

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p3 and removed needs-triage This issue or PR still needs to be triaged. labels Oct 17, 2024
@ashishdhingra
Copy link
Contributor

@adamjkeller Thanks for your reply.

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Oct 17, 2024
@justin-masse
Copy link
Author

Hey @justin-masse, have you seen the policy validation at synthesis feature? If i'm understanding your ask correctly, you are looking for the ability to run the synthesized CloudFormation template against policy as code definitions using something like CloudFormation Guard. If that's the case, the policy at synth feature will help you accomplish that. Today there are a couple of supported plugins, check em out and hopefully they can help you.

CFN Guard Plugin KICS CDK Validator Plugin

That may very well be it, let me dig in more to the implementation. Admittedly I just assumed this had not been implemented yet instead of checking first (my bad)

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 18, 2024
@justin-masse
Copy link
Author

This will work!

Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. p3
Projects
None yet
Development

No branches or pull requests

3 participants