Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
47 views

I'm working on a Rego/OPA policy, specifically for checking azure resources diagnostic settings compliant based on specified parameters. However, I'm having several issues when trying to compile my ...
delucaezequiel's user avatar
0 votes
0 answers
54 views

Iam trying to unMarshal AST json to ast.Module structure of OPA. policy.rego: package example.authz import rego.v1 allow if { some i input.users[i].role == "admin" } use command ...
user27911082's user avatar
0 votes
1 answer
126 views

The OPA WASM documentation mentions that built-in functions like http.send are not natively supported by WASM. However, I was able to successfully compile and evaluate WASM modules from Rego policies ...
Tarang's user avatar
  • 1
0 votes
0 answers
58 views

I'm trying to adapt the code in this answer to filter out certain resources exactly as desired over there. The challenge I'm running into is that as-is that code example does not distinguish between a ...
davidpricedev's user avatar
0 votes
1 answer
64 views

I'm trying to get a simple expansion of some relations using Rego's graph.reachable. For some reason this isn't printing leaf nodes and I've not yet figured out why. inherits_from[role_id] contains ...
Philip Couling's user avatar
1 vote
2 answers
484 views

Is there some program or feature that can turn a JSON object into a policy.rego file? I am aware there is currently a feature to turn a rego file into a JSON, but have not found anything to reverse ...
Nick's user avatar
  • 15
1 vote
0 answers
101 views

In the project I'm working on, we're getting OPA failures because our policy checks for tags on resources, but some resources do not allow tags, such as SNS. Is it possible to write a policy that can ...
Wilveren's user avatar
0 votes
0 answers
23 views

i'm writing a CircleCi config policy (which is rego based). The goal of this policy is to ensure that ANY pipeline-job (i.e. ignore other-jobs) must require other-job1. It other words, it should be ...
Bennie's user avatar
  • 519
2 votes
0 answers
73 views

