Security notes
What you protect
Section titled “What you protect”- The
.envfile. It holds the database passwords, the key that signs sign-in cookies, and the object store’s keys. Keep it readable only by you (chmod 600 .env). - The server. Open only ports 80, 443, and SSH. PostgreSQL, ClickHouse, and Garage have no open ports.
- The databases. Anyone who can read PostgreSQL can act as a signed-in user, because session tokens are stored there. Protect database access like the dashboard itself.
- Backups. They hold your users’ data. Copy them off the server, keep them private, and delete old ones.
- Secret keys. Each project’s secret key (
sk_…) belongs on your servers and in your CI’s secrets only. Never put it in a page, in client code, or in a commit.
| Key | Where it can go | If it leaks |
|---|---|---|
Public key (pk_…) |
In every page. It is not a secret. | Anyone can send browser events from pages on your allowed hostnames. Replace it in the project’s settings, then put the new snippet on your site. |
Secret key (sk_…) |
On your servers and in CI only | Replace it in the project’s settings at once. Servers with the old key are refused, and user IDs signed with it no longer count. |
The public key only sends events. It cannot read data, export data, or change settings.
Accounts and links
Section titled “Accounts and links”- Nobody can sign up. The owner comes from the setup link. Other users come by invitation.
- Passwords have at least 12 characters. They are stored as scrypt hashes.
- Sign-in attempts are rate-limited for each client address.
- Sign-in cookies are
Secure,HttpOnly, andSameSite=Lax. A session lasts 7 days and renews while it is in use. Signing out ends the session at once. - Requests that change something must come from the instance’s own address.
- Setup, invitation, reset, and heatmap overlay links carry their token after
#. Browsers never send this part to a server, so it stays out of request logs. The instance stores only a hash of each token.
| Link | Works for |
|---|---|
Setup link (setup.mjs) |
1 hour, one time |
| Invitation link | 7 days, one time |
| Reset link from the dashboard | 24 hours, one time |
Reset link from reset-password.mjs |
1 hour, one time |
| Heatmap overlay link (Open on your site) | 5 minutes, one time. It gives the overlay a session of 30 minutes that reads only that project’s heatmap figures, and ends when its user signs out. See Heatmaps. |
Anyone who sees a link before it is used can use it. Send links by a private channel.
Visitors’ data
Section titled “Visitors’ data”- The instance never stores or logs visitors’ IP addresses.
- The tracker stores nothing on the visitor’s device.
- The tracker sends only the page’s origin, path, and UTM tags. The instance removes any other part of the query string and the fragment again.
- Anonymous visitor IDs change every day. The instance deletes the secret that makes them 25 hours after its day ends.
Requests the server makes
Section titled “Requests the server makes”Uptime checks and webhooks make requests from your server. By default, they cannot reach loopback, private, link-local, or other internal addresses, or cloud metadata services. The instance checks the address when you save a check or a webhook, and again on each request.
Add your server’s own public address to UPTIME_DENY_ADDRESSES. A check to that address on another port can otherwise reach a service that your cloud firewall closes only to the outside. See the configuration reference.
Headers on the dashboard
Section titled “Headers on the dashboard”The dashboard’s pages carry:
- A Content Security Policy that allows only the instance’s own scripts, styles, fonts, and requests.
frame-ancestors 'none'andX-Frame-Options: DENY, so other sites cannot frame it.Referrer-Policy: same-origin.Strict-Transport-Securityfor one year, on an HTTPS address.
The tracker script and the collection endpoints do not carry the dashboard’s policy, because sites on other origins use them.