KubeZero/charts/kubezero-telemetry/templates/opensearch/istio-authorization-policy.yaml

29 lines
760 B
YAML

{{- if index .Values "opensearch-dashboards" "istio" "enabled" }}
{{- if index .Values "opensearch-dashboards" "istio" "ipBlocks" }}
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: telemetry-dashboard-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 (index .Values "opensearch-dashboards" "istio" "ipBlocks") | nindent 8 }}
to:
- operation:
hosts: [{{ index .Values "opensearch-dashboards" "istio" "url" }}]
when:
- key: connection.sni
values:
- '*'
{{- end }}
{{- end }}