I have the following dummy Rego policy is_permitted if { owner := dataowner.resources[input.resource][input.resource_id].owner permitted_members := data.owners[owner].permissions[input....
shays10's user avatar
  • 539
0 votes
1 answer
87 views

These are rules that are part of a apiVersion: templates.gatekeeper.sh/v1 kind: ConstraintTemplate Can you help me understand why this works (preventing the creation of deployments out of the limits):...
somedude's user avatar
  • 119
0 votes
1 answer
497 views

I have the following rego: retry_count_key := "retry" get_retries_count(str) := {x | some i parts := split(str[i], ":") parts[0] == retry_count_key x := to_number(...
Joey Stout's user avatar
1 vote
1 answer
247 views

I am writing very simple rego file but it is showing syntex error. Can anyone suggest what am I doing wrong? package example.accesscontrol # Define the allowed UPNs allowed_upns = {"[email protected]&...
Rahul Dankhara's user avatar
1 vote
1 answer
126 views

I whish to combine two arrays of Boolean value using AND. For example: a1 := [true, true, false], a2 := [false, true, false]. the resulting AND operation: a3 = a1 AND a2 would be [false, true, false]
PsychicPuppy's user avatar
1 vote
1 answer
221 views

I am trying to use OPA as authorization service for Trino. I wrote a rego file according to my needs. package mytrino import rego.v1 default allow := false allow if { input.action.operation == &...
Alper İnan's user avatar
0 votes
1 answer
790 views

I am new to OPA rule engine and have tried a few things out, I am unable to write a nested if in opa rule engine like output := someValue if { someValue := someOtherValue if { } } I know ...
Rohit Soni's user avatar
0 votes
0 answers
117 views

I am trying to integrate OPA with Envoy for authorization purposes. It works successfully with OPA without any external data calls, but I need to bundle my auth.rego file with a data.json file to ...
Jislin Anna Thomas's user avatar
1 vote
1 answer
251 views

In rego, I want to convert this: d := {"a": "aye", "B": "bEe"} to: l := {"a": "aye", "b": "bEe"} where the keys are ...
theherk's user avatar
  • 7,617
2 votes
2 answers
1k views

I'm working on a server configuration with: envoy proxy as a gateway, with a simple python web server behind it to serve web pages and API calls. Auth0 to authenticate my users. OPA as the ...
DannyA's user avatar
  • 1,561
0 votes
1 answer
76 views

I am new to OPA and have tried a lot to get this result: I want OPA to only allow access to /index. I am working on minikube with docker installed and I have a mciroservice as webserver. But the ...
Andrea's user avatar
  • 11
1 vote
0 answers
77 views

I am trying to use OPA as a Policy Engine in my test application. I have a node.js application running in minikube on macOS via Docker. The problem is, that since I installed OPA with quick_start.yaml ...
Andrea's user avatar
  • 11
0 votes
1 answer
107 views

I followed all these steps here: https://istio.io/latest/docs/setup/getting-started/ And then all steps for the Opa-Istio-Tutorial here: https://www.openpolicyagent.org/docs/envoy/tutorial-istio I don'...
Andrea's user avatar
  • 11
0 votes
1 answer
759 views

I'm trying to have a policy pass if a value in input_set matches a value in allow_values The below policy example is also here if you'd like to modify it easier - https://play.openpolicyagent.org/ I'm ...
user3367760's user avatar
0 votes
1 answer
785 views

I am very new to OPA but testing something very simple. I would like to create a policy to ensure my s3 is not public. my simple TF file: terraform { required_providers { aws = { source = ...
Tate_87's user avatar
  • 161
0 votes
1 answer
591 views

I am trying to write a policy for an endpoint that looks like /xyz/v1.0/applicationVersions?applicationName=blah&default=true&pageSize=3&pageNumber=1 What is a wildcard/regex match I can ...
Adi's user avatar
  • 399
0 votes
1 answer
131 views

I have the following Rego policy: package authz import future.keywords.in # The permissions the user has for each property permissions[property_id][permission] { some property_id, property_roles ...
dario's user avatar
  • 5,279
0 votes
1 answer
145 views

Example data: { "serviceA_primary": { "foo": 1 "bar": 2 }, "serviceA_secondary": { "foo": 1, "bar&...
saxo's user avatar
  • 89
2 votes
1 answer
207 views

I have the following helper function in a test of my OPA policy. I would like to make it more generic and return the resource with the commonName field only if cn is not empty. Any ideas on how I can ...
Erkan's user avatar
  • 163
1 vote
0 answers
263 views

I am looking to use the OPA policy based authorization in my project. I can use the bundle server to push my polices and data.json files to backend server and can evaluate policies for backend. I am ...
LiveSK's user avatar
  • 61
1 vote
1 answer
703 views

I created a Rego Policy but I would like to hide some of the objects from the output of the Rego. Lets take this simple Rego as an example. package cats default cats := false cats{ input.cat == ...
Matwo's user avatar
  • 11
1 vote
1 answer
251 views

I have the following response from an API and I need to get the resourceName if it consists the keywords -ecs-cloudwatch-policy. How can this be achieved in rego? { 'resourceId': 'ABCDEF12345', ...
Jessica's user avatar
  • 25
0 votes
2 answers
1k views

How can I merge the values of an object in rego (set type) into a single set containing all the object values ? This is my input object : input_data = { "1": { "bob": {"...
navi's user avatar
  • 1
0 votes
1 answer
836 views

I have 'JSON' file something like below, now i want to validate is label cat is set or not? "labels": { "apple": "one", "banana": "two", "cat&...
Antham's user avatar
  • 51
1 vote
0 answers
275 views

I am trying to validate some policies using the /opa/rego package. The policies are evaluated as expected in this script. But, I also want to count the number of rules and the rule names evaluated as ...
santoshdts's user avatar
1 vote
1 answer
917 views

This could potentially be a duplicate of this post but I'm still having real trouble. I have a function defined in one file. A.rego package authorizer default username := null decode_user(jwt) := ...
equatorial_daydreamer's user avatar
0 votes
1 answer
288 views

I got data something like this: { "TENANT1":{ <-- Multiple tenants "SITE1":{ <-- Every tenant can have multiple sites "SITE1_DEVICE1":[ <-- Every ...
Martin Hoang's user avatar
0 votes
1 answer
238 views

I want to implement complex validation but I don't have enough knowledge. This is how I imagine the rule to work in python: input_data = { "attributes": { "request": { ...
RubiniuM's user avatar
1 vote
1 answer
632 views

While I was trying to compile the code, getting below error. I have imported "github.com/open-policy-agent/opa/rego" but still getting the error. -bash-4.2$ go build main.go # command-line-...
van neilsen's user avatar
1 vote
1 answer
365 views

I am looking into creating a custom Azure policy for AKS deployments. There is a bunch of built in policies available: https://learn.microsoft.com/en-us/azure/aks/policy-reference but I have not found ...
Kjempen's user avatar
  • 25
3 votes
1 answer
1k views

According to the Open Policy Agent documentation, in Rego, every evaluates either to true or undefined. Why not true or false? What is it about Rego that suggests false is the wrong value? By ...
Old Pro's user avatar
  • 25.8k
0 votes
1 answer
959 views

In OPA, I take an input of type { roles, action, object }, and I return a matching permission which contains data regarding what the user is allowed to do based on the input This is rather simple if ...
Jason's user avatar
  • 743
2 votes
2 answers
4k views

I have a simple rego file like this: package example default isApplicable := false isApplicable if { timeNow := time.now_ns() timeNow >= input.startDatetime } and I keep getting parse ...
rsc's user avatar
  • 10.7k
0 votes
1 answer
1k views

I have a pretty common use case where I would like to cache the results of a http.send for a given amount of time. I know I can do something like value := http.send({ "url": "https:/...
Adi's user avatar
  • 399
0 votes
1 answer
296 views

I have an array as defined below ["dev=devA", "instance=instanceA", "domain=domainA", "namespace=namespaceA", "...
raj ramalingam's user avatar
0 votes
1 answer
790 views

I'm trying to integrate OPA/open policy agent/ into gitlab ci-cd job, and evaluate it against terraform plan output. I have independent rules in rego file and want to run each of them from package ...
kini_dot's user avatar
1 vote
3 answers
926 views

I am still in the testing phase and would like to allow merging of my PR even if the policy_check is FAIlING. What flag I can pass to enable that ? My current config: repos: - id: /.*/ ...
chan214's user avatar
  • 31
1 vote
1 answer
842 views

I have written a OPA policy that creates the following output: [ { "permission": [ "module:get", "workflow:get", "...
Swan2017's user avatar
0 votes
1 answer
474 views

I have a rule that I expect to be reused by a variety of modules. I figured, let's turn that into a function, have the modules pass their input into a function and use a set comprehension like ...
Szymon Rozga's user avatar
  • 18.2k
2 votes
1 answer
1k views

I've below json as an input: { "data": { "abc": 123, "Abc": 345, "bcd": 789 } } I want the result like: { "data": ...
Shivshankar Nagarsoge's user avatar
0 votes
1 answer
2k views

I'm experimenting with OPA and securing HTTP REST API. I want to implement ABAC authorization. My question is if it's possible to create rules in such a way that only those relevant to the request ...
goatrenz's user avatar
0 votes
1 answer
2k views

I'm using OPA to write an access policy to a microservice, and I'm now tackling the problem of matching an URL containing a path param. The URL follows the pattern: /v1/users/{uuid} I came up with the ...
João Simões's user avatar