The task. The web monitor runs on every node whether anyone uses it or not; this setup leaves access to it to the Hub — and nobody else.
What it is made of:
The parts have different scopes. All four are node-level.
How they interact. The address list and the key are two independent paths to full access: the list does not filter the key holder, so handling the key matters as much as filtering addresses. Transport protection and forged-request protection close the two ways a key leaks or gets misused.
Four lines:
| Line | Default | What to set |
|---|---|---|
| http-access | closed to everyone | admin only for 127.0.0.1, no more than needed for the rest |
| http-api-key | none | a key per node; to rotate, add the new one, then remove the old one |
| http-redirect-to-https | true | leave true |
| http-csrf-protection | true | leave true |
http-access 127.0.0.1 admin http-access 198.51.100.7 monitor http-api-key 5f6e7e426949e3a5e4ec38e747e71963http-redirect-to-https true
curl -s -o /dev/null -w '%{http_code}\n' 'http://127.0.0.1:8080/status?format=json'