Skip to content
Snippets Groups Projects
Commit f68fa087 authored by Yordan Kinkov's avatar Yordan Kinkov
Browse files

policy bundle convention

parent 06e1e392
No related branches found
No related tags found
1 merge request!3Policy bundle convention
......@@ -5,10 +5,11 @@ The Policies Repository contains REGO policies used for evaluation.
### Add Policy
You should follow the following naming syntax:
- Policy name must follow the following syntax: `{name}_{version}.rego`
> Example: loginpolicy_1.2.rego
- Policies are grouped in directories representing their organisation: `{group}/{policyName}_{version}.rego`
> Example: gaiax/loginpolicy_1.0.rego
- Policy must be named exactly `policy.rego`
- Policy is placed in the following directory structure: `{group}/{policyName}/{version}/policy.rego`
> Example: gaiax/loginpolicy/1.0/policy.rego
- The policy package must follow the following syntax: `{group}.{policyName}`
> Example: package gaiax.loginpolicy
- Data file could be added for each policy. It must be named `data.json` and placed in the same directory:
> Example: `{group}/{policyName}/{version}/data.json`
{
"namespace": "namespace",
"scope": "scope"
}
package example.cacheGet
default allow = false
result := cache.get("mykey", "mynamespace", "myscope")
{
"key": "value",
"scope": "scope"
}
package example.cacheSet
default success = false
success = true {
msg := cache.set("mykey", "mynamespace", "myscope", input)
msg == "success"
}
package example.examplePolicy
default allow = false
allow{
input.message == "example"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment