adorable-byte-96872
05/18/2022, 2:02 PMhappy-morning-85531
05/18/2022, 2:13 PMtall-angle-41306
05/18/2022, 5:13 PMtall-angle-41306
05/18/2022, 5:14 PMadorable-byte-96872
05/19/2022, 3:38 AMhappy-morning-85531
05/19/2022, 7:01 AMhappy-morning-85531
05/19/2022, 7:03 AMhappy-morning-85531
05/19/2022, 7:07 AMextensionProviders:
- name: ext-authz
envoyExtAuthzHttp:
service: oathkeeper-api.ory.svc.cluster.local
port: 4456
timeout: 10s
failOpen: false
statusOnError: "500"
pathPrefix: /decisions
includeRequestHeadersInCheck: ["authorization", "cookie"]
headersToUpstreamOnAllow: ["authorization", "path"]
Then i can just create istio AuthorizationPolicy
CRs which reference this.
One example
apiVersion: <http://security.istio.io/v1beta1|security.istio.io/v1beta1>
kind: AuthorizationPolicy
metadata:
name: api-gateway
namespace: istio-system
spec:
action: CUSTOM
provider:
name: ext-authz
rules:
- to:
- operation:
hosts:
- <http://api.dev.example.com|api.dev.example.com>
notPaths:
- /unsecured/*
selector:
matchLabels:
app: istio-ingressgateway
tall-angle-41306
05/19/2022, 7:38 AMhappy-morning-85531
05/19/2022, 7:40 AMadorable-byte-96872
05/19/2022, 12:02 PMhappy-morning-85531
05/19/2022, 12:45 PMadorable-byte-96872
05/30/2022, 9:19 AMerrors:
fallback:
- json
handlers:
redirect:
enabled: true
config:
to: <http://myapp:30462/login>
when:
-
error:
- unauthorized
- forbidden
request:
header:
accept:
- text/html
But nothing happens. I just returns a 401 with content type application/json. Do you have any advice?adorable-byte-96872
06/01/2022, 4:10 AM