StyraInc / opa-aws-cloudformation-hook

AWS Cloudformation Hook for OPA-powered infrastructure policy enforcement
Apache License 2.0
35 stars 5 forks source link

Rewrite test-templates.py to work on provided file or directory #20

Closed anderseknert closed 2 years ago

anderseknert commented 2 years ago

The script currently reads the templates directory for all templates, and submits them to OPA for validation one by one.

It would be a great improvement if we instead allowed the user to point the tool at either a single template, or a directory. This would allow them to use the same tool for their own policy authoring, where they'd run OPA locally, and submitted templates converted to JSON to OPA, and have the script return the output. Suggested steps, but these are very much just some ideas:

anderseknert commented 2 years ago

If we can get this out before release, I can use this in the docs to provide an example of local development / testing.