Skip to content

Commit

Permalink
add missing egress rules
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <[email protected]>
  • Loading branch information
matthyx committed Oct 4, 2024
1 parent c254f60 commit 6e83470
Show file tree
Hide file tree
Showing 7 changed files with 958 additions and 856 deletions.
4 changes: 2 additions & 2 deletions charts/kubescape-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ type: application
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)

version: 1.22.3
version: 1.22.4

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.

appVersion: 1.22.3
appVersion: 1.22.4

maintainers:
- name: Ben Hirschberg
Expand Down
2 changes: 2 additions & 0 deletions charts/kubescape-operator/assets/common-egress-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- ports:
- port: 4317
protocol: TCP
- port: 4318
protocol: TCP
to:
- podSelector:
matchLabels:
Expand Down
20 changes: 10 additions & 10 deletions charts/kubescape-operator/templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
{{- end }}

{{- define "checksums" -}}
capabilitiesConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "components-configmap.yaml") . | sha256sum }}
cloudConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "cloudapi-configmap.yaml") . | sha256sum }}
cloudSecret: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "cloud-secret.yaml" ) . | sha256sum }}
hostScannerConfig: {{ include (printf "%s/kubescape/host-scanner-definition-configmap.yaml" $.Template.BasePath ) . | sha256sum }}
matchingRulesConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "matchingRules-configmap.yaml") . | sha256sum }}
nodeAgentConfig: {{ include (printf "%s/node-agent/configmap.yaml" $.Template.BasePath) . | sha256sum }}
operatorConfig: {{ include (printf "%s/operator/configmap.yaml" $.Template.BasePath) . | sha256sum }}
otelConfig: {{ include (printf "%s/otel-collector/configmap.yaml" $.Template.BasePath) . | sha256sum }}
proxySecret: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.proxySecretDirectory "proxy-secret.yaml") . | sha256sum }}
synchronizerConfig: {{ include (printf "%s/synchronizer/configmap.yaml" $.Template.BasePath) . | sha256sum }}
capabilitiesConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "components-configmap.yaml") . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
cloudConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "cloudapi-configmap.yaml") . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
cloudSecret: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "cloud-secret.yaml" ) . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
hostScannerConfig: {{ include (printf "%s/kubescape/host-scanner-definition-configmap.yaml" $.Template.BasePath ) . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
matchingRulesConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "matchingRules-configmap.yaml") . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
nodeAgentConfig: {{ include (printf "%s/node-agent/configmap.yaml" $.Template.BasePath) . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
operatorConfig: {{ include (printf "%s/operator/configmap.yaml" $.Template.BasePath) . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
otelConfig: {{ include (printf "%s/otel-collector/configmap.yaml" $.Template.BasePath) . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
proxySecret: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.proxySecretDirectory "proxy-secret.yaml") . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
synchronizerConfig: {{ include (printf "%s/synchronizer/configmap.yaml" $.Template.BasePath) . | regexReplaceAll .Chart.AppVersion "" | sha256sum }}
{{- end -}}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ spec:
policyTypes:
- Egress
egress:
{{ tpl (.Files.Get "assets/api-server-egress-rules.yaml") . | indent 4 }}
{{ tpl (.Files.Get "assets/common-egress-rules.yaml") . | indent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
- podSelector:
matchLabels:
{{- include "kubescape-operator.selectorLabels" (dict "Chart" .Chart "Release" .Release "Values" .Values "app" .Values.kubevuln.name) | nindent 14 }}
{{ tpl (.Files.Get "assets/api-server-egress-rules.yaml") . | indent 4 }}
{{ tpl (.Files.Get "assets/common-egress-rules.yaml") . | indent 4 }}
{{- end }}
ingress:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
- ports:
- port: 443
protocol: TCP
{{ tpl (.Files.Get "assets/api-server-egress-rules.yaml") . | indent 4 }}
{{ tpl (.Files.Get "assets/common-egress-rules.yaml") . | indent 4 }}
{{- end }}
ingress:
Expand Down
Loading

0 comments on commit 6e83470

Please sign in to comment.