Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Slack Engineering 10 min read How-to mediumAdept

A Simple Kubernetes Admission Webhook

A Kubernetes validating and mutating admission webhook can be a minimal, stateless Go HTTPS server that receives AdmissionReview requests and returns allow/deny decisions or base64-encoded JSON patches. No Kubebuilder or Operator SDK is needed. The walkthrough covers the Deployment, Service, TLS Secret (SAN must match the service hostname) and the Validating/MutatingWebhookConfiguration objects, including using a namespaceSelector so the webhook doesn't gate its own pods. It then shows pluggable validator and mutator interfaces, used for pod-name checks, env injection and annotation-driven tolerations. Practical lessons: webhook invocation order isn't guaranteed and reinvocationPolicy: IfNeeded can call a webhook twice, so mutations must be idempotent, and local testing must be backed by a prod-like environment.

Related posts

  • Rejecting Invalid Ingress Routes at Apply Time

    Zalando Engineering mediumAdept

    Zalando moved validation of Skipper routing configuration onto the Kubernetes admission path, so a validating webhook now rejects Ingress and RouteGroup objects with unknown predicates, bad filter parameters or unparseable backends during kubectl apply. The webhook reuses Skipper's own filter registry, predicate specs and backend checks, so it answers "would Skipper accept this route?" rather than "does this string parse?", and it returns actionable error messages. Zalando runs this across 250+ clusters with ~200k routes. It rolled the change out tier by tier, watching a skipper_route_invalid{route_id, reason} metric and webhook health, with an -enable-advanced-validation flag as a fast rollback when false positives appeared. The feature ships in open-source Skipper from v0.24.18.

  • Building Overexposed: understanding application exposure

    Shopify Engineering mediumAdept

    Overexposed is Shopify's scheduled scanner for finding GKE Ingresses and Cloud Run services reachable without authentication. An earlier version read Kubernetes config from the repo, and it produced false alarms, misses and blind spots. The rebuild pulls admitted resources and IAM policies from GCP Cloud Asset Inventory and probes each endpoint anonymously with HEAD-first requests and checked redirects. It maps each result to one of six verdicts (exposed, expected, protected, not found, unreachable, inconclusive) with recorded evidence. Key lessons cover how a status code means different things on different surfaces (a Cloud Run 404 can come from Google's front end), SSRF protection for the scanner itself by connecting to pre-validated IPs, replaying rule changes against saved scans (which cut inconclusive Ingress results by about 80%), and mutation testing and per-verdict canaries to verify AI-written tests.

  • How we build containerized services at GitHub using GitHub

    GitHub Engineering easyNovice

    GitHub runs hundreds of internal and production services on a "paved path": a Kubernetes-based, multi-cluster, multi-region platform plus conventions and custom tooling layered on top. Services are onboarded via a Hubot ChatOps scaffold command and a GitHub App that opens a PR with deployment.yaml, Kubernetes Deployment/Service manifests, a Debian Dockerfile, and CI checks that build images on every push. Each app/environment gets its own namespace, secrets are injected per-environment from a central vault, and deployments render manifests with the latest image and secrets before applying them across clusters. Centralizing capacity planning, security scanning, base images and deploy tooling lets teams skip cluster management and focus on their applications.

  • Docker Security Advisory: AuthZ Plugin Bypass Regression in Docker Engine

    Docker mediumAdept

    Docker Engine v19.03 and later regressed on a 2018 authorization-plugin bypass (CVE-2024-41110): an API request with Content-Length set to 0 causes the daemon to forward the request to the AuthZ plugin without its body, so a plugin not set to deny by default may approve it and allow privilege escalation. The original fix shipped in v18.09.1 in January 2019 but was not carried forward; patches were released July 23, 2024. Only setups relying on AuthZ plugins are affected, and Docker Desktop impact is limited to the VM, with 4.33 containing the fix. Remediation is to upgrade, or else avoid AuthZ plugins and restrict Docker API access.

  • Docker OIDC connections for GitHub Actions available for Docker Orgs

    Docker mediumAdept

    Docker Hub now accepts GitHub Actions OIDC tokens, letting workflows exchange a signed per-run JWT for a short-lived, scoped Docker access token instead of storing long-lived PATs or OATs as secrets. Docker verifies the token signature against GitHub's keys and matches its subject claim against up to five rulesets per connection, which can pin access to specific repos and branches. Setup requires creating a connection in Docker Home, granting `id-token: write`, and setting `DOCKERHUB_OIDC_CONNECTIONID` for docker/login-action v4.5.0+. It is available to Team, Business, DHI and DSOS organizations; existing tokens keep working and non-GitHub CI still uses PATs/OATs.

The quest for software engineering knowledge.

Look:
Layout: