Allowed host names
When FarWatch refuses a host name with 421, which names are allowed without setup, and how to add more.
When this applies
An install with sign-in off, called open access, answers only to host names it knows. A request whose Host header is anything else gets a 421 answer with the error host_not_allowed.
This closes DNS rebinding, where a page on another domain points its name at this machine and reads the API as if it were the same site. The same check covers the first-run licence writes on an install that has no account yet.
With sign-in on, the check is not enforced. Callers with a valid API key, the /health check and demo mode are exempt.
Names allowed without any setting
- IP addresses. The server's own IP address always works.
- localhost.
- The machine's own host name, its short name, and its full name as the machine resolves it.
- The host of the base URL saved in the icc_base_url setting.
The machine's DNS domain is not allowed automatically, because a domain on a shared DNS hosting service is shared with strangers.
Add a name
Add every other name, such as the public name a reverse proxy uses, in one of three ways.
Global Settings > Features > Allowed host names. It applies within seconds. Only a global administrator can change it.
The command line, which is also the way back in when a browser is locked out:
icc-cli allow-host farwatch.example.comAdd --remove to drop a name, or run
icc-cli allow-host --listto print the saved names. It applies within seconds.The environment variable ICC_ALLOWED_HOSTS, which needs a service restart.
Each list takes names separated by commas, spaces or new lines. A name matches exactly. To allow a whole domain, add an entry such as *.corp.example.com. It matches every name under corp.example.com but not corp.example.com itself. A wildcard over a public registry such as *.co.uk, or over a single label such as *.com, is refused.
With TRUST_PROXY set, every value in an X-Forwarded-Host header must be allowed as well as the Host header.
Running the command line tool
On Windows, run it from an elevated PowerShell:
& "C:\Program Files\ICC\node\node.exe" "C:\Program Files\ICC\backend\icc-cli.js" allow-host farwatch.example.comOn RHEL and Ubuntu:
sudo -u icc /opt/icc/node/bin/node /opt/icc/backend/icc-cli.js allow-host farwatch.example.comSee Command line reference for the other commands.