2022-01-19 23:04:35 +00:00
|
|
|
{{- if and .Values.jenkins.enabled .Values.jenkins.istio.enabled .Values.jenkins.istio.ipBlocks }}
|
2021-12-19 22:18:01 +00:00
|
|
|
apiVersion: security.istio.io/v1beta1
|
|
|
|
kind: AuthorizationPolicy
|
|
|
|
metadata:
|
2022-01-19 23:04:35 +00:00
|
|
|
name: {{ .Release.Name }}-deny-not-in-ipblocks
|
|
|
|
namespace: istio-system
|
|
|
|
labels:
|
|
|
|
{{- include "kubezero-lib.labels" $ | nindent 4 }}
|
2021-12-19 22:18:01 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: istio-ingressgateway
|
2022-01-19 23:04:35 +00:00
|
|
|
action: DENY
|
2021-12-19 22:18:01 +00:00
|
|
|
rules:
|
|
|
|
- from:
|
|
|
|
- source:
|
2022-01-19 23:04:35 +00:00
|
|
|
notIpBlocks:
|
|
|
|
{{- toYaml .Values.jenkins.istio.ipBlocks | nindent 8 }}
|
|
|
|
when:
|
|
|
|
- key: connection.sni
|
|
|
|
values: ["{{ .Values.jenkins.istio.url }}"]
|
2021-12-19 22:18:01 +00:00
|
|
|
{{- end }}
|