Skip to content

OPA policy groups import #711

Closed
Closed
@adwiza

Description

@adwiza

Hello.
I have a configmap opagroups in the namespace opa-prod with data.json with groups
but groups are not work, how to import them from this configmap correctly, or also have integration
trino with keycloak and it works as expected, may be I could get groups from keycloak?
version stackable 24.11.1 and version of OPA 0.67.1

{
  "dataops": ["a.user1"],
  "analytics": ["b.user2"]
}

and trino.rego file

            package trino

            import data.bundles.opagroups.dataops
            import data.bundles.opagroups.analytics


            import future.keywords.contains
            import future.keywords.in
            import future.keywords.if

            default allow = false

            allow {
              input.user == "admin"
            }

            group_member(group) if input.context.identity.user in data.groups[group]
            user_is_group_member(user, group) if user in data.groups[group]

            # Full Access for admin user, dataops and analytics groups
            allow {
              group_member("admin")
            }
            batch[i] {
              some i
              input.action.filterResources[i]
              group_member("admin")
            }

            allow {
              group_member("dataops")
            }
            batch[i] {
              some i
              input.action.filterResources[i]
              group_member("dataops")
            }

            allow {
              group_member("analytics")
            }
            batch[i] {
              some i
              input.action.filterResources[i]
              group_member("analytics")
            }
.....
            data := {
              "groups" : {
                "admin": ["admin"],
                "dataops": dataops,
                "analytics": analytics,        
              },
              "catalog_acls" : [
                {
                  "catalog": "icebergnessie",
                  "full": ["analytics", "dataops"],
                },
                {
                  "catalog": "iceberg",
                  "full": ["analytics", "dataops"],
                }
              ],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions