๐ก๏ธ Security and data
kwatch is source available under ELv2. This page lists what it reads in your cluster, what it keeps, what it hides, and what leaves the cluster, so you can decide what to grant.
In the installer, Edit settings lists the settings of your release by
category (Scope, Security, Operations and more) and has a Secrets access
entry. Settings that are not in the installer's list, and Helm installs, use
the config file keys or Helm values named in each section (Helm sets
config.<key>, for example config.state.maxSizeMiB).
What kwatch readsโ
kwatch needs read access (list and watch) to the Kubernetes kinds it
explains: pods, events, nodes, workloads, Services, ConfigMaps, Secrets and
more. It never needs write access to the workloads it watches.
| Kind | Checks that use it |
|---|---|
| Secrets | TLS certificate expiry, a missing image pull Secret, a workload pointing at a Secret or key that does not exist, a rotated Secret that broke a rollout |
| ConfigMaps | A missing ConfigMap or key a workload references, a configuration change that lines up with a failure, dependency hosts named in configuration |
Secrets: the installer asksโ
The installer asks one question: Let kwatch read Secrets in this cluster?
- Yes installs the standard manifest.
- No installs the manifest without Secrets: the same permissions, minus Secrets. Everything else is watched as usual, and checks that need Secrets say they cannot verify instead of guessing.
Run the installer again and answer differently to change it. To answer without
a prompt, set KWATCH_SECRETS=yes or KWATCH_SECRETS=no. If your cluster
user cannot grant Secret read access, the installer offers to continue without
it.
The matching setting is watch.secrets (default true).
ConfigMapsโ
watch.configmaps (default true) controls the ConfigMap watch. Set it to
false to stop watching ConfigMaps; checks that need them then report that
they cannot verify. With the Helm chart the same value also removes the
ConfigMap permission.
How values are keptโ
kwatch does not keep Secret or ConfigMap values. Before an object is cached,
every value is replaced by a keyed digest (HMAC-SHA256, shortened). kwatch
compares digests to see that something changed, and names the key that
changed, never its content. The digest key is kept in a Kubernetes Secret
called kwatch-digest-key, apart from the volume that holds the state file.
kwatch can only read and update that one Secret by name.
From ConfigMaps, kwatch also keeps host and endpoint values, so it can say which dependency a workload could not reach. Keys that sound like credentials are skipped.
What the state file holdsโ
kwatch keeps its history in one state file on the volume it is given: incidents, change records, log excerpts and termination messages used as evidence, the digests above, the flight recording, and alerts queued for delivery.
| Setting | What it controls | Default | Range |
|---|---|---|---|
state.retention.incidents | Resolved incidents, counted from when they resolved | 168h | 1h to 2160h |
state.retention.changes | Change records | 168h | 24h to 720h |
state.retention.evidence | Log excerpts and termination messages | 720h | 1h to 2160h |
state.retention.recording | Flight recording | 48h | 1h to 336h |
state.maxSizeMiB | Size the file is kept under | 512 | 256 to 16384 |
state.encryption.enabled | Encrypts the file at rest, see below | false | true or false |
Values are Go durations such as 336h. Changes need a restart and cannot be
set from a KwatchConfig. Keep state.maxSizeMiB at or under a quarter of the
volume: the file may grow a quarter past it before it is rewritten, and a
rewrite needs the same space again.
Encrypt the state fileโ
Set state.encryption.enabled: true (default false; with Helm,
config.state.encryption.enabled) to encrypt the state file at rest. Restart
to change it.
- Every stored value is sealed with AES-256-GCM. Timestamps stay readable, so retention and the size limit work without the key.
- kwatch generates the key into the Secret
kwatch-state-keyin its own namespace. The installer's manifests and the chart ship that Secret empty, with access limited togetandupdateon that one name. The key is never on the state volume, so a copy of the volume cannot be read. - Turning encryption on encrypts the existing file during the next compaction pass, with no downtime; new writes are sealed at once. Turning it off writes the values back as plain data the same way, and the key must stay in the Secret until that pass finishes.
- Back up
kwatch-state-key. The chart keeps it when you uninstall, and without it an encrypted file cannot be read. - If the key is missing or wrong, or the Secret cannot be used, kwatch stops
with a clear message and
/healthreports the state store as failed. It never falls back to storing plain data.
Without encryption, rely on an encrypted volume from your storage class, and limit who can mount it.
What kwatch redactsโ
Text kwatch captures from your cluster is redacted before it is stored, shown or sent as an alert: log lines, events, conditions, termination messages and container commands, including init containers.
- Patterns. Private keys, bearer and basic credentials,
key=valuepairs with secret-sounding names, URL credentials, cloud and vendor token formats. - Entropy. Tokens that look random are redacted even when no pattern knows their format. Image digests, UUIDs, container IDs and trace, request and commit IDs are kept, because they are evidence, not secrets. This is on in every edition.
| Setting | What it does |
|---|---|
redact.entropy | true by default. false turns the entropy rule off (KWATCH_REDACT_ENTROPY overrides it) |
redact.allow | Patterns, matched against a whole token, that the entropy rule keeps. They never override a key or format rule |
redact.extraPatterns | Your own patterns as name and pattern pairs, at most 20 and 200 characters each. Every match is redacted and group 1 stays visible. A bad pattern stops startup |
kwatch_redacted_entropy_total counts values redacted only because they
looked random. Redaction is pattern and entropy based, so add an
extraPatterns rule for any format that is specific to your own services.
Networkโ
NetworkPolicyโ
The installer's manifest and the Helm chart include a NetworkPolicy, on by default. It admits the health port to pods in kwatch's own namespace (plus any scrapers you list). Outbound traffic is allowed to:
- pods in any namespace, on any port, so alert receivers and probe targets that run in your cluster work out of the box
- DNS, and the cluster DNS metrics port
- the Kubernetes API server
- kubelets, for node statistics
- HTTPS (443) outside the cluster, for
api.kwatch.dev(license and telemetry),api.github.com(update notices) and HTTPS alert providers
Outside the cluster, a provider on another port (such as SMTP for email), a
probe target or a proxy needs a rule of its own. With Helm, add full rules
under networkPolicy.extraEgress and extra ports under
networkPolicy.extraEgressPorts. For a stricter policy, set
networkPolicy.allowClusterEgress: false and list the in-cluster peers kwatch
should reach in networkPolicy.extraEgress. The in-cluster rule renders only
while networkPolicy.allowDefaults is true. To opt out of the policy, set
networkPolicy.enabled: false.
Where kwatch connectsโ
| Destination | Why |
|---|---|
| Kubernetes API server | Everything kwatch watches |
Kubelets (:10250) | Node and pod statistics |
api.kwatch.dev | Usage stats and the Pro license check, described below |
api.github.com | Update notices |
| The channels you configure | Alerts |
| Probe targets you configure | Active probes |
Port 8060โ
kwatch serves HTTP on port 8060:
| Path | Purpose |
|---|---|
/healthz, /readyz | Liveness and readiness |
/health | Component status, leadership and coverage. A degraded component shows a short reason code, never error text or object names |
/metrics Pro | Prometheus metrics |
/status Pro | Text status page, only when healthCheck.statusEndpoint is on |
/metrics is part of Pro, free during early
access. In Community it answers 404. With Pro, you can require a bearer token
on it: set healthCheck.metricsToken to a ${file:/path} reference (or
KWATCH_METRICS_TOKEN). With Helm, point metrics.tokenSecret.name and
metrics.tokenSecret.key at a Secret you created. Scrapers then send
Authorization: Bearer <token>; /healthz, /readyz, /availabilityz and
/health stay open.
What kwatch sends to kwatch.devโ
Never sent: cluster names, namespaces, pod names, logs or events.
Usage stats, at most once a week, to https://api.kwatch.dev/telemetry/heartbeat:
{
"cluster_uuid": "3f1c9a52-7d0e-5b8a-9c41-2e6f0a1d7b34",
"kwatch_version": "1.2.0"
}
cluster_uuid is a salted one-way hash of your kube-system namespace UID, so the
UID itself never leaves the cluster. It uses a different salt from the license
check's cluster ID, so usage stats can't be matched to a license. To turn usage
stats off, set telemetry.enabled: false (with Helm, config.telemetry.enabled), or set
KWATCH_TELEMETRY=false. They are also off when CI is set.
Pro license check Pro, about once a day and after an upgrade. Pro is free during early access. The request carries the license ID, a hashed cluster ID, the kwatch version, the node count, a signed proof, a timestamp and a one-time nonce (the first activation also sends your license key and a public key):
{
"lid": "lic_example",
"cluster_uuid": "8d47e0b6-21c3-4f9a-b5d8-6a0e93c2f171",
"cluster_proof": "9b2fโฆ",
"lease_iat": 1767139200,
"ts": 1767225600,
"kwatch_version": "1.2.0",
"node_count": 3,
"nonce": "Zk3qโฆ"
}
Community sends no license check. See License for the grace period and the installer's License / Pro menu.
Update noticesโ
kwatch checks for a newer release at start and every 24 hours by asking
api.github.com, and posts one message when a new version is out. By default
the notice goes to every alert provider you configured. Set
upgrader.notifyProviders to a list of provider names, for example [email],
to choose who gets it. To turn the check off, set upgrader.disableUpdateCheck: true
or SKIP_UPGRADE_CHECK=true.
KwatchConfig and ${file:...}โ
Sensitive settings, such as provider credentials, take a reference to a mounted
file in the exact form ${file:/absolute/path}. The installer stores those
files in a Kubernetes Secret and mounts them for you.
${file:...}is read from kwatch's mounted configuration file only. In aKwatchConfig, the text stays literal and no file is read.- A
KwatchConfigchanges only the settings kwatch allows it to. Alert channels, license settings, file paths, the health server,watch.secretsand thestatesettings are not among them. - Only people who can create
KwatchConfigobjects in kwatch's namespace can apply one. kwatch watches its own namespace for them.