Skip to content

Commit cc1af16

Browse files
mayurkrclaude
andauthored
fix(zelyo-policies): default all scanning surfaces to opt-in (#78)
* fix(zelyo-policies): default all scanning surfaces to opt-in A fresh `helm install zelyo-policies` previously shipped a catch-all SecurityPolicy (empty namespaces = every pod in every namespace), a MonitoringPolicy with cluster-wide anomaly and log scanning, and two ClusterScans, all reconciling on hardcoded 5-minute intervals. On non-trivial clusters this produced a scan storm on install that could starve the operator and the API server. Flip `securityPolicies.enabled`, `clusterScans.enabled`, and `monitoring.enabled` to `false` by default. Also flip the catch-all `environments.default.enabled` so that even after users opt top-level scanning in, the cluster-wide policy stays off until they explicitly ask for it. Update NOTES.txt with concrete `helm upgrade --set` commands showing how to turn each surface on. No controller logic changes; the `schedule:` field on each CR still gets written through as today. Values comments updated to reflect the opt-in model. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(zelyo-policies): use .Release.Name in NOTES.txt upgrade example Previously the example `helm upgrade` command hardcoded the release name `zelyo-policies`, which misled users who installed the chart under a different name. Switch to `{{ .Release.Name }}` so the printed command always matches the actual release. Addresses review feedback on PR #78. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 51b9a8e commit cc1af16

2 files changed

Lines changed: 49 additions & 8 deletions

File tree

deploy/helm/zelyo-policies/templates/NOTES.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ Remediation: {{ if .Values.remediation.enabled }}enabled (dryRun={{ .Values
5757
Verify:
5858
kubectl get securitypolicies,clusterscans,monitoringpolicies,costpolicies,cloudaccountconfigs,notificationchannels,gitopsrepositories,remediationpolicies -n {{ include "zelyo-policies.namespace" . }}
5959

60+
{{- if and (not .Values.securityPolicies.enabled) (not .Values.clusterScans.enabled) (not .Values.monitoring.enabled) }}
61+
62+
-------------------------------------------------------------
63+
Heads up — scanning is OFF by default
64+
-------------------------------------------------------------
65+
This chart ships opt-in to avoid a scan storm on first install. No
66+
SecurityPolicy, ClusterScan, or MonitoringPolicy CRs were created.
67+
68+
Enable the surfaces you need, for example:
69+
70+
helm upgrade {{ .Release.Name }} ./zelyo-policies -n {{ include "zelyo-policies.namespace" . }} \
71+
--set securityPolicies.enabled=true \
72+
--set clusterScans.enabled=true
73+
74+
The catch-all `default` SecurityPolicy (which targets every namespace)
75+
stays off unless you also pass:
76+
--set securityPolicies.environments.default.enabled=true
77+
{{- end }}
78+
6079
{{- if not .Values.monitoring.notificationChannels }}
6180
{{- if not .Values.notifications.channels }}
6281

deploy/helm/zelyo-policies/values.yaml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44
# This chart deploys production-ready security policies that cover all 56
55
# scanners (8 Kubernetes + 48 cloud) provided by Zelyo Operator.
66
#
7-
# Quick start:
8-
# helm install zelyo-policies ./zelyo-policies -n zelyo-system
7+
# IMPORTANT — OPT-IN BY DEFAULT
8+
# All scanning is disabled out of the box so a fresh `helm install` never
9+
# hammers a cluster. Enable the surfaces you want explicitly:
10+
#
11+
# helm install zelyo-policies ./zelyo-policies -n zelyo-system \
12+
# --set securityPolicies.enabled=true \
13+
# --set clusterScans.enabled=true
14+
#
15+
# Even when `securityPolicies.enabled=true`, the catch-all `default`
16+
# environment (which targets every namespace) stays off unless you also set
17+
# `--set securityPolicies.environments.default.enabled=true`.
918
#
1019
# Override the security profile:
11-
# helm install zelyo-policies ./zelyo-policies -n zelyo-system --set global.profile=strict
20+
# helm install zelyo-policies ./zelyo-policies -n zelyo-system \
21+
# --set securityPolicies.enabled=true --set global.profile=strict
1222
#
1323
# Enable SOC 2 + HIPAA compliance:
1424
# helm install zelyo-policies ./zelyo-policies -n zelyo-system \
25+
# --set clusterScans.enabled=true \
1526
# --set compliance.presets.soc2=true --set compliance.presets.hipaa=true
1627
# ============================================================================
1728

@@ -37,8 +48,10 @@ global:
3748
# ---------------------------------------------------------------------------
3849
# Creates SecurityPolicy CRs targeting namespaces by environment tier.
3950
# Each environment can override the global profile.
51+
#
52+
# Disabled by default. Enable with `--set securityPolicies.enabled=true`.
4053
securityPolicies:
41-
enabled: true
54+
enabled: false
4255

4356
environments:
4457
# -- Production: strictest scanning, frequent schedule
@@ -61,9 +74,13 @@ securityPolicies:
6174
schedule: "0 */2 * * *"
6275
notificationChannels: []
6376

64-
# -- Default: catch-all for remaining namespaces
77+
# -- Default: catch-all for remaining namespaces.
78+
# Disabled by default even when `securityPolicies.enabled=true`: an empty
79+
# namespaces list resolves to *every* pod in the cluster, which can
80+
# overwhelm the operator on first install. Enable deliberately with
81+
# `--set securityPolicies.environments.default.enabled=true`.
6582
default:
66-
enabled: true
83+
enabled: false
6784
profile: "" # Uses global.profile
6885
namespaces: [] # Empty = all namespaces
6986
excludeNamespaces:
@@ -93,8 +110,9 @@ securityPolicies:
93110
# ---------------------------------------------------------------------------
94111
# Cluster Scans — scheduled full-cluster security evaluations
95112
# ---------------------------------------------------------------------------
113+
# Disabled by default. Enable with `--set clusterScans.enabled=true`.
96114
clusterScans:
97-
enabled: true
115+
enabled: false
98116

99117
# Nightly scan — runs all K8s scanners every night at 2 AM.
100118
nightly:
@@ -140,8 +158,12 @@ compliance:
140158
# ---------------------------------------------------------------------------
141159
# Monitoring Policy — real-time event watching and anomaly detection
142160
# ---------------------------------------------------------------------------
161+
# Disabled by default. A single MonitoringPolicy with empty targetNamespaces
162+
# observes every pod in the cluster on a 5-minute cycle and runs regex log
163+
# scanning + anomaly detection, which can be expensive on large clusters.
164+
# Enable with `--set monitoring.enabled=true`.
143165
monitoring:
144-
enabled: true
166+
enabled: false
145167

146168
targetNamespaces: [] # Empty = all namespaces
147169
excludeNamespaces:

0 commit comments

Comments
 (0)