Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate group claims for Authservice applications with Istio #1136

Open
rjferguson21 opened this issue Dec 19, 2024 · 0 comments
Open

Validate group claims for Authservice applications with Istio #1136

rjferguson21 opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@rjferguson21
Copy link
Contributor

When users today leverage the sso.groups field to ensure only authorized users can access their application the enforcement is done via a Keycloak plugin during authentication.

An extension of this functionality which would further our defense in depth would be to leverage Istio AuthorizationPolicy to validate the groups claim contains a matching group as well. As part of the existing authservice logic, we create an AuthorizationPolicy that ensures the issuer was Keycloak. We could leverage this existing policy and add an an additional component to the rule that would result in a policy like this:

apiVersion: security.istio.io/v1
kind: AuthorizationPolicy
metadata:
  labels:
    uds/package: httpbin-other
  name: uds-core-httpbin-jwt-authz
  namespace: authservice-test-app
spec:
  rules:
  - from:
    - source:
        requestPrincipals:
        - https://sso.uds.dev/realms/uds/*
    when:
    - key: request.auth.claims[groups]
      values:
      - /UDS Core/Developer
  selector:
    matchLabels:
      app: httpbin
@rjferguson21 rjferguson21 added the enhancement New feature or request label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant