- Jinja 81.5%
- Python 18.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PVUe4g65L7UnUVqHmQp7kG |
||
| .forgejo/workflows | ||
| changelogs | ||
| extensions/molecule | ||
| meta | ||
| roles | ||
| .ansible-lint | ||
| .copier-answers.yml | ||
| .gitignore | ||
| .gitleaks.toml | ||
| .pre-commit-config.yaml | ||
| .yamllint | ||
| CHANGELOG.md | ||
| CONTRIBUTING.md | ||
| galaxy.yml | ||
| LICENSE | ||
| README.md | ||
| requirements.yml | ||
| ruff.toml | ||
| SECURITY.md | ||
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.