Corrected 2026-12-05

Runbook, after the drift was checked.

Build order is still 00 through 08. Several corrections from the 2026-12-05 audit were applied the same day: registry publish, host firewalls, the SSH drop-in, peer-only VRRP, Cockpit removed from the zones that still listed it, and the RHEL 7 guest powered off. A step still marked "not applied" has not been executed.

Secret. The original chapter 07 writes a VRRP auth_pass in the markdown. This copy does not. Use a generated secret, store it only in /etc/keepalived/keepalived.conf, and keep that file mode 0600.

0. Hypervisor

mikanko is RHEL 10.3 on a Minisforum MS-A2. NIC enp4s0 is 192.168.1.171/24. The lab gateway is 10.77.20.1/24 on virbr-lab. The host clock is America/New_York. Guests are UTC. The corrected standard is UTC on the hypervisor too, so a kernel log and a guest journal share a clock. That change has not been applied.

VM disks must not land on the 70 GiB root. /home/libvirt-images is bind-mounted on /var/lib/libvirt/images. The live source is /dev/mapper/rhel_mikanko-home[/libvirt-images], XFS, 12 TiB, 3% used. The SELinux rule is virt_image_t. Base images are mode 0444. Mutating a base corrupts every overlay.

RHEL 10 libvirt is modular. Enable virtqemud, virtnetworkd, virtnodedevd, virtnwfilterd, virtsecretd, virtstoraged, and virtinterfaced, including the -ro and -admin sockets. shellcore is in group libvirt. virt-host-validate passes. A SEV warning on this CPU is expected.

Done when findmnt /var/lib/libvirt/images shows the home volume, ls -Z shows virt_image_t, and virsh uri is qemu:///system.

1. Networks and isolation

lab-nat is a libvirt NAT network. Bridge virbr-lab, forward mode nat, address 10.77.20.1/24, DHCP 10.77.20.100–200. Static Cloud-Init addresses use .10 through .35. lab-airgap is bridge virbr-leg with no forward element, no IP, and no DHCP. The libvirt default network exists and is inactive, autostart off. Do not put guests on it. Its NAT is 192.168.122.0/24, and the home-LAN block does not cover that range.

Two firewalld policies, both priority -10, target CONTINUE, ingress zone libvirt:

Both policies were active when re-read on 2026-12-05 with the sudoers-allowed command firewall-cmd --info-policy=…. A --query-rich-rule is not on that list and will ask for a password. Do not widen sudoers to make the probe pass.

An offline drill is a runtime-only rich rule that drops all forwarded traffic from 10.77.20.0/24. firewall-cmd --reload clears it. That drill was not run for this write-up.

Done when both networks are active and autostart, both policies exist, and a probe from a guest to 192.168.1.1:80 and to 192.168.1.171:22 times out and is logged. The audit saw that. It was not repeated for this page.

2. Base images and spawn

scripts/lab-spawn.sh NAME BASE OSINFO VCPU RAM_MB DISK_GB IP [NET] [DNS] creates a qcow2 overlay on a read-only base, writes a NoCloud seed, and imports it. MAC is 52:54:00 plus three bytes of sha256(name). NIC name is enp1s0 on rhel10*, eth0 otherwise. The user is shellcore, wheel, NOPASSWD, SSH key only.

Corrected. The spawn script does not write /etc/ssh/sshd_config.d/99-lab-hardening.conf. Add it, or the next guest boots with PermitRootLogin without-password and X11Forwarding yes. The drop-in is:
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no
X11Forwarding no

Live: mikanko, both IdM nodes, both load balancers, and both webs have that hardening. mgmt01, db01, mon01, and rhel10-app do not. Password authentication is already off on those four. Root key login is not.

Core spawn, DNS initially 10.77.20.1, then moved to IdM after step 4:

lab-spawn.sh mgmt01     rhel-9.9.qcow2  rhel9.9  2 4096 200 10.77.20.10
lab-spawn.sh idm01      rhel-9.9.qcow2  rhel9.9  2 4096  30 10.77.20.11
lab-spawn.sh lb01       rhel-9.9.qcow2  rhel9.9  2 2048  20 10.77.20.15
lab-spawn.sh web01      rhel-9.9.qcow2  rhel9.9  2 2048  30 10.77.20.19
lab-spawn.sh web02      rhel-9.9.qcow2  rhel9.9  2 2048  30 10.77.20.29
lab-spawn.sh rhel10-app rhel-10.3.qcow2 rhel10.3 2 4096  40 10.77.20.30

A local password is set afterwards for virsh console only. SSH stays key-only. The first reboot of a virt-install --cloud-init guest can land shut off once, because libvirt drops the seed ISO. Later reboots use on_reboot=restart. The audit said every defined guest has that setting and no leftover seed ISO.

Done when the six core guests answer SSH with the expected release, and a home-LAN probe from mgmt01 is logged on mikanko.

3. Controller and the dated mirror

mgmt01 is the Ansible controller and the RHEL 9 snapshot host. Register it, install ansible-core, nginx, dnf-plugins-core, and the SELinux tools. Mirror BaseOS and AppStream into /srv/repos/YYYY-MM-DD with dnf reposync --newest-only --download-metadata. Serve that directory on port 80. The stock welcome listener on 8080 was removed on 2026-12-05. Label the tree httpd_sys_content_t.

The live snapshot date used by the webs is 2026-12-04. Repo ids are lab-baseos-2026-12-04 and lab-appstream-2026-12-04. gpgcheck=1. Pairing --newest-only with --download-metadata leaves older builds listed in repodata. Always pass --latest-limit=1 on a repoquery against the snapshot, or run createrepo_c --update if you want those entries gone.

The inventory that ships with this corrected copy includes lb02. The copy in the lab tree on the audit VM also includes lb02. The file in shellcore's home on mgmt01 was not readable by lab-audit, which is the intended permission. Confirm that copy from an admin login before a rolling patch. If lb02 is commented out there, a patch drains only lb01.

Done when ansible all -m ping returns pong from both load balancers and both webs, and both repomd.xml files are served with SELinux enforcing.

4. FreeIPA

Realm LAB.INTERNAL, domain lab.internal, forwarder 10.77.20.1. Install ipa-server and ipa-server-dns. Passwords are prompted. They are not in the runbook. Before install, getent ahostsv4 idm01.lab.internal must return 10.77.20.11, not ::1. Cloud-init's loopback hostname mapping has to be removed or the installer binds the wrong address.

Reverse zone 20.77.10.in-addr.arpa. A and PTR for every static host, plus lb-vip at .14. Both IdM nodes in NS and in _ldap._tcp and _kerberos._tcp. The audit saw that, with SOA serial 1796424595 and certificates through 4 Dec 2028.

Disable HBAC allow_all. Host group web-servers holds web01 and web02. User ops-allowed may SSH there and may run only /usr/bin/systemctl status nginx. User ops-denied is rejected by pam_sss. shellcore's key remains the break-glass local login.

Corrected, not applied. On every enrolled host, set ldap_sudo_search_base = ou=sudoers,dc=lab,dc=internal under [domain/lab.internal], then sss_cache -E and restart sssd. Without it, SSSD searches the whole tree for sudoRole objects and logs that at error priority. All six enrolled hosts were logging it.

After IdM exists, guests that still use 10.77.20.1 for DNS only see the hypervisor's /etc/hosts. They do not see SRV records and they do not fail over to idm02. rhel10-app is still in that state. Disable cloud-init network config, then set ipv4.dns to 10.77.20.11 and 10.77.20.12 with ipv4.ignore-auto-dns yes.

5. HAProxy, Keepalived, and the patch gate

Clients use http://lb-vip.lab.internal/healthz or http://10.77.20.14/healthz. HAProxy round-robins web01 and web02. Check interval 3s, fall 2, rise 2. Timeouts: request 10s, queue 1m, connect 5s, client and server 30s. haproxy_connect_any is on. net.ipv4.ip_nonlocal_bind=1 on both load balancers so HAProxy can bind the VIP before it is local, including on the backup.

On 2026-12-05 two requests to the VIP returned web02, then web01. Direct checks returned each host's own body.

Applied. Do not add rule protocol value="vrrp" accept. Chapter 07 now says the same thing. On lb01, VRRP is accepted only from 10.77.20.16/32. On lb02, only from 10.77.20.15/32. The unscoped rule is gone on both nodes.
Corrected, not applied. Prepend this to keepalived.conf on both nodes, keep mode 0600, run keepalived -t, then restart:
global_defs {
    enable_script_security
    script_user root
}

VRID 51, advert interval 1, authentication type PASS, secret not printed here. lb01 is MASTER at 101. lb02 is BACKUP at 90. The track script is pkill -0 haproxy every 2 seconds, weight 20. The audit saw effective priorities 121 and 110, and a SELinux denial on keepalived setattr of pkill. The check was still succeeding.

The patch playbook refuses check mode. It requires a stage of canary or peer, a ticket matching LAB-…, one NEVRA, and a snapshot repo id. The target must have patch_opt_in: true. Both HAProxy nodes drain that backend. Root must have 1024 MiB free. The install disables every other repo, refuses downgrade and erase, and keeps GPG checking on. If dnf needs-restarting -r exits 1, the playbook holds unless reboot was separately approved. The node is set ready only if /healthz equals ok: plus that host's FQDN. A canary writes a mode 0600 receipt. The peer stage requires that file, patch_peer_approved=true, and a fresh live canary check. A wrong body stops the playbook before web02 is drained. Both opt-in flags go back to false.

6. Leapp, bootc, and the registry

Stateless webs should be rebuilt and cut over. Leapp is for a stateful host. The lab proves it on rhel08-upg, which is shut off, with a pre-leapp snapshot. Assessment is leapp preupgrade. Inhibitors in /var/log/leapp/leapp-report.txt are a no-go. Direct 8 to 10 is not a supported jump. A 9 to 10 clone was specified at 10.77.20.28 and was not in the live domain list.

rhel10-app is a package-mode RHEL 10.3 guest. It is not the bootc host. Do not run bootc status there. The image-mode guest is rhel10-bootc, DHCP, currently 10.77.20.124, health file ok:rhel10-bootc:v1. It was not built by lab-spawn.sh, so it has no static address and no lab-audit user.

Applied 2026-12-05. Do not run podman run -p 5000:5000. A rootful publish inserts netavark DNAT and FORWARD accepts that never reach firewalld INPUT, so source rich rules do not apply. Do not mount /srv/registry-auth and do not set REGISTRY_AUTH. Plaintext htpasswd makes bootc switch fail with 401, and a bad config.yml crash-loops the container. The container that is running is:
sudo podman rm -f lab-registry
sudo podman run -d --name lab-registry --restart=always --network=host \
  -v /srv/registry:/var/lib/registry:Z \
  docker.io/library/registry:2
curl -fsS http://127.0.0.1:5000/v2/

The three source rich rules stay: 10.77.20.1/32, 10.77.20.96/27, and 10.77.20.128/25. They only filter the port because the container is on the host network. Verified the same day: mikanko got {}; web01 and audit01, which are outside the allowlist, were refused. Chapter 06 on disk now says the same thing.

The Containerfile that was built adds 01-lab-hardening.conf before the healthz file. The running guest is still ok:rhel10-bootc:v1, and a keyless SSH probe no longer lists password. It does not remove cockpit from the image firewall, and it does not add a lab-audit user. v2 is the same file with the health string changed, used only to rehearse bootc switch and bootc rollback. That rehearsal has not been repeated since the rebuild.

rhel07-leg is the comparison node. It is on virbr-leg, shut off, autostart off, no address. Leave it off when the comparison is done. Do not add a forward element to reach it.

7. What chapter 07 specifies, and what is not done

lb02, idm02, the VIP, and the two HAProxy configs are in service. The rest of the chapter is written and not finished.

A VIP failover was not executed for this write-up. The audit saw lb01 holding .14. Stopping HAProxy on lb01 should move .14 in about two seconds. Do not test that by injecting VRRP from a third host.

8. The audit VM

audit01 is RHEL 10.3, 4 vCPU, 8 GiB, 10.77.20.35. Agents run here so a mistake does not start in the Mac keychain or in the hypervisor's admin home. The account is lab-audit: locked password, not in wheel, not in libvirt, SSH key with no-port-forwarding, no-X11-forwarding, and no-agent-forwarding, plus a read-only sudoers list. On the hypervisor, libvirt inspection is virsh -r -c qemu:///system.

The allowed firewall command is firewall-cmd --info-policy=lab-block-homelan and the matching host-IP policy, plus --list-all and --get-policies. It is not a general firewall-cmd. A nearby flag that is not on the list asks for a password. That is the control working.

Applied. firewalld is active. Cockpit is not listening. Effective sshd settings are password off, keyboard-interactive off, root login off, and X11 forwarding off.

There is no audit alias for rhel10-bootc, rhel08-upg, or rhel07-leg. Power state for those guests comes from virsh -r. rhel08-upg and rhel07-leg are shut off. Do not give the air gap an address. The image-mode guest no longer offers password SSH. Do not add plaintext registry authentication in order to bake lab-audit into a later image.

The Hermes cron prompt on this VM was corrected. It runs locally as shellcore, connects outward as lab-audit, and does not ask for bootc status on rhel10-app.

Done, in one list

StepDone whenStatus
0 HostImages mount is the 12 TiB volume, virt_image_t, virt-host-validate passes.Met. Timezone still EST.
1 NetworksBoth lab networks active. Both block policies present. default NAT inactive.Met on 2026-12-05.
2 SpawnCore guests answer SSH. New guests boot with the SSH drop-in.Guests exist. Drop-in is not in the spawn script.
3 RepoAnsible ping, both repomd.xml served, SELinux enforcing.Met for the 2026-12-04 snapshot. Confirm lb02 in the controller's own inventory.
4 IdentityHBAC and the one sudo command work. sudo search base is pinned.HBAC met. Search base not set.
5 DeliveryVIP alternates. Peer is held when the canary body is wrong. VRRP is peer-scoped.VIP alternates. VRRP is peer-scoped. Script security is not enabled. The peer-hold drill was not rerun.
6 Image modeRegistry is host-network and source-filtered. bootc switch and rollback rehearsed. RHEL 7 stays off on the air gap.Source filter verified. Guest is v1 and no longer offers password SSH. RHEL 7 is shut off. Switch and rollback were not repeated after the rebuild.
7 HA extrasPostgreSQL accepts only the webs. mon01 has their archives. db01 and mon01 are enrolled.Not done. Loopback PostgreSQL matches the later hardening chapter. Central PCP is not required by the current chapter 07 text.
8 Audit VMRead succeeds and write fails. firewalld is up. Cockpit is not listening.Met on 2026-12-05. firewalld active, Cockpit closed, SSH drop-in effective.