fix: mariadb.socket is masked, so 3306 is not on the uplink (#29) #30
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/keel-mariadb!30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/mariadb-socket-uplink"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #29.
Problem
Debian's
mariadb.sockethasListenStream=3306, which systemd binds as[::]:3306. Debian's package does not enable it. Butpct createof Proxmox VE removes/etc/machine-id, so the first start of a container is the first boot of systemd. On a first boot, systemd enables all units that no preset disables. With the socket active, mariadbd gets its listener from systemd andbind-addresshas no effect. On the pair test nodes, 3306 answered on the public uplink (finding B3, Keel-Linux/handbook#60). The manifest saysexpose: mesh.Change
conf.d/maindisables and masksmariadb.socketandmariadb-extra.socketin the image. Then it runsbin/keel-socket-wildcard / 3306, which stops the build when a socket unit of the tree can listen on a wildcard address for 3306 and is not masked. The Makefile copies the check into the tree, likebin/keel-project-packages.keel-mariadb0.1.1 ships/usr/lib/systemd/system-preset/20-keel-mariadb.preset(disable both units at a first boot). Its postinst masks both withdeb-systemd-helper, for a machine whose first boot already ran. It does not restart the server. Its postrm removes these masks on purge.pct createdoes (no machine id, the00-pve.preset). After the first boot, step 7 makes sure that no socket holds 3306 on a wildcard address and that the node address does not answer on 3306 from the host.appliancejob moves topackages.yml, after the package build, and gives the package to the boot (package_artifact). The job id staysappliance, so the required checkappliance / boot-published-layerkeeps its name. The gate boots the published layer, upgraded, with the package of this branch. The mask ofconf.d/maintakes effect in the gate when a layer built from this branch is published.evidence/2026-10-09-mariadb-socket.md: the mitigation on CT 9003 and CT 9004, with commands and outputs.Tests
tests/socket-wildcard.bats(14 tests): the build check on scratch trees.tests/boot-test.bats(12 new tests):bt_pve_create,bt_wildcard_listeners,bt_uplink_verdict.tests/package.bats(5 new tests): the preset, and the maintainer scripts withdeb-systemd-helperstubbed.The first commit has only the tests, and they failed (run 37864180295, run 37864180388).
The second commit makes them pass. In the gate (run 37864884481), each node had a first boot of systemd:
sshd-keygen.serviceran, which runs only on a first boot. Both socket units weremasked, 3306 listened only on127.0.0.1and[::1], and the host could not connect to 3306 on the node address. The replication phase passed on 2 nodes.After merge