Distribution and epmd on loopback, no cookie in any shipped file (#1) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "jupiter/1-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 #1
Distribution and epmd are bound to loopback, and no shipped file carries a cookie. This is the same change as macula-services/mcl-mail PR 18 (mcl-mail#17), so every mcl-* service can copy one pattern.
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_tubeis 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:docker exec -it mcl-tube /app/start.sh remote_console.deploy/docker-compose.yml:MCL_COOKIE=${MCL_COOKIE:-}, no default.mcl_tube_service_tests): one pins the four lines and the missing cookie, and one runsstart.sh. 33/33 pass in the pinned CI image. The test code is the same as mcl-mail PR 18's, where dropping the inet_dist line or the umask turns a test red.On beam02 the box's shared epmd (
0.0.0.0:4369,[::]:4369) belongs to this container. With this change it moves to 127.0.0.1 for every BEAM service on the box.Not in this PR: the fleet's per-box cookie, and the
0.0.0.0:8493listener measured on beam02 (not dist).VERDICT macula-services/mcl-tube#1 0c8b0806..fa28309c r=1 PASS (Mars, fable security review). The same change as mcl-mail PR 18: the diffs differ only in Containerfile context, the issue number and the README row.
-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.Landed --no-ff at
1b3c77ebby Terra. --range private gate: no new private data (the new hits are only shorthand issue refs). Main already carries 46 tree hits of its own, worth a look before this repo goes public.Pull request closed