Fix: Harden RPC bounds, monitoring credentials, and image fallbacks - #90
Open
mozluk wants to merge 5 commits into
Open
Fix: Harden RPC bounds, monitoring credentials, and image fallbacks#90mozluk wants to merge 5 commits into
mozluk wants to merge 5 commits into
Conversation
### Description
This PR addresses multiple high- and medium-severity findings identified during the workspace-wide security and reliability audit regarding overly permissive `op-geth` defaults, unsecured monitoring tools, and mutable sidecar fallback tags[cite: 53].
### Key Changes
* **Safe RPC Limits & Loopback Enforcement (`docker-compose.yml`, `scripts/start-op-geth.sh`, `.env.example`):**
* Host-published endpoints for HTTP, WebSocket, Prometheus, Grafana, and InfluxDB are now strictly bound to `127.0.0.1` by default to minimize attack surface[cite: 53, 50, 53].
* The permissive `op-geth` defaults have been tightened: the `debug` namespace is removed from the default HTTP API (now limited to `eth,net,web3`), and CORS/virtual host policies have restrictive defaults[cite: 53, 55]. These can only be broadened deliberately via `.env` variables[cite: 50, 55].
* **Monitoring Security & Credential Provisioning (`docker-compose.yml`, `docker/grafana/provisioning/datasources/all.yml`, `.env.example`):**
* InfluxDB HTTP authentication is now enabled[cite: 53, 53].
* Separated administrative, write, and read accounts are now mandatory for InfluxDB[cite: 50, 53].
* Grafana is securely provisioned to connect to InfluxDB using exclusively the least-privilege `read` account via environment variable expansion (`$INFLUXDB_READ_USER`), and the datasource is marked as non-editable[cite: 53, 54].
* Removed legacy tracked environment files (`envs/common/*.env`) that included insecure defaults. The `docker-compose.yml` file now forces a fail-closed behavior, requiring the operator to provide non-empty credentials in `.env` before starting[cite: 53].
* **Immutable Sidecar Versions (`docker-compose.yml`, `.env.example`):**
* Removed the mutable `latest` fallback and floating version tags for monitoring sidecars[cite: 53].
* Compose now requires explicitly reviewed, immutable image tags supplied through `IMAGE_TAG__HEALTHCHECK`, `IMAGE_TAG__PROMETHEUS`, `IMAGE_TAG__GRAFANA`, and `IMAGE_TAG__INFLUXDB` before the stack can boot[cite: 50, 53].
grafana,influxdb deleted
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.
Description
This PR addresses multiple high- and medium-severity findings identified during the workspace-wide security and reliability audit regarding overly permissive
op-gethdefaults, unsecured monitoring tools, and mutable sidecar fallback tags[cite: 53].Key Changes
docker-compose.yml,scripts/start-op-geth.sh,.env.example):127.0.0.1by default to minimize attack surface[cite: 53, 50, 53].op-gethdefaults have been tightened: thedebugnamespace is removed from the default HTTP API (now limited toeth,net,web3), and CORS/virtual host policies have restrictive defaults[cite: 53, 55]. These can only be broadened deliberately via.envvariables[cite: 50, 55].docker-compose.yml,docker/grafana/provisioning/datasources/all.yml,.env.example):readaccount via environment variable expansion ($INFLUXDB_READ_USER), and the datasource is marked as non-editable[cite: 53, 54].envs/common/*.env) that included insecure defaults. Thedocker-compose.ymlfile now forces a fail-closed behavior, requiring the operator to provide non-empty credentials in.envbefore starting[cite: 53].docker-compose.yml,.env.example):latestfallback and floating version tags for monitoring sidecars[cite: 53].IMAGE_TAG__HEALTHCHECK,IMAGE_TAG__PROMETHEUS,IMAGE_TAG__GRAFANA, andIMAGE_TAG__INFLUXDBbefore the stack can boot[cite: 50, 53].