Skip to content

How to allow/restrict external data push to OPA only for specific data #261

Discussion options

You must be logged in to vote

You can have a system policy for authorization, see these docs. You can put anything into that policy, and it knows both the result of authentication (input.identity) and the request that's made (the rest of input).

If input.identity is system1, allow it to update particular data and when input.identity is system2, it should be allowed to update different section of external data not the one updated by system1.

Here's a sketch:

package system.authz

default allow := {
    "allowed": false,
    "reason": "unauthorized resource access"
}

allow := { "allowed": true } {
    input.identity == "system1"
    is_v1_data
    input.path[2] == "system1-stuff"
}

allow := { "allowed": true } {
   …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Kamalakannangv
Comment options

Answer selected by Kamalakannangv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants