2020-12-02 11:53:19 +00:00
|
|
|
{{- range $name, $service := .Values.istio }}
|
|
|
|
|
|
|
|
{{- if and $service.enabled $service.ipBlocks }}
|
2020-08-06 11:34:32 +00:00
|
|
|
apiVersion: security.istio.io/v1beta1
|
|
|
|
kind: AuthorizationPolicy
|
|
|
|
metadata:
|
2020-12-02 11:53:19 +00:00
|
|
|
name: {{ $name }}-deny-not-in-ipblocks
|
2020-08-06 11:34:32 +00:00
|
|
|
namespace: istio-system
|
2020-08-06 17:15:20 +00:00
|
|
|
labels:
|
2021-12-03 21:16:22 +00:00
|
|
|
{{- include "kubezero-lib.labels" $ | nindent 4 }}
|
2020-08-06 11:34:32 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: istio-ingressgateway
|
|
|
|
action: DENY
|
|
|
|
rules:
|
|
|
|
- from:
|
|
|
|
- source:
|
|
|
|
notIpBlocks:
|
2020-12-02 11:53:19 +00:00
|
|
|
{{- toYaml $service.ipBlocks | nindent 8 }}
|
2022-01-28 16:19:41 +00:00
|
|
|
to:
|
|
|
|
- operation:
|
|
|
|
hosts: ["{{ $service.url }}"]
|
2022-01-07 14:19:50 +00:00
|
|
|
when:
|
|
|
|
- key: connection.sni
|
2022-01-28 16:19:41 +00:00
|
|
|
values:
|
|
|
|
- '*'
|
2020-10-05 11:31:00 +00:00
|
|
|
---
|
2020-08-06 11:34:32 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|