-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
authN-authZ: add documentation and configs for oauth2
* add the yamls for configurations of oauth2 * add oauth2-proxy installation guide * update documentations Signed-off-by: Ruoyu Ying <[email protected]>
- Loading branch information
Showing
19 changed files
with
390 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
microservices-connector/config/authN-authZ/chatQnA_authN_oauth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: security.istio.io/v1 | ||
kind: RequestAuthentication | ||
metadata: | ||
name: oauth2-keycloak-auth | ||
namespace: istio-system | ||
spec: | ||
jwtRules: | ||
- issuer: http://${KEYCLOAK_ADDR}/realms/${REALM} | ||
jwksUri: http://${KEYCLOAK_ADDR}/realms/${REALM}/protocol/openid-connect/certs | ||
selector: | ||
matchLabels: | ||
istio: ingressgateway |
17 changes: 17 additions & 0 deletions
17
microservices-connector/config/authN-authZ/chatQnA_authZ_oauth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: security.istio.io/v1 | ||
kind: AuthorizationPolicy | ||
metadata: | ||
name: chatqna-ext-authz | ||
namespace: istio-system | ||
spec: | ||
action: CUSTOM | ||
provider: | ||
name: oauth2-proxy | ||
rules: | ||
- to: | ||
- operation: | ||
notPaths: | ||
- /realms/* | ||
selector: | ||
matchLabels: | ||
istio: ingressgateway |
37 changes: 37 additions & 0 deletions
37
microservices-connector/config/authN-authZ/chatQnA_istio_external_auth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: v1 | ||
data: | ||
mesh: |- | ||
accessLogFile: /dev/stdout | ||
defaultConfig: | ||
discoveryAddress: istiod.istio-system.svc:15012 | ||
proxyMetadata: {} | ||
tracing: | ||
zipkin: | ||
address: localhost:9411 | ||
enablePrometheusMerge: true | ||
enableTracing: false | ||
outboundTrafficPolicy: | ||
mode: ALLOW_ANY | ||
trustDomain: cluster.local | ||
extensionProviders: | ||
- name: oauth2-proxy | ||
envoyExtAuthzHttp: | ||
service: oauth-proxy.oauth2-proxy.svc.cluster.local | ||
port: 4180 | ||
timeout: 1.5s | ||
includeRequestHeadersInCheck: ["authorization", "cookie"] | ||
headersToUpstreamOnAllow: ["x-forwarded-access-token", "authorization", "path", "x-auth-request-user", "x-auth-request-email", "x-auth-request-access-token", "x-auth-request-groups"] | ||
headersToDownstreamOnDeny: ["content-type", "set-cookie"] | ||
meshNetworks: 'networks: {}' | ||
kind: ConfigMap | ||
metadata: | ||
labels: | ||
install.operator.istio.io/owning-resource: installed-state | ||
install.operator.istio.io/owning-resource-namespace: istio-system | ||
istio.io/rev: default | ||
operator.istio.io/component: Pilot | ||
operator.istio.io/managed: Reconcile | ||
operator.istio.io/version: 1.22.2 | ||
release: istio | ||
name: istio | ||
namespace: istio-system |
39 changes: 39 additions & 0 deletions
39
microservices-connector/config/authN-authZ/chatQnA_router_gateway_oauth.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: networking.istio.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: chatqna-gateway | ||
namespace: istio-system | ||
spec: | ||
selector: | ||
istio: ingressgateway | ||
servers: | ||
- hosts: | ||
- chatqna-service.com | ||
port: | ||
name: http | ||
number: 80 | ||
protocol: HTTP | ||
--- | ||
apiVersion: networking.istio.io/v1 | ||
kind: VirtualService | ||
metadata: | ||
name: chatqna-virtual-service | ||
namespace: istio-system | ||
spec: | ||
gateways: | ||
- istio-system/chatqna-gateway | ||
hosts: | ||
- chatqna-service.com | ||
http: | ||
- match: | ||
- uri: | ||
prefix: / | ||
route: | ||
- destination: | ||
host: router-service.chatqa.svc.cluster.local | ||
port: | ||
number: 8080 |
47 changes: 47 additions & 0 deletions
47
microservices-connector/config/authN-authZ/chatQnA_ui_gateway.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
apiVersion: networking.istio.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: chatqna-ui-gateway | ||
namespace: istio-system | ||
spec: | ||
selector: | ||
istio: ingressgateway | ||
servers: | ||
- hosts: | ||
- chatqna-ui.com | ||
port: | ||
name: http | ||
number: 80 | ||
protocol: HTTP | ||
--- | ||
apiVersion: networking.istio.io/v1 | ||
kind: VirtualService | ||
metadata: | ||
name: chatqna-ui-virtual-service | ||
namespace: istio-system | ||
spec: | ||
gateways: | ||
- istio-system/chatqna-ui-gateway | ||
hosts: | ||
- chatqna-ui.com | ||
http: | ||
- match: | ||
- uri: | ||
prefix: /oauth2 | ||
route: | ||
- destination: | ||
host: oauth-proxy.oauth2-proxy.svc.cluster.local | ||
port: | ||
number: 4180 | ||
- match: | ||
- uri: | ||
prefix: / | ||
route: | ||
- destination: | ||
host: ui.default.svc.cluster.local | ||
port: | ||
number: 5174 |
Binary file added
BIN
+28.2 KB
...ervices-connector/config/authN-authZ/docs/OPEA auth flow with OIDC provider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37 KB
...services-connector/config/authN-authZ/docs/OPEA auth flow with oauth2-proxy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+166 KB
microservices-connector/config/authN-authZ/docs/attach_group_scope.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.