Loop icon
Commands icon
Docker icon
Script icon
If icon
SlackIncomingWebhook icon
Log icon
Schedule icon

Audit the Operating System Inside Your Container Images for End of Life

Start each container image, read its os-release file and check the operating system against endoflife.date. Alert Slack before a base OS loses security fixes.

Categories
Infrastructure

A tag like latest, or an image built in-house, tells you nothing about the operating system inside it. Tag and Dockerfile checkers cannot judge those images. This blueprint starts each image you list, reads its /etc/os-release, looks the distro release up on the public endoflife.date API and tells Slack when the OS is already past end of life or ends inside your warning window.

It checks the operating system that is really inside the image. To check the versions pinned in a repository (Dockerfile FROM lines, compose files, Helm values), use the runtime-end-of-life-guard blueprint instead. The two cover different cases.

How it works

  1. read_os_release (io.kestra.plugin.core.flow.Loop) runs read_image once per image, one at a time. read_image (io.kestra.plugin.scripts.shell.Commands) runs inside that image, sources /etc/os-release and sends the distro ID, VERSION_ID and PRETTY_NAME back through the ::{"outputs": ...}:: protocol. An image with no shell or no os-release file, such as a distroless image, fails that step. It is allowed to fail and is reported as UNKNOWN.
  2. classify (io.kestra.plugin.scripts.python.Script) maps each distro to its endoflife.date product and release line (for example Alpine 3.19.1 becomes alpine-linux 3.19, Debian 12.5 becomes debian 12) and marks it EXPIRED, EXPIRING, SUPPORTED or UNKNOWN. A failed lookup is UNKNOWN, never SUPPORTED. It writes a Markdown table to os-eol-report.md.
  3. needs_attention (io.kestra.plugin.core.flow.If) posts to Slack only when an image is expired, expiring or could not be checked. Otherwise log_all_supported records a clean run.
  4. The errors block posts to Slack if the audit itself fails.
  5. The weekly Schedule trigger is disabled by default. Enable it when you are ready.

Prerequisites

  • Secret SLACK_WEBHOOK_URL: Slack incoming webhook that receives the alert (required).
  • A worker that can run Docker task runners and pull the images you list.
  • Network access from the classify container to https://endoflife.date.
  • Supported distros: Debian, Ubuntu, Alpine, RHEL, CentOS, AlmaLinux, Rocky Linux, Fedora, Amazon Linux, Oracle Linux, SLES and openSUSE Leap. Any other distro is reported as UNKNOWN.

Inputs

  • images (ARRAY of STRING): image references to audit. Default: debian:11, alpine:3.19, ubuntu:22.04, python:3.12-slim.
  • warn_days (INT): alert when end of life is this many days away or less. Default: 90.

Outputs

  • report (FILE): the Markdown table of every audited image.

How to extend

  • Read the image list from a KV store or from your registry instead of an input.
  • Add a Jira or GitHub issue task in the then branch to open a ticket per expired image.
  • Add a Fail task on EXPIRED to turn this into a release gate.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.