Skip to content

WatchLog v0.7.0

Choose a tag to compare

@github-actions github-actions released this 15 Nov 19:22
· 893 commits to main since this release

WatchLog 0.7.0

Egress watch: what is my cluster talking to on the internet, and since when? WatchLog now keeps a record of every external destination each Kubernetes workload and Docker container has used, with its first and last connection, and tells you when something starts talking somewhere new (Egress watch).

It is built from what the agent already sends for the service map: connections, bytes and failures per edge, with external destinations named by the DNS answers the container received. Nothing new is read from traffic: no payload, no TLS SNI, no HTTP host. There is nothing to install or turn on, and it is in every edition, Community included, and every Cloud plan.

What's new

  • The Egress page (ADR-188), in the navigation of every cluster and fleet with "N new" beside it: each destination and port with the sources that use it, first and last seen, bytes sent and received, connections and the failed share. Badges New, Raw IP, Failing and Expected; filters by namespace and workload on Kubernetes, by host, Compose project and container on Docker, by badge, and a search, all kept in the URL. Cards on phones.

    • Kubernetes: a source is a workload (shop/Deployment/orders); a CronJob is one source across its runs.
    • Docker: a source is a Compose service (storefront/api), so a re-created container keeps its history; any other container is its name on its host.
  • "Talks to the internet" on the workload, pod, Docker container and Compose service pages: the same rows for one source over 30 days.

  • Expected destinations (ADR-186): mark a destination, or a pattern (*.amazonaws.com, a CIDR for raw networks), expected for one source or for every one, on one port or any. Owners and Admins mark them, Viewers see them, and each change is audited.

  • Three new default alert rules (ADR-187), warning, for Kubernetes clusters and Docker fleets alike:

    • New external destination: a source starts talking to a name or public network it never used and no expectation covers. Quiet during a learning period of 7 days per cluster and per new source.
    • Raw IP egress: at least 5 connections in 10 minutes to the same public network and port, with no DNS name behind it.
    • Large upload to a new destination: more than 100 MiB in an hour to a destination first used in the last 24 hours.

    Messages name the source in its platform's words (a workload, or a Compose service or container and its host) and show destinations as code, never as links. Probable cause gains change_before_egress: a rollout or image change (Kubernetes), or a re-created container, image or Compose change (Docker), just before the first connection.

  • A suggested egress NetworkPolicy, Kubernetes only (ADR-190, ADR-191): from what a workload reached in the last 30 days, a CiliumNetworkPolicy with toFQDNs when the cluster runs Cilium, or a standard NetworkPolicy. Copy-only: WatchLog never applies it. Docker has no standard egress policy object, so the Docker pages say why there is none.

  • API and MCP (ADR-189): GET /api/v1/egress, GET /api/v1/egress/expected and GET /api/v1/egress/policy, readable with an API token; marking expected needs an Owner's or Admin's session. MCP tools get_egress, get_new_destinations and get_expected_destinations, read-only; destination names come back as data only.

  • The cluster agent detects Cilium from API discovery (no new permission) and reports it in its heartbeat, so the policy suggestion puts the right flavour first.

  • Cloud: the three new tables are under Row-Level Security, and every new route and MCP tool is in the cross-organization isolation suite (ADR-192).

Upgrading

No manual steps (ADR-107). Kubernetes: helm upgrade … --version 0.7.0 --reuse-values. Docker: set WATCHLOG_VERSION=0.7.0 and docker compose pull && docker compose up -d for the server.

The new rules start quiet. For every cluster and fleet that exists at the upgrade, the learning period of "New external destination" starts at the upgrade and lasts 7 days; destinations already in use get their first seen from the flow series still retained. So an upgrade doesn't raise an alert per destination: during those days destinations are recorded, nothing first used then is ever new, and the Egress page says "Learning until …". A cluster added later learns from its first report. "Raw IP egress" and "Large upload to a new destination" don't wait.

Nothing is New for the first few minutes. Until the alert worker has looked back through the retained flow series for a cluster (up to 5 minutes after the upgrade, or after a new cluster's first report), no destination or source is marked New: the page's "new in 24 hours", the "N new" beside Egress in the navigation and the New filter say 0, and the page says "Learning first-seen times from the traffic history… Nothing is marked New until that is done, in a few minutes." "Large upload to a new destination" waits for that look-back too. GET /api/v1/egress says so in learning.firstSeenPending.

One new setting, optional, for the length of the learning period (0 to 90 days, fractions allowed; empty or unset is 7):

  • Kubernetes: the Helm value alerting.egressLearningDays of the watchlog chart. It is read nil-safe: --reuse-values from 0.6.x leaves it unset and renders the same backend and worker as before.
  • Docker: WATCHLOG_EGRESS_LEARNING_DAYS in the server's .env; the 0.7.0 compose.yaml passes it with a default of 7. With a 0.6.x compose.yaml it isn't passed, and the backend uses 7.

Agents: 0.6.x agents and integrations collectors keep working, and their flow series fill the Egress page as they are. On Kubernetes, the 0.7.0 cluster agent adds the Cilium detection; with an older one, the policy suggestion offers both flavours with the standard NetworkPolicy first. Network flows must be on (the default) for the Egress page to have anything to show.

Migrations run by themselves. There are two, both forward-only; what each does to a self-hosted database:

  • The egress inventory (1795500000000_egress-inventory): three new, empty tables, egress_destinations (one row per source, destination and port, with first and last seen), egress_sources (when each source was first seen, which starts its learning period) and egress_expected (expected destinations and patterns); each with its organization, a foreign key to its cluster (deleting a cluster deletes its rows) and Row-Level Security, as every tenant table (self-hosted servers connect as the tables' owner, so it changes nothing there). Two nullable columns on clusters: egress_learning_since, set to the upgrade's time for every existing cluster, and egress_backfilled_at, set once the alert worker has looked back through the retained flow series for first-seen times (one day per query, once per cluster, in the background). No existing row is rewritten except that one column of each cluster.
  • Egress audit kinds (1795600000000_egress-expected-audit): the audit events gain two kinds, an expectation added and removed; existing rows keep theirs.

The three default rules are added by the alert worker on its first cycle, as earlier default rules were, enabled with their default thresholds; rules you edited keep your edits. A server you upgrade keeps everything it had.

Known limits

  • The agent keeps at most 50 destinations per source, per node, per hour; beyond that they are listed together as "Other destinations · Names not kept" and are never new. In our measurements no source came near it.
  • A pod or container that connects and exits within about 15 seconds isn't attributed to any source.
  • Destinations last seen more than 90 days ago are forgotten; expectations are kept. Traffic numbers follow the metrics retention (15 days by default).
  • A process that resolves names over DNS-over-HTTPS, DNS-over-TLS or DNS over TCP shows its destinations as networks.
  • No country, owner or reputation of destinations, and nothing is ever blocked.
  • English only.

Questions and problems: GitHub Discussions or an issue.

Changes since v0.6.2

Features

  • alerting.egressLearningDays in the chart and WATCHLOG_EGRESS_LEARNING_DAYS in the Compose server (deploy)
  • the suggested egress policy on a Kubernetes workload, and why Docker has none (web)
  • the egress policy suggestion for a Kubernetes workload, GET /egress/policy (backend)
  • the cluster-agent detects Cilium from API discovery and reports it in its heartbeat (agent)
  • egress reads public for API tokens, and the MCP tools get_egress, get_new_destinations, get_expected_destinations (backend)
  • the egress alert's Where it talks card, View alert on the Egress page, the rules' sentences and cause words (ADR-187) (web)
  • an Egress row names its firing egress alert (alertId) for View alert (backend)
  • the three default egress rules, their messages and change_before_egress (ADR-187) (backend)
  • Mark expected and Undo on the Egress page and Talks to the internet, and the expectations list (ADR-186) (web)
  • expected destinations and patterns, their routes and the inventory's copy (ADR-186) (backend)
  • the Egress page and "Talks to the internet" on the source pages (ADR-188) (web)
  • GET /api/v1/egress, the Egress page's read (ADR-188, ADR-189) (backend)
  • egress inventory tables and the worker's minute, look-back and forgetting jobs (backend)

Fixes

  • mcp-e2e.ts expects 19 tools (0.7.0 added get_egress, get_new_destinations and get_expected_destinations) (test)
  • egress-e2e.sh asks for a 30-day API token, reads the alert's resolvedAt under "alert", and accepts "1 other workload talks to it" (test)
  • the Egress page says it is learning first-seen times until the look-back has run (web)
  • no egress row is New until the cluster's first-seen look-back has run (backend)
  • a blank WATCHLOG_EGRESS_LEARNING_DAYS means the default of 7 days, not 0 (backend)
  • the policy's window reads as one sentence (web)
  • an egress alert on a Compose service is listed as the Compose service, not a host (web)
  • an egress alert's probable cause looks at the hour before its first connection, not before it fired (backend)
  • pattern fields keep their case, and "every workload" / "every container or Compose service" in the singular (web)
  • an expectation for any port is audited as port "any", not null (backend)
  • the egress read shows a Compose container's service rows even without traffic on its host (backend)

Install

Kubernetes (backend, web, agents in one chart):

helm install watchlog oci://ghcr.io/watchlog-light/charts/watchlog --version 0.7.0 \
  --namespace watchlog --create-namespace

Docker hosts: see the install guide.

Verify

Images and charts are signed with cosign (keyless, GitHub Actions OIDC):

cosign verify ghcr.io/watchlog-light/agent:0.7.0 \
  --certificate-identity-regexp '^https://github.com/watchlog-light/watchlog/\.github/workflows/release\.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com