OPA ABAC policy #676
Closed
ProninIgorr
started this conversation in
Community
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wrote a Rego policy that has a main function called getattributes. It should retrieve user attributes. In it, we need to send a request, receive a response. Then parse the received object and validate the schema using json.match_schema or json.verify_schema (I'm not sure which is better). If an error occurs at any stage, we should terminate the policy execution and return a 403 code with an error. Later, we will import this Rego policy into other Rego policies where attribute retrieval is required.
More details:
ABAC Implementation
When authorizing user requests, it is necessary to retrieve attributes of the requested objects from the consumer system.
To do this, we need to implement the "getAttributes" function that performs the following actions:
Sending a request to the consumer system at the specified URL
Retrieving data about the requested object from the consumer system
Parsing the received data
Validating the data based on a JSON schema
Handling possible errors
In case of an error, it is necessary to return a status code 403 and a unique event identifier
This function should be called in every Rego policy responsible for granting subject access to objects.
This is what I wrote. But this policy doesn't seem to work. What's the reason and how can I fix it?
Beta Was this translation helpful? Give feedback.
All reactions