Harden installer ops, localhost beacon APIs, and digest pins - #2
Merged
Conversation
Fix restart.sh so it actually recreates containers, persist ./update.sh --latest into .env, and make install.sh idempotent (ignore our own ports, validate existing JWTs, wait for Docker, verify containers). Bind beacon HTTP/gRPC to localhost by default, disable geth IPC, pin client images by digest, and tighten UFW/user/port handling plus tests. Co-authored-by: David Feder <DavidFeder@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the repo bug check: operational fixes, a few security defaults that do not change LAN wallet RPC (
8545/8546still bind0.0.0.0), and tighter tests/CI.Behavior that stays the same
0.0.0.0:8545/8546) for MetaMask / Internet Money on the home network.127.0.0.1:8551.v3.3.0/ Prysm-Pulsev2.3.0tags.Fixes
restart.shactually restarts. It now runsdocker compose up -d --force-recreate --remove-orphans. Plainup -dwas a no-op when the config hash had not changed../update.sh --lateststicks. It writesGETH_IMAGE/BEACON_IMAGEinto.envso a later./restart.shor./start.shdoes not silently roll back to the digest pin../install.shno longer treats this stack’s own listeners as foreign port conflicts. Existingjwt.hexis validated (64 hex, newline stripped or backed up). Afterup -d, both containers must still be running or install fails.docker.io/containerdpackages are removed before Docker CE, then the script waits for the daemon.PULSE_ALLOW_PORT_CONFLICTS=1covers non-interactive port conflicts (same pattern asPULSE_ALLOW_PUBLIC_RPC=1).ufw allowis no longer reported as success.id -un/SUDO_USERinstead of$USER, andsudo lsso an unreadable datadir cannot look empty and trigger a recursivechownof multi-TB chain data.ss -H -ltn sport = :portinstead of greppingsscolumns.Hardening (intentional default changes)
127.0.0.1. MetaMask does not need them. SetBEACON_HTTP_HOST=0.0.0.0andBEACON_GRPC_HOST=0.0.0.0in.envif you want them on the LAN.--ipcdisableso admin APIs are not on/blockchain/execution/geth.ipc.:latest):go-pulse:v3.3.0@sha256:d2f5959…beacon-chain:v2.3.0@sha256:31b4401…nofileulimit 65535.GETH_CACHE(default 1024).Docs / status
./status.shprints the wallet RPC URL using the default-route source address (nothostname -I/ docker0).10.0.0.0/8, checkpoint weak-subjectivity note, how to expose beacon APIs.Tests / CI
tests/test_common.sh(dotenv, JWT, CGNAT, upsert, installer contracts).--ipcdisable, digest pins.tests/test_image_pins.shchecks compose ↔common.shpins and that GitLab’sv3.3.0/v2.3.0tags still match those digests (:latestdrift is a note, not a failure).How to verify
bash tests/test_common.sh bash tests/test_beacon_flags.sh bash tests/test_image_pins.sh shellcheck -x common.sh install.sh start.sh stop.sh restart.sh logs.sh update.sh status.sh tests/*.shOn a real node (not run in this environment):
./install.shtwice should refresh the stack instead of aborting on ports;./restart.shshould bounce containers; beacon3500/4000should listen on localhost only.