fix(deploy): restrict firewall defaults, remove hardcoded Grafana password, bound Prometheus retention#9
Open
wpank wants to merge 1 commit into
Conversation
…sword, bound Prometheus retention - Change trusted_ips default from 0.0.0.0/0 to 127.0.0.1/32 so RPC, metrics, Prometheus, and Grafana are not exposed to the internet out of the box. Add a preflight assertion in the firewall role that rejects 0.0.0.0/0 to prevent accidental re-introduction. (Closes #181) - Remove the hardcoded grafana_admin_password: admin from group_vars. The observe role now fails early if the password is unset, shorter than 8 characters, or still "admin". The docker-compose Grafana service uses a :? parameter expansion so compose itself also refuses to start without an explicit password. (Closes #182) - Add --storage.tsdb.retention.time=15d and --storage.tsdb.retention.size=10GB to the Prometheus command so TSDB cannot grow unbounded on long-running devnets. (Closes #186) - Add Alertmanager service (docker-compose), alertmanager.yml config with placeholder webhook receivers, wire Prometheus alerting section to forward firing alerts, and add Alertmanager health check to the observe Ansible role. (Closes #187) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Summary
#181 -- Firewall trusted_ips open to internet: Changed
trusted_ipsdefault from0.0.0.0/0to127.0.0.1/32(localhost-only). Added a preflight Ansible assertion in the firewall role that fails the play if0.0.0.0/0is ever configured, preventing accidental re-introduction.#182 -- Grafana admin password hardcoded as "admin": Removed the
grafana_admin_password: admindefault fromgroup_vars/devnet.yml. The observe role now fails early if the password is undefined, shorter than 8 characters, or still"admin". The docker-compose Grafana service uses${GF_SECURITY_ADMIN_PASSWORD:?...}so compose itself refuses to start without an explicit password.#186 -- Prometheus retention unbounded: Added
--storage.tsdb.retention.time=15dand--storage.tsdb.retention.size=10GBflags to the Prometheus command in docker-compose, preventing unbounded disk growth on long-running devnets.#187 -- No alerting destination configured: Added an Alertmanager service to docker-compose (hardened with read_only, no-new-privileges, cap_drop ALL), created
docker/config/alertmanager.ymlwith placeholder webhook receivers and inhibition rules, wired Prometheusalertingconfig to forward to Alertmanager, and added an Alertmanager health check to the observe Ansible role.Closes #181, #182, #186, #187.
Test plan
ansible-playbook provision.ymlfails iftrusted_ipscontains0.0.0.0/0ansible-playbook observe.ymlfails withoutgrafana_admin_passwordor withadmindocker compose --profile observability configshows retention flags on Prometheusdocker compose --profile observability configshows alertmanager serviceGF_SECURITY_ADMIN_PASSWORDis required (compose errors without it)🤖 Generated with Claude Code