KubeZero/charts/kubezero-argocd/templates/istio-authorization-policy.yaml

25 lines
589 B
YAML

{{- if .Values.istio.enabled }}
{{- if .Values.istio.ipBlocks }}
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: argocd-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.istio.ipBlocks | nindent 8 }}
when:
- key: connection.sni
values: ["{{ index .Values "argo-cd" "server" "config" "url" }}"]
{{- end }}
{{- end }}