Home / Companies / Snyk / Blog / Post Details
Content Deep Dive

Rego 103: Types of values and rules

Blog post from Snyk

Post Details
Company
Date Published
Author
Jasper Van der Jeugt, Becki Lee
Word Count
3,425
Company Posts That Month
30
Language
English
Hacker News Points
-
Post removed?
No
Summary

This blog post is the third installment in a series introducing Rego, the policy language for the Open Policy Agent (OPA), focusing on the types of values and rules. Rego allows users to write policy as code, using programming practices such as version control and modular design for evaluating cloud and infrastructure resources. The post delves into scalar and composite values in Rego, including strings, numbers, booleans, arrays, objects, and sets, and explains how to construct different types of rules, such as complete rules, set and object comprehensions, and functions. It provides examples of how these rules can be used to create policies that evaluate data in JSON format, particularly in the context of Kubernetes pods, emphasizing Rego's iteration process, which differs from imperative languages by using implicit iteration. The post encourages readers to experiment with Rego using the OPA Playground or command line tools and offers examples of practical application, such as ensuring containers in production-stage pods do not use the latest image, highlighting Rego's utility in maintaining compliance with security policies.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Kubernetes 1 1,844 208 85 +7%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.