Loading the documentation…

Security

The DataMind Installer publishes one port on the host, and its secrets sit in files on that host. This page covers what anyone can reach, how to restrict the port to your administrators, and which files to protect.

What the host publishes

WhatWhere it is reachable
The Installer's screens and APIPort 8000, on every host interface, over HTTP. Put HTTPS in front as TLS and certificates describes
The Installer's database containerNot published. Reachable from the Installer's containers only
The Installer on the shared Docker networkThe Installer's backend container, port 8000, for DataMind OS
DataMind OSThe ports its own Compose file publishes. See System requirements

Roles are on Users. Secret files and what each protects are on What lives on the host.

What answers without a login

Almost every call to the Installer needs a signed-in account. Four things answer without one, because they lead up to a session or keep the host checkable:

EndpointWhy it is open
GET /api/healthLets a proxy, a monitoring check or an operator confirm the Installer and its database are up, with no session. It answers {"status":"ok","db":"up"}, or HTTP 503 Database connection failed when the database is unreachable; Health, monitoring and logs covers a failed check
POST /api/auth/login, POST /api/auth/refresh, POST /api/auth/logoutSigning in, renewing the session and signing out run before, during and after a session, so they cannot ask for one. Rate-limit the sign-in call in your proxy (TLS and certificates covers the proxy rules); the session and cookie rules are on Sign in, sessions and account
GET /api/user/existsThe first visit asks whether any account exists; the answer decides between the registration form and the sign-in form
POST /api/user/register/initialCreates the first administrator. It works only while no account exists, and refuses afterwards with Initial registration is not allowed once a user exists.

Restrict the port

Docker routes published ports through its own nat rules, ahead of ufw and firewalld INPUT rules. Filter the port in the DOCKER-USER chain. Insert two rules: drop traffic to the port, then allow your administration network above it. Replace 203.0.113.0/24 with your administrators' subnet and eth0 with the host's external interface.

bash
sudo iptables -I DOCKER-USER -i eth0 -p tcp -m conntrack --ctorigdstport 8000 --ctdir ORIGINAL -j DROP
sudo iptables -I DOCKER-USER -i eth0 -p tcp -m conntrack --ctorigdstport 8000 --ctdir ORIGINAL -s 203.0.113.0/24 -j ACCEPT

Match with --ctorigdstport, not --dport: Docker has already rewritten the destination when the packet reaches DOCKER-USER. Save the rules with your distribution's iptables tooling so they survive a reboot. On a host with IPv6 enabled, add the same rules with ip6tables.

Check it worked. From a machine outside the allowed subnet:

bash
curl -sS --max-time 5 http://<host>:8000/api/health

The request times out. From an allowed machine it returns {"status":"ok","db":"up"}.

Protect the deployment's environment file

deployment/.env holds every value DataMind OS runs with, including the values DataMind OS needs to reach the Installer and, with a DataMind Platform API key, that key as AI_API_KEY. The Installer's own .env can hold the key as well. Make both readable by root only. Run these in the install directory:

bash
sudo chown root:root deployment/.env
sudo chmod 600 deployment/.env
[ -f .env ] && sudo chmod 600 .env

The Installer runs as root, so it still reads and rewrites the file, and a rewrite keeps the mode. Run the two commands again after you restore or recreate the file.

Check it worked.

bash
stat -c '%a %U' deployment/.env
text
600 root

Questions, answered

Is anything on the Installer reachable without signing in?

Yes, four things: the health probe, the sign-in endpoints, the first-visit check and first-admin registration. They are listed with their endpoints in What answers without a login. Everything else needs a session.

Why should I restrict the port before the first visit?

Until an account exists, anyone who can reach the port can create the first administrator. The window closes by itself once the first account exists, so apply Restrict the port first and create the administrator straight after the install.

Is HTTPS enough, or do I still need to restrict the port?

No. HTTPS (TLS and certificates) encrypts the connection; it does not decide who may open the Installer. Restrict the port as Restrict the port shows, or anyone who can reach it can use the open surfaces.

Will restricting the port cut DataMind OS off from the Installer?

No. DataMind OS reaches the Installer container-to-container over the shared Docker network, not through the port published on the host's external interface, so the rules do not affect it.

Why does our ufw rule not block port 8000?

Docker routes published ports before ufw sees them. Add the rule to the DOCKER-USER chain, as Restrict the port shows.

Will chmod 600 stop the Installer from updating deployment/.env?

No. The Installer runs as root and rewrites the file on every save, install and update, and a rewrite keeps the mode. Run the commands again after you restore or recreate the file.

Where do Installer accounts live?

In the Installer's own database. Admins manage them on Users.