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

Feature Request: Support Cloudformation Guard Custom Rules #356

Open
lorenzstorm1 opened this issue Aug 3, 2022 · 1 comment · May be fixed by #521
Open

Feature Request: Support Cloudformation Guard Custom Rules #356

lorenzstorm1 opened this issue Aug 3, 2022 · 1 comment · May be fixed by #521

Comments

@lorenzstorm1
Copy link

Please Support Custom Rules created by Cloudformation Guard:

https://aws.amazon.com/de/about-aws/whats-new/2022/08/build-aws-config-rules-cloudformation-guard/
https://github.com/aws-cloudformation/cloudformation-guard

@bmorrissirromb
Copy link
Collaborator

Some design notes on this...

  1. I think the differences between CfnGuard rules and Python Lambda rules are probably large enough to not reuse configRule.yaml and configRuleOrganization.yaml CFTs. Instead, we should split out configCfnGuardRule.yaml and configCfnGuardRuleOrganization.yaml.

  2. We'll pretty much only need one resource for CfnGuard rules: the Config rule itself. Within this rule, the Source key will need the most updates. Owner will be set to CUSTOM_POLICY, SourceIdentifier will not be provided, and (because CfnGuard rules do not support Periodic evaluation) SourceDetails will always be set to an array of:

- ConfigurationItemChangeNotification
- OversizedConfigurationItemChangeNotification

And of course, we'd need to update the CustomPolicyDetails section with the rule text itself (maximum 10k characters). Not sure if any flattening/formatting is necessary in CustomPolicyDetails.PolicyText. Would need a Boolean for EnableDebugLogDelivery. And PolicyRuntime probably just gets hardcoded to guard-2.x.x.

There's probably some other minor changes like removing InputParameters keys.

  1. configCfnGuardRuleOrganization.yaml will likely look similar.

  2. Next question is what the user experience will look like...we'll definitely need new runtime templates generated, perhaps with some commented-out guidance on how to write CfnGuard rules. Fortunately, we won't need rdklib support since there's no Lambda. We'll just need a runtime like guard-2.x.x, and support that in commands like rdk create myGuardRule --runtime guard-2.x.x. The parameters.json file will likely be shorter, too. On the deployment side, we'll need to update and test deploy, deploy-organization, modify, undeploy, and undeploy-organization. For deploy, we'll still probably keep the behavior of uploading a zip of the policy to S3, but I could be convinced otherwise.

  3. rdk.py will need someone to make the plumbing work to convert those new CfnGuard inputs into the outputs described in points 1-3. Not looking forward to that.

@bmorrissirromb bmorrissirromb linked a pull request Aug 2, 2024 that will close this issue
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 a pull request may close this issue.

2 participants