Hi All,
Cloudformation is way to define your infrastructure as code (IaC) and last month AWS released cfn-guard which is a command line tool to check your cloudformation templates against certain rules.
It’s a pretty cool little utility, you can generate rules from previous templates and there are examples to get you started.
I walk through one of my previous CDK projects (AppSync WAF) and generate rules based on the template generated from the synth. I then update the rules and the project to modify the firewall rules and the type of authentication used with AppSync. This tests cfn-guard by checking template against my policy and find that the firewall and appsync are not compliant.
Some other stand outs:
- Compatible with CI/CD
- Error 0, 2 codes with overrides
- Firewall like syntax
I’ve written an article here if you want to check out the full write up:
https://www.talkncloud.com/cloudformation-cfn-guard-policy-as-code/
You can access my repo here for this project here:
https://github.com/talkncloud/aws/tree/main/appsync-waf-guard
You can access cloudformation guard on github here:
https://github.com/aws-cloudformation/cloudformation-guard
Keen to hear what others think of this and if you’ve already started using cfn-guard.
Cheers,
Mick.
Related discussions: