Modules & Files
A module is one policy file.- Must start with a package
- Optional imports
- Then one or more rules
Rules
Value Rules (with if/else bodies)
- Branching with else
- Each block is a query of literals
Default Rules
- Sets a fallback value if no other rule branch applies
Function Rules
- Rules can take arguments, like functions
Set & Object Rules
Comprehension Rules
Expressions & Queries
Literals
- Expressions, not exprs
someexistential,everyuniversal
Assignments & Comparisons
Arithmetic & Boolean
References & Calls
With Modifiers
Collections & Scalars
Arrays, Objects, Sets
Scalars & Variables
Quantifiers
some/every
Negation
not
Membership
in
Builtins (Supported Categories)
Aggregates
Arrays
Sets
Objects
Strings
Numbers
Time
Conversions & Encoding
Regex
Semver
Not Yet Supported
- Crypto / Tokens / JWT: Not supported by design (e.g.,
crypto.*,jwtverify*,jwtencode*) - HTTP:
http.send— not implemented - GraphQL:
graphql.*— not implemented - Glob matching:
regex.globs_match— not implemented - JSON Patch:
json.patch— not implemented - Networking:
net.*— not implemented - AWS Providers:
providers.aws.*— not implemented - Rego Meta:
rego.metadata.*,rego.parse_module— not implemented - Template rendering:
strings.render_template— not implemented