Add kubeflow/v1.10.0
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# Kubernetes M2M Authentication with Istio and RequestAuthentication
|
||||
|
||||
## Overview
|
||||
|
||||
This kustomize component enables M2M (Machine-to-Machine) authentication in Kubernetes, using
|
||||
Istio and the `RequestAuthentication` object. It configures Istio to trust JWTs (JSON Web Tokens)
|
||||
in Authorization Bearer tokens when the JWT issuer matches the one in `RequestAuthentication`. The
|
||||
default setup uses Kubernetes' self-served OIDC issuer with self-signed certificates.
|
||||
|
||||
In Kubernetes clusters managed by platform providers, the OIDC issuer is usually managed by the
|
||||
provider and served behind publicly trusted certificates. In these cases, it's advisable to use
|
||||
the platform-managed Kubernetes OIDC issuer in the `RequestAuthentication` for seamless integration
|
||||
and authentication compliance with the platform's security standards.
|
||||
@@ -0,0 +1,5 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
|
||||
resources:
|
||||
- requestauthentication.yaml
|
||||
@@ -0,0 +1,42 @@
|
||||
apiVersion: security.istio.io/v1beta1
|
||||
kind: RequestAuthentication
|
||||
metadata:
|
||||
name: m2m-token-issuer
|
||||
namespace: istio-system
|
||||
spec:
|
||||
# we only apply to the ingress-gateway because:
|
||||
# - there is no need to verify the same tokens at each sidecar
|
||||
# - having no selector will apply the RequestAuthentication to ALL
|
||||
# Pods in the mesh, even ones which are not part of Kubeflow
|
||||
selector:
|
||||
matchLabels:
|
||||
app: istio-ingressgateway
|
||||
|
||||
jwtRules:
|
||||
- # The `issuer` must be replaced with a Kustomize patch.
|
||||
issuer: PATCH_ME
|
||||
|
||||
# `forwardOriginalToken` is not strictly required to be true.
|
||||
# there are pros and cons to each value:
|
||||
# - true: the original token is forwarded to the destination service
|
||||
# which raises the risk of the token leaking
|
||||
# - false: the original token is stripped from the request
|
||||
# which will prevent the destination service from
|
||||
# verifying the token (possibly with its own RequestAuthentication)
|
||||
forwardOriginalToken: true
|
||||
|
||||
# This will unpack the JWTs issued by Kubernetes into the expected headers.
|
||||
outputClaimToHeaders:
|
||||
- header: kubeflow-userid
|
||||
claim: sub
|
||||
- # NOTE: K8S SA Tokens (e.g. those created with `kubectl create token`) do not contain a `groups` claim,
|
||||
# but we need to ensure that any groups header provided by the request is overwritten to avoid
|
||||
# users passing a valid JWT with `kubeflow-groups` header to impersonate other users.
|
||||
header: kubeflow-groups
|
||||
claim: groups
|
||||
|
||||
# We explicitly set `fromHeaders` to ensure that the JWT is only extracted from the `Authorization` header.
|
||||
# This is because we exclude requests that have an `Authorization` header from oauth2-proxy.
|
||||
fromHeaders:
|
||||
- name: Authorization
|
||||
prefix: "Bearer "
|
||||
Reference in New Issue
Block a user