Merge 36070faff9
into 8218421812
This commit is contained in:
commit
0dfa188c09
3 changed files with 17 additions and 18 deletions
|
@ -663,12 +663,13 @@ stream {
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if not (empty $location.ExternalAuth.Method) }}
|
{{ if not (empty $location.ExternalAuth.Method) }}
|
||||||
proxy_method {{ $location.ExternalAuth.Method }};
|
proxy_method {{ $location.ExternalAuth.Method }};
|
||||||
proxy_set_header X-Original-URI $request_uri;
|
proxy_set_header X-Original-URI $request_uri;
|
||||||
proxy_set_header X-Scheme $pass_access_scheme;
|
proxy_set_header X-Scheme $pass_access_scheme;
|
||||||
{{ end }}
|
{{ end }}
|
||||||
proxy_pass_request_headers on;
|
proxy_pass_request_headers on;
|
||||||
proxy_set_header Host {{ $location.ExternalAuth.Host }};
|
proxy_set_header Host {{ $location.ExternalAuth.Host }};
|
||||||
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
|
proxy_set_header X-Original-URL $scheme://$http_host$request_uri;
|
||||||
|
proxy_set_header X-Auth-Request-Redirect $request_uri;
|
||||||
proxy_ssl_server_name on;
|
proxy_ssl_server_name on;
|
||||||
|
|
||||||
client_max_body_size "{{ $location.Proxy.BodySize }}";
|
client_max_body_size "{{ $location.Proxy.BodySize }}";
|
||||||
|
@ -712,9 +713,9 @@ stream {
|
||||||
|
|
||||||
{{ if not (empty $authPath) }}
|
{{ if not (empty $authPath) }}
|
||||||
# this location requires authentication
|
# this location requires authentication
|
||||||
auth_request {{ $authPath }};
|
auth_request {{ $authPath }};
|
||||||
auth_request_set $auth_cookie $upstream_http_set_cookie;
|
auth_request_set $auth_cookie $upstream_http_set_cookie;
|
||||||
add_header Set-Cookie $auth_cookie;
|
add_header Set-Cookie $auth_cookie;
|
||||||
{{- range $idx, $line := buildAuthResponseHeaders $location }}
|
{{- range $idx, $line := buildAuthResponseHeaders $location }}
|
||||||
{{ $line }}
|
{{ $line }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -780,9 +781,6 @@ stream {
|
||||||
proxy_set_header X-Original-URI $request_uri;
|
proxy_set_header X-Original-URI $request_uri;
|
||||||
proxy_set_header X-Scheme $pass_access_scheme;
|
proxy_set_header X-Scheme $pass_access_scheme;
|
||||||
|
|
||||||
{{/* This header is used for external authentication */}}
|
|
||||||
proxy_set_header X-Auth-Request-Redirect $request_uri;
|
|
||||||
|
|
||||||
# mitigate HTTPoxy Vulnerability
|
# mitigate HTTPoxy Vulnerability
|
||||||
# https://www.nginx.com/blog/mitigating-the-httpoxy-vulnerability-with-nginx/
|
# https://www.nginx.com/blog/mitigating-the-httpoxy-vulnerability-with-nginx/
|
||||||
proxy_set_header Proxy "";
|
proxy_set_header Proxy "";
|
||||||
|
|
|
@ -8,7 +8,7 @@ metadata:
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
- host: __INGRESS_HOST__
|
- host: dashboard.uswest2-01.rocket-science.io
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- backend:
|
- backend:
|
||||||
|
@ -25,7 +25,7 @@ metadata:
|
||||||
namespace: kube-system
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
- host: __INGRESS_HOST__
|
- host: dashboard.uswest2-01.rocket-science.io
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- backend:
|
- backend:
|
||||||
|
@ -34,5 +34,5 @@ spec:
|
||||||
path: /oauth2
|
path: /oauth2
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- __INGRESS_HOST__
|
- dashboard.uswest2-01.rocket-science.io
|
||||||
secretName: __INGRESS_SECRET__
|
secretName: dashboard-rocket-science.io
|
||||||
|
|
|
@ -25,13 +25,13 @@ spec:
|
||||||
# https://github.com/settings/applications/new
|
# https://github.com/settings/applications/new
|
||||||
env:
|
env:
|
||||||
- name: OAUTH2_PROXY_CLIENT_ID
|
- name: OAUTH2_PROXY_CLIENT_ID
|
||||||
value: <Client ID>
|
value: b609d40bdedf145d832e
|
||||||
- name: OAUTH2_PROXY_CLIENT_SECRET
|
- name: OAUTH2_PROXY_CLIENT_SECRET
|
||||||
value: <Client Secret>
|
value: cc2a10e004624aae225b4d5edd5574dea7944395
|
||||||
# python -c 'import os,base64; print base64.b64encode(os.urandom(16))'
|
# python -c 'import os,base64; print base64.b64encode(os.urandom(16))'
|
||||||
- name: OAUTH2_PROXY_COOKIE_SECRET
|
- name: OAUTH2_PROXY_COOKIE_SECRET
|
||||||
value: SECRET
|
value: F6HNMR7IiGzwAYSAHV+9OQ==
|
||||||
image: docker.io/colemickens/oauth2_proxy:latest
|
image: skippy/docker-oauth2_proxy:2.0.1
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
name: oauth2-proxy
|
name: oauth2-proxy
|
||||||
ports:
|
ports:
|
||||||
|
@ -46,6 +46,7 @@ metadata:
|
||||||
labels:
|
labels:
|
||||||
k8s-app: oauth2-proxy
|
k8s-app: oauth2-proxy
|
||||||
name: oauth2-proxy
|
name: oauth2-proxy
|
||||||
|
namespace: kube-system
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|
Loading…
Reference in a new issue