packaged by Chainguard
Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.
Keepalived implements the Virtual Router Redundancy Protocol (VRRP) so a virtual IP can fail over between routers, and drives the Linux Virtual Server (IPVS) kernel load balancer with health checkers that add and remove real servers as they come and go. This variant runs against an OpenSSL restricted to FIPS-approved algorithms.
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev:
Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.
The keepalived project does not publish a container image, so there is no upstream
image to be a drop-in replacement for. Upstream ships a Dockerfile.in template in
its source tree that users build themselves, and this image follows it: the
entrypoint is the same, and the binary is reachable at both /usr/sbin/keepalived
and /usr/bin/keepalived.
keepalived takes all of its cryptography from the system OpenSSL through the EVP
API, so this is the same build as the
standard keepalived image
plus openssl-config-fipshardened, rather than a separately built binary.
No configuration file ships in the image. Upstream's Dockerfile copies a demo
keepalived.conf that claims the address 10.247.254.2 on eth0; since nothing
else advertises for that virtual router, a container started with it wins the
election and takes that address on whatever network it joins. Mount your own
instead. A commented reference configuration is included at
/etc/keepalived/keepalived.conf.sample.
keepalived uses MD5 in three places, none of them FIPS-approved: auth_type AH
VRRP authentication, the url { digest } option of the HTTP_GET and SSL_GET
checkers, and the bundled genhash tool. All three keep working in this image by
default, because the OpenSSL legacy provider is enabled. Set
CHAINGUARD_LEGACY_ALLOWED=0 in the container environment to turn MD5 off.
With MD5 off, keepalived logs IPSEC-AH : cannot compute HMAC-MD5 and sends an
unauthenticated advert that peers reject, and a digest health check fails against
a server that is actually healthy. Use the approved alternatives:
| Instead of | Use |
|---|---|
|
|
|
|
auth_type PASS is unaffected either way: it sends the password in clear text and
involves no cryptography at all.
For more on FIPS support in Chainguard Containers, consult the guide on FIPS-enabled Chainguard Containers.
keepalived manages addresses and routes on a real network interface, so the container needs:
CAP_NET_ADMIN and CAP_NET_RAW,/run: keepalived writes keepalived.pid, keepalived_vrrp.pid and
keepalived_checkers.pid there. Under a read-only root filesystem, mount a
writable volume at /run, or the pid-file open fails and keepalived reports it
as daemon is already running, andinterface to that
host's actual NIC name: keepalived exits if the interface does not exist, and it
is often not eth0.VRRP uses IP protocol 112 to the multicast group 224.0.0.18 rather than a TCP
port, so no ports are published. Where multicast is unavailable, configure
unicast_peer instead.
Write a configuration and mount it over /etc/keepalived/keepalived.conf. This
example authenticates its adverts with auth_hmac, which is the option to use
here, and claims a virtual IP on eth0; with --network host that is the host's
interface name, so substitute your own everywhere eth0 appears below.
Generate the key rather than copying this one, with openssl rand -hex 32:
Every peer sharing a virtual_router_id must carry the same key, or they will
reject each other's adverts and each claim the virtual IP.
With no peer advertising a higher priority, the instance is promoted after the advertisement interval:
and the virtual IP is assigned to the interface:
Before starting the daemon, you can check a configuration without running it:
keepalived itself is configured entirely through
/etc/keepalived/keepalived.conf; it reads no environment variables of its own.
The image honours CHAINGUARD_LEGACY_ALLOWED, described under FIPS Support above.
The entrypoint runs the daemon in the foreground with --dont-fork --log-console,
so it logs to stderr rather than to a file inside the container. docker logs
shows it; pipe with 2>&1 when grepping.
Health checkers are the other half of a typical configuration. IPVS is a kernel
facility, so the ip_vs module must already be loaded on the host: the image ships
no modprobe, and without it keepalived logs IPVS: Can't initialize ipvs and
silently stops load balancing.
This virtual_server load balances two backends and removes one automatically when
its HTTP check fails. It matches on status_code rather than digest, since the
digest option is MD5:
If you use notify or vrrp_script hooks, keepalived runs them as the
keepalived_script user, which this image creates. Scripts must be readable and
executable by that user, and every directory in the path to the script must be
owned by root and not writable by anyone else, or enable_script_security refuses
to run them.
This image ships no shell or interpreter, so a hook must be an executable the
kernel can run directly -- a dynamically linked ELF binary is fine, as long as its
libraries are in the image. A #!/bin/sh script fails to exec, and a command
written as a shell string is run through system(), which also needs a shell.
Add busybox with Custom Assembly
if your hooks need one.
keepalived's parent process stays alive if the VRRP child exits transiently, so a
container can look healthy while doing nothing. It does exit on a configuration
error, a fatal error or a missing permission, so container liveness catches those.
For everything else, watch for Entering MASTER STATE or poll the virtual IP
rather than relying on container liveness alone.
This image is built with VRRP, LVS/IPVS, BFD, nftables, iptables, ipset, SNMP
(including the RFC VRRP MIBs), DBus, JSON and regex support compiled in. SNMP is
an AgentX subagent, so it needs a master agent reachable at /var/agentx/master;
neither that socket nor its directory exists in the image, so mount the socket in
from a master agent on the host. Run
docker run --rm --entrypoint /usr/bin/keepalived cgr.dev/ORGANIZATION/keepalived-fips:latest -v
to print the full list.
keepalived container imageChainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.
All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev, variant.
In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.
Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.
To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.
To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.
Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
( GPL-2.0-or-later
Apache-2.0
BSD-1-Clause
BSD-2-Clause
BSD-3-Clause
BSD-4-Clause-UC
CC-PDDC
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementChainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.
SLSA compliance at ChainguardThis image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.
PCI DSS at ChainguardThis is a FIPS validated image for FedRAMP compliance.
This image is STIG hardened and scanned against the DISA General Purpose Operating System SRG with reports available.
Learn more about STIGsGet started with STIGs