Hardened Fail2ban on Debian 13 (trixie-slim) with nftables/iptables, multi-arch, 0 fixable CVEs.
739
A hardened, multi-arch Fail2ban container built on Debian 13 (trixie-slim) from SHA-256-verified official fail2ban/fail2ban releases — maintained by Daniel G. Cosenza from FNX Labs.
dgcosenza/fail2banghcr.io/dgcosenza/fail2ban (identical signed multi-arch digest)dgcosenza/fail2ban-dockerdgcosenza/fail2ban monitors host or container log files and enforces dynamic nftables or iptables ban rules on the host network namespace. It installs the official SHA-256-verified upstream Fail2ban package with Python 3.13 (python3-systemd, python3-pyinotify, and Fail2ban's built-in asyncore/asynchat compatibility), drops unused tools, runs under tini PID 1, and exposes a live fail2ban-client ping HEALTHCHECK.
| Component | Resolved Version |
|---|---|
| Fail2ban | 1.1.1 |
| Base OS | Debian 13.8 (trixie-slim) |
| Architectures | linux/amd64, linux/arm64 |
| Uncompressed size (per arch) | amd64: 51.6 MB, arm64: 171.8 MB |
| Last verified build (UTC) | 2026-11-28 |
| Published multi-arch digest | dgcosenza/fail2ban@sha256:900c8dc7a785896b65b179bb4058907306823d9c4c5fa573ce389aebc7604f57 |
| GHCR mirror | ghcr.io/dgcosenza/fail2ban@sha256:900c8dc7a785896b65b179bb4058907306823d9c4c5fa573ce389aebc7604f57 |
| Supply chain | Cosign OIDC signed + SPDX & CycloneDX SBOM attestations + SLSA Build L3 provenance |
| Security gate (Trivy + Grype on SBOM) | 0 fixable findings of any severity (24 upstream-unfixed) |
| Tag | Policy | Description |
|---|---|---|
latest | Moving | Latest verified multi-arch build passing all CVE, Dive, and smoke gates. |
<version> (e.g. 1.1.1) | Moving | Latest verified build for that upstream release. |
<version>-<YYYYMMDD> | Immutable | Date-stamped daily security rebuild. |
sha-<short> | Immutable | Git commit tag from this repository. |
| Architecture | Status | Verification |
|---|---|---|
linux/amd64 | Published & natively tested | Live daemon + jail smoke test, Dive >= 95%, Trivy + Grype 0 fixable CVEs, Cosign OIDC, SLSA L3. |
linux/arm64 | Published & natively tested | Live daemon + jail smoke test, Dive >= 95%, Trivy + Grype 0 fixable CVEs, Cosign OIDC, SLSA L3. |
Volume ownership note:
docker-compose.example.ymldefaults to a named Docker volume so non-root runtime permissions (1000:1000) are initialized automatically; if switching to a host bind mount, pre-create the directory owned by1000:1000(mkdir -p ./data && chown 1000:1000 ./data) beforedocker compose up -d.
docker run -d --name fail2ban --network host --restart unless-stopped \
--cap-drop ALL --cap-add NET_ADMIN --cap-add NET_RAW \
-v "$(pwd)/data:/data" -v /var/log:/var/log:ro \
-e F2B_IPTABLES_MODE=nftables \
dgcosenza/fail2ban:latest
See docker-compose.example.yml.
| Variable | Default | Description |
|---|---|---|
F2B_LOG_LEVEL | INFO | Fail2ban log level (CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG). |
F2B_LOG_TARGET | STDOUT | Log destination (STDOUT, STDERR, SYSLOG, or file path). |
F2B_DB_PURGE_AGE | 1d | SQLite ban database purge age (/data/db/fail2ban.sqlite3). |
F2B_MAX_RETRY | 5 | Default failures before ban. |
F2B_FIND_TIME | 10m | Default failure observation window. |
F2B_BAN_TIME | 10m | Default ban duration. |
F2B_IPTABLES_CHAIN | DOCKER-USER | Default firewall chain. |
F2B_IPTABLES_MODE | nftables | Default ban backend (nftables or iptables). |
TZ | Etc/UTC | Container timezone. |
Volumes: /data (jail.d/, filter.d/, action.d/, db/), plus read-only log mounts (/var/log:ro). Ports: None (runs on host network with NET_ADMIN/NET_RAW to manipulate host firewall rules). PID 1: tini.
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD ["/usr/local/bin/fail2ban-healthcheck"]
Runs fail2ban-client -s /var/run/fail2ban/fail2ban.sock ping and verifies Server replied: pong. Verified on amd64 and arm64; do not disable in Compose.
crazymax/fail2ban/data (jail.d/, filter.d/, action.d/, db/) and read-only log directories.F2B_* environment variables and switch the image to dgcosenza/fail2ban@sha256:<digest>.cosign verify \
--certificate-identity-regexp="^https://github\.com/dgcosenza/fail2ban-docker/\.github/workflows/daily\.yml@refs/heads/main$" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
ghcr.io/dgcosenza/fail2ban:latest
gh attestation verify oci://ghcr.io/dgcosenza/fail2ban:latest --owner dgcosenza
UNKNOWN–CRITICAL, --ignore-unfixed, exit 1) and Grype on Syft SPDX SBOM (--only-fixed --fail-on negligible) on both amd64 and arm64.fail2ban/fail2ban release package verified against exact GitHub release SHA-256 before installation.NET_ADMIN + NET_RAW.SECURITY.md.docker buildx build --platform linux/amd64 --load -t dgcosenza/fail2ban:local .
./tests/smoke.sh dgcosenza/fail2ban:local
.github/workflows/daily.yml runs daily at 05:27 UTC with --no-cache: resolves latest fail2ban/fail2ban release + SHA-256 and debian:13.8-slim digest; runs live jail smoke + Dive + Trivy + Grype gates on amd64 and arm64; publishes identical Cosign-signed SLSA L3 digests to Docker Hub and GHCR (plus optional secondary OCI mirrors); syncs docs & Hub overview; and manages a single ci-failure issue.
.deb on Debian 13: Guarantees full compatibility with Python 3.13 (python3-systemd, python3-pyinotify) and clean dpkg/Trivy visibility without unpinned pip installs.nftables default with iptables fallback: Matches modern Debian 13 / Ubuntu 24.04–26.04 kernel netfilter stacks.packaging: MIT): MIT License — copyright Daniel G. Cosenza from FNX Labs.fail2ban/fail2ban (upstream: GPL-2.0-or-later): GPL-2.0. See THIRD-PARTY-NOTICES.md.Maintained by Daniel G. Cosenza from FNX Labs. Upstream: fail2ban/fail2ban.
Content type
Image
Digest
sha256:900c8dc7a…
Size
49.2 MB
Last updated
about 3 hours ago
docker pull dgcosenza/fail2ban