No description
  • Jinja 81.5%
  • Python 18.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
oliver.maklott 05a6dacd62
All checks were successful
ci / units (push) Successful in 0s
ci / build (push) Successful in 1s
release / release (push) Successful in 2s
ci / sanity (push) Successful in 3s
ci / lint (push) Successful in 9s
ci / molecule (push) Successful in 4m21s
Release 0.4.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PVUe4g65L7UnUVqHmQp7kG
2026-11-30 07:05:37 +00:00
.forgejo/workflows belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
changelogs Release 0.4.1 2026-11-30 07:05:37 +00:00
extensions/molecule Secret files without the secret in a command line (role secret_script) 2026-11-30 05:14:38 +00:00
meta belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
roles secret_script: the controller's temporary file is no change 2026-11-30 07:00:00 +00:00
.ansible-lint belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
.copier-answers.yml belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
.gitignore belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
.gitleaks.toml belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
.pre-commit-config.yaml belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
.yamllint belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
CHANGELOG.md Release 0.4.1 2026-11-30 07:05:37 +00:00
CONTRIBUTING.md belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
galaxy.yml Release 0.4.1 2026-11-30 07:05:37 +00:00
LICENSE belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
README.md collection-base v0.2.0: raw_files, backup_source and restic 2026-11-27 19:42:18 +00:00
requirements.yml belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
ruff.toml belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00
SECURITY.md belowtoxic.base 0.1.0: Debian and Ubuntu baseline 2026-11-22 23:38:15 +00:00

belowtoxic.base

Baseline for Debian 13 and Ubuntu 24.04/26.04 hosts and guests: hardened SSH with certificate logins, accounts, unattended security updates, kernel hardening, time and journald. Flatcar's own configuration is Ignition (belowtoxic.flatcar); the raw-only roles below (files, pulled backups) work on Flatcar and Debian alike.

Part of belowtoxic-ansible.

Roles

Role Does
belowtoxic.base.ssh sshd drop-in: no passwords, no root, modern algorithms (filtered to what the target supports), user CA + principals, host certificate, AllowGroups; handles Ubuntu's socket activation
belowtoxic.base.users accounts with locked passwords, SSH access group, validated sudo rules, removal
belowtoxic.base.apt base packages, purge of legacy clients, unattended security upgrades
belowtoxic.base.sysctl kernel and network hardening (no forwarding / rp_filter - that is the network role's job)
belowtoxic.base.time UTC, NTP via chrony or systemd-timesyncd
belowtoxic.base.journald persistent, size-limited journal
belowtoxic.base.raw_files directories and files on hosts without Python (raw only), written when they differ
belowtoxic.base.backup_source restricted SSH user that streams a backup to the coordinator (forced command)
belowtoxic.base.restic backup coordinator: restic jobs that pull sources over SSH into S3 repositories

Every role validates its input with meta/argument_specs.yml; see ansible-doc -t role belowtoxic.base.<role>.

Example

- name: Baseline
  hosts: all:!flatcar
  become: true
  vars:
    users_accounts:
      - {name: ansible, sudo: nopasswd, authorized_keys: []}
      - {name: alice, comment: Alice, sudo: nopasswd, authorized_keys: []}
    ssh_allow_groups: [ssh-users]
    ssh_trusted_user_ca_keys: ["{{ infra_global.ssh_user_ca }}"]
    ssh_user_principals:
      ansible: [ansible]
      alice: [alice, admins]
  roles:
    - belowtoxic.base.apt
    - belowtoxic.base.users
    - belowtoxic.base.ssh
    - belowtoxic.base.sysctl
    - belowtoxic.base.time
    - belowtoxic.base.journald

Run users before ssh when ssh_allow_groups is used, so the accounts are in the group before sshd starts enforcing it.

Testing

extensions/molecule/default boots Debian 13, Ubuntu 24.04 and Ubuntu 26.04 VMs (belowtoxic.testing QEMU lab), applies all roles, checks idempotence, the effective sshd -T configuration, and logs in from the controller with certificates signed by a throwaway CA (right principal: accepted; wrong principal and root: refused).

extensions/molecule/backup pulls a Flatcar source into a restic repository on an S3 server with versioning and Object Lock (Versity Gateway, standing in for Wasabi): the job runs, the data restores, the source streams whatever the coordinator asks for, the same key from another address is refused, and after forget --prune Object Lock refuses to delete the old versions.

eval "$(../toolchain/bin/bt-ci-setup)"
bt-ci lint && bt-ci sanity
bt-ci molecule default

License

GPL-3.0-or-later, see LICENSE.