27 lines
668 B
YAML
27 lines
668 B
YAML
|
{{- if and .Values.keycloak.enabled .Values.keycloak.istio.enabled .Values.keycloak.istio.ipBlocks }}
|
||
|
apiVersion: security.istio.io/v1beta1
|
||
|
kind: AuthorizationPolicy
|
||
|
metadata:
|
||
|
name: {{ .Release.Name }}-deny-not-in-ipblocks
|
||
|
namespace: istio-system
|
||
|
labels:
|
||
|
{{- include "kubezero-lib.labels" $ | nindent 4 }}
|
||
|
spec:
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: istio-ingressgateway
|
||
|
action: DENY
|
||
|
rules:
|
||
|
- from:
|
||
|
- source:
|
||
|
notIpBlocks:
|
||
|
{{- toYaml .Values.keycloak.istio.ipBlocks | nindent 8 }}
|
||
|
to:
|
||
|
- operation:
|
||
|
hosts: ["{{ .Values.keycloak.istio.url }}"]
|
||
|
when:
|
||
|
- key: connection.sni
|
||
|
values:
|
||
|
- '*'
|
||
|
{{- end }}
|