Announcing CloudQuery Policies
We are excited to announce the release of the CloudQuery Policies!
CloudQuery brings the power of SQL to your cloud infrastructure, providing easy monitoring, governance and security.
The new CloudQuery Policies feature brings policy-as-code to the CloudQuery ecosystem. CloudQuery Policies enable users to codify, version and run security, governance, cost and compliance rules, using SQL.
What’s inside?
- HCL support: Policies can be written in HCL and/or JSON as the logical layer and SQL as the query layer.
- Native GitHub support: Policies can be downloaded and run directly from GitHub via the CloudQuery CLI (
cloudquery policy download --help) - Views: Users can create complex SQL views once and reference them in subsequent queries.
- Query and sub-policy execution: Users can execute specific queries or sub-policies via CloudQuery CLI (
cloudquery policy run my-policy --sub-path=my-sub-policy). - Inline policy functions: New inline policy functions are now available that allow users to define more dynamic policies. One example is the new file function that allows users to out-source query definitions to other files and to dynamically insert them during execution time.
For detailed documentation please check-out our docs.
Example Policies
Basic
At the basic level, each policy contains the minimum version of cq-provider that it requires, and a list of SQL queries with their respective description.
Views
Sometimes there is the need to join between multiple tables. Instead of creating complex queries multiple times, views gives you the ability to define the view once and then reference the created view in other queries in your policies.
Policy-In-Policy
It is possible to nest policies inside policies to build a policy hierarchy that will give you the ability to reference and execute only a subset of the main policy file.
Running
We extended the CloudQuery CLI to support downloading and running policies directly from GitHub.
Download a policy repository:
Run specific policy (latest version):
Run specific policy version:
You can also run a specific query inside a policy:
What’s Next?
We are always eager to hear feedback so feel free to file feature-requests/bugs/issues on our GitHub.
Also, we have more exciting features coming up to enhance the new policy feature so subscribe to our twitter and/or mailing list.
Want to see CloudQuery in action? Schedule a demo with our team or check out the platform documentation to learn more.
Want help getting started? Join the CloudQuery community to connect with other users and experts, or message our team directly here if you have any questions.
Try CloudQuery yourself
Self-hosted, open source, and free to start. Or schedule a demo to see the managed version.



