KubeZero/charts/kubezero-auth/templates/keycloak/istio-authorization-policy.yaml

37 lines
862 B
YAML
Raw Normal View History

{{- if and .Values.keycloak.enabled .Values.keycloak.istio.enabled }}
2022-05-11 14:31:37 +00:00
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: {{ .Release.Name }}-deny-metrics-ipblocks
2022-05-11 14:31:37 +00:00
namespace: istio-system
labels:
{{- include "kubezero-lib.labels" $ | nindent 4 }}
spec:
selector:
matchLabels:
app: istio-ingressgateway
action: DENY
rules:
- to:
- operation:
hosts: ["{{ .Values.keycloak.istio.url }}"]
paths: ["/metrics*"]
when:
- key: connection.sni
values:
- '*'
{{- if .Values.keycloak.istio.ipBlocks }}
2022-05-11 14:31:37 +00:00
- from:
- source:
notIpBlocks:
{{- toYaml .Values.keycloak.istio.ipBlocks | nindent 8 }}
to:
- operation:
hosts: ["{{ .Values.keycloak.istio.url }}"]
when:
- key: connection.sni
values:
- '*'
{{- end }}
2022-05-11 14:31:37 +00:00
{{- end }}