@@ -31,6 +31,62 @@ static_resources:
3131 prefix : " /.well-known/nemo-platform/"
3232 route :
3333 cluster : nemo
34+ typed_per_filter_config :
35+ envoy.filters.http.ext_authz :
36+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
37+ disabled : true
38+ request_headers_to_add :
39+ - header :
40+ key : x-forwarded-proto
41+ value : https
42+ append_action : OVERWRITE_IF_EXISTS_OR_ADD
43+ - match :
44+ path : " /apis/auth/discovery"
45+ route :
46+ cluster : nemo
47+ typed_per_filter_config :
48+ envoy.filters.http.ext_authz :
49+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
50+ disabled : true
51+ request_headers_to_add :
52+ - header :
53+ key : x-forwarded-proto
54+ value : https
55+ append_action : OVERWRITE_IF_EXISTS_OR_ADD
56+ - match :
57+ path : " /apis/auth/authenticate"
58+ route :
59+ cluster : nemo
60+ typed_per_filter_config :
61+ envoy.filters.http.ext_authz :
62+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
63+ disabled : true
64+ request_headers_to_add :
65+ - header :
66+ key : x-forwarded-proto
67+ value : https
68+ append_action : OVERWRITE_IF_EXISTS_OR_ADD
69+ - match :
70+ path : " /apis/auth/jwks"
71+ route :
72+ cluster : nemo
73+ typed_per_filter_config :
74+ envoy.filters.http.ext_authz :
75+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
76+ disabled : true
77+ request_headers_to_add :
78+ - header :
79+ key : x-forwarded-proto
80+ value : https
81+ append_action : OVERWRITE_IF_EXISTS_OR_ADD
82+ - match :
83+ path : " /apis/auth/token"
84+ route :
85+ cluster : nemo
86+ typed_per_filter_config :
87+ envoy.filters.http.ext_authz :
88+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
89+ disabled : true
3490 request_headers_to_add :
3591 - header :
3692 key : x-forwarded-proto
@@ -51,10 +107,18 @@ static_resources:
51107 status : 503
52108 body :
53109 inline_string : ' {"status":"not_ready"}'
110+ typed_per_filter_config :
111+ envoy.filters.http.ext_authz :
112+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
113+ disabled : true
54114 - match :
55115 prefix : " /health/"
56116 route :
57117 cluster : nemo
118+ typed_per_filter_config :
119+ envoy.filters.http.ext_authz :
120+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
121+ disabled : true
58122 request_headers_to_add :
59123 - header :
60124 key : x-forwarded-proto
@@ -64,6 +128,10 @@ static_resources:
64128 path : " /status"
65129 route :
66130 cluster : nemo
131+ typed_per_filter_config :
132+ envoy.filters.http.ext_authz :
133+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
134+ disabled : true
67135 request_headers_to_add :
68136 - header :
69137 key : x-forwarded-proto
@@ -73,6 +141,10 @@ static_resources:
73141 prefix : " /studio/"
74142 route :
75143 cluster : nemo
144+ typed_per_filter_config :
145+ envoy.filters.http.ext_authz :
146+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
147+ disabled : true
76148 request_headers_to_add :
77149 - header :
78150 key : x-forwarded-proto
@@ -82,6 +154,10 @@ static_resources:
82154 prefix : " /"
83155 route :
84156 cluster : authentik
157+ typed_per_filter_config :
158+ envoy.filters.http.ext_authz :
159+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute
160+ disabled : true
85161 request_headers_to_add :
86162 - header :
87163 key : x-forwarded-proto
@@ -125,6 +201,8 @@ static_resources:
125201 headers:remove("x-nmp-principal-on-behalf-of")
126202 headers:remove("x-nmp-principal-on-behalf-of-email")
127203 headers:remove("x-nmp-principal-on-behalf-of-groups")
204+ headers:remove("x-nmp-authorized")
205+ headers:remove("x-nmp-scopes")
128206
129207 if headers:get(":path") ~= "/health/gateway/ready" then
130208 return
@@ -142,58 +220,30 @@ static_resources:
142220 string.format('{"status":"not_ready","nemo":"%s","authentik":"%s"}', nemo_status, authentik_status)
143221 )
144222 end
145- - name : envoy.filters.http.jwt_authn
223+ - name : envoy.filters.http.ext_authz
146224 typed_config :
147- " @type " : type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication
148- providers :
149- authentik_workload :
150- audiences :
151- - " nemo-platform"
152- - " nemo-platform-cli"
153- - " nemo-platform-workload"
154- remote_jwks :
155- http_uri :
156- uri : " http://authentik-server:9000/application/o/nemo/jwks/"
157- cluster : authentik
158- timeout : 5s
159- cache_duration : 600s
160- claim_to_headers :
161- - header_name : " X-NMP-Principal-Id"
162- claim_name : " sub"
163- - header_name : " X-NMP-Principal-Groups"
164- claim_name : " groups"
165- workload_exchange :
166- audiences :
167- - " nemo-platform"
168- remote_jwks :
169- http_uri :
170- uri : " http://nemo:8080/apis/auth/jwks"
171- cluster : nemo
172- timeout : 5s
173- cache_duration : 600s
174- claim_to_headers :
175- - header_name : " X-NMP-Principal-Id"
176- claim_name : " sub"
177- - header_name : " X-NMP-Principal-Groups"
178- claim_name : " groups"
179- rules :
180- - match :
181- path : " /apis/auth/discovery"
182- - match :
183- path : " /apis/auth/jwks"
184- - match :
185- path : " /apis/auth/token"
186- - match :
187- prefix : " /health/"
188- - match :
189- path : " /status"
190- - match :
191- prefix : " /apis/"
192- requires :
193- requires_any :
194- requirements :
195- - provider_name : " authentik_workload"
196- - provider_name : " workload_exchange"
225+ " @type " : type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz
226+ transport_api_version : V3
227+ failure_mode_allow : false
228+ status_on_error :
229+ code : ServiceUnavailable
230+ http_service :
231+ server_uri :
232+ uri : " http://nemo:8080"
233+ cluster : nemo
234+ timeout : 5s
235+ path_prefix : " /apis/auth/authenticate"
236+ authorization_response :
237+ allowed_upstream_headers :
238+ patterns :
239+ - exact : x-nmp-principal-id
240+ - exact : x-nmp-principal-email
241+ - exact : x-nmp-principal-groups
242+ - exact : x-nmp-scopes
243+ allowed_client_headers :
244+ patterns :
245+ - exact : content-type
246+ - exact : www-authenticate
197247 - name : envoy.filters.http.router
198248 typed_config :
199249 " @type " : type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
0 commit comments