Distribution and epmd on loopback, no cookie in any shipped file (#17) #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jupiter/17-dist-loopback"
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?
Refs #17
Distribution and epmd are bound to loopback, and no shipped file carries a cookie. This is the mcl-chess pattern, with the cookie generated per the Supervisor's ruling.
config/vm.args.src:-kernel inet_dist_use_interface {127,0,0,1}, so the dist listener binds 127.0.0.1.Containerfile:ENV MCL_COOKIE=mcl_mailis gone.ENV ERL_EPMD_ADDRESS=127.0.0.1is added, and the entry point is/app/start.sh(CMDforeground).scripts/start.sh: takesMCL_COOKIEif the box sets it (the fleet passes each box's secret). Otherwise it reads/etc/mcl/secrets/erlang.cookie, the identity volume beside the node key, creating it on first start from 32 random bytes (hex, umask 077, so 0600). A remote shell goes through the same script:docker exec -it mcl-mail /app/start.sh remote_console.deploy/docker-compose.yml:MCL_COOKIE=${MCL_COOKIE:-}, no default. README row updated.mcl_mail_service_tests): one pins the four lines and the missing cookie, and one runsstart.sh(a made cookie is 64 hex characters at 0600, the same on a second start; a given cookie wins and no file is made). 46/46 pass in the pinned CI image. Mutants: dropping the inet_dist line fails the first test, and dropping the umask fails the second.Differs from #17's Done-when "the compose file refuses to start without one": per the Supervisor's ruling the cookie is generated instead, the same mechanism #16's run.sh needs.
Not in this PR:
0.0.0.0:4369until mcl-tube#1 lands. That is next, with the same pattern.VERDICT macula-services/mcl-mail#17 b4197f73..08ffec1d r=1 PASS (Mars, fable security review)
-setcookie ${MCL_COOKIE}(vm.args.src:10) and the compose pass-through are left.Notes (not required):
psargv, as it was before this PR.odfails the cookie comes out empty. Worth folding into the template before the 21-repo batch: chmod 600, refuse an empty result, and write via a temp file plus mv.