Skip to main content

Security model

MakeIntelligent is built for one plant at a time. Process data stays in the plant, every change by AI needs a person, and every connection between parts is authenticated. This page describes the model and gives you a hardening checklist.

Principles​

  • Plant-local data. One factory is one plant stack: one Console, one database, one historian. Process samples stay in the plant. A fleet (several plants) reports health and inventory only, never process values, machine names or tag names. See Fleet.
  • People decide, AI proposes. No assistant, rule engine or API key writes to a device without the rules on Approvals and safe write. API keys cannot write at all.
  • Least privilege. Roles, scoped access, agent credential ceilings and API key scopes. See Users and roles.
  • Egress control. Governance decides what may leave the plant, and fails closed. See Governance.
  • Evidence. Hash-chained audit log, MCP audit and proposal audit. See Audit trail.

Secrets and the master key​

The Console seals secrets stored in its database: broker passwords, tokens and private keys. It uses AES-256-GCM with a master key.

SettingMeaning
MI_MASTER_KEY or MI_MASTER_KEY_FILEThe master key. At least 32 characters. Required unless plaintext is explicitly allowed.
MI_MASTER_KEY_PREVIOUS or _FILEThe previous key, used to rotate to a new one.
MI_ALLOW_PLAINTEXT_SECRETSLab only. Stores secrets unencrypted.
  • Settings → Profile shows "Secrets at rest": encrypted with AES-256-GCM, or PLAINTEXT. Treat PLAINTEXT as not ready for production.
  • With a missing, short or wrong key the Console reports MI-1011. Do not lose the key: stored secrets cannot be opened without it. Back it up separately from the database.
  • The master key also signs the audit chain ("sealed") and protects the fleet identity.
  • Secrets you enter in the UI (bind passwords, client secrets, SMTP passwords) are write-only: the UI never shows them again, and a blank field keeps the stored value.
  • Configuration export leaves secrets out unless you tick "Include secrets". Handle such files like passwords.
  • User passwords are hashed with argon2id. API keys and agent credentials are stored only as hashes.
  • The JWT signing secret MI_AUTH_JWT_SECRET (at least 16 characters, use a long random value) can be given as a file with MI_AUTH_JWT_SECRET_FILE.

Prefer _FILE variants for secrets so they do not appear in process listings or compose files.

TLS for the Console​

By default the Console serves plain HTTP on :8080. For production serve it over HTTPS.

VariableMeaning
MI_CONSOLE_TLS_CERT_FILE, MI_CONSOLE_TLS_KEY_FILETurn on HTTPS. Set both. A missing or mismatched file gives MI-1010.
MI_CONSOLE_HTTP_REDIRECT_ADDRESSWith TLS: auto starts an HTTP redirector on :8080 unless the main port is 8080. off disables it.
MI_TRUST_PROXYTrust X-Forwarded-For, X-Real-IP and X-Forwarded-Proto when a reverse proxy terminates TLS. Turn it on only behind a proxy you control.

Settings → Profile shows the transport: HTTPS, or HTTP only, and the HTTP redirect state.

caution

Over plain HTTP, passwords, session tokens and MCP secrets cross the network in the clear. Cloud assistants will not connect to an HTTP address.

mTLS​

Setting MI_CONSOLE_TLS_CLIENT_CA_FILE makes the API require client certificates (mutual TLS). Runtimes that call a TLS Console use MI_CONSOLE_CLIENT_CERT_FILE, MI_CONSOLE_CLIENT_KEY_FILE and MI_CONSOLE_CLIENT_CA_FILE. MI_CONSOLE_CLIENT_INSECURE_SKIP_VERIFY exists for labs only. Browser users sign in with a password or SSO; if you turn on mTLS for the whole port, browsers need a certificate too, so most plants use mTLS only on the runtime path described next.

Runtime certificates (enrolled runtimes)​

Remote Site Runtimes (the mii-runtime service on Windows and Linux, or the Docker image) enroll once and then send data outbound to mi-ingest over mutual TLS. They open no inbound port.

  1. The Console issues a one-time enrollment token (mi_enroll_...). The Console stores only its hash.
  2. The runtime enrolls with mii-runtime enroll --url <console> --token <token>. It creates an ECDSA P-256 key (key.pem) that never leaves the host, and receives a certificate whose common name is the runtime id.
  3. The runtime sends data to mi-ingest (port 8443, TLS with a required client certificate). The runtime id comes from the certificate, never from a header.
  4. The certificate lives 90 days (MI_RUNTIME_CERT_DAYS on the Console). The runtime renews it automatically after two thirds of its life, with a new key. The renewal needs the runtime token and a proof signed by the current certificate key.
  5. You can revoke a certificate in the Console (reasons operator, superseded, runtime_deleted). mi-ingest drops it within 5 seconds by default (MI_INGEST_REVOCATION_POLL). Deleting a runtime revokes its certificates.

The identity files are in the runtime's certs folder: identity.json, key.pem, cert.pem, ca.pem, optional server-ca.pem and runtime.token. Protect that folder with file permissions. If the gateway certificate does not come from a public certificate authority, give the runtime the CA (the Console hands out MI_INGEST_SERVER_CA_FILE, or set MI_INGEST_SERVER_CA on the runtime).

The mi-ingest admin listener (:9464, plain HTTP with /healthz, /readyz, /metrics) must stay on the internal network and never be published.

Network exposure​

ComponentPortExposure
Console and UI8080 (or your TLS port)The only port users need. Publish to the plant network, or through a reverse proxy.
mi-db (PostgreSQL)5432Internal only; never published in the plant stack.
mi-tsdbinternalInternal only.
Site Runtime local API8081Internal; no host port in the plant stack.
mi-ingest8443 (TLS, client certificate)Reachable from enrolled runtimes only.
mi-agent8095Reached through the Console's ingress path /agent/v1/*.
Alert webhooksoutboundLoopback targets are blocked unless MI_ALERT_WEBHOOK_ALLOW_LOOPBACK is set.

For mii Lite: only the Console port 8080 is opened by the installer. The Lite image and package can also offer a read-only public MQTT listener (port 1883) and a read-only PostgreSQL role on port 5433. The Docker image turns both on by default; set MI_LITE_MQTT_PUBLIC_LISTEN and MI_LITE_PG_PUBLIC to off to close them. See Lite on Docker.

Business-system connectors can be restricted with MI_SOR_ALLOW_HTTP, MI_SOR_ALLOW_NETWORKS, MI_SOR_DENY_NETWORKS and MI_SOR_CSV_DIRS.

Metrics endpoint​

/metrics carries operational data. Without any setting it is served on the UI port without login. Protect it:

  • MI_METRICS_ADDRESS runs a separate listener for /metrics, /ready and /health.
  • MI_METRICS_TOKEN (at least 16 characters) requires a bearer token.
  • MI_METRICS_PUBLIC=false (default) keeps metrics off the UI port once an address is set.

AI and API access​

  • MCP uses per-assistant credentials with a ceiling, rate limits (600 messages, 120 calls and 10 proposals per credential per minute) and a kill switch. See MCP server.
  • Plant text in tool results is marked untrusted, so instructions hidden in a tag name cannot steer an assistant by themselves. A person still reviews every proposal.
  • The Agent calls a model server you run in the plant. See LLM connections.

Hardening checklist​

  1. Serve the Console over HTTPS with a certificate your users trust.
  2. Set MI_MASTER_KEY (32 or more random characters) and back it up apart from the database. Confirm Secrets at rest says encrypted.
  3. Set a long random MI_AUTH_JWT_SECRET. Never set MI_AUTH_DISABLED in production.
  4. Replace the first-login administrator password. Remove MI_ADMIN_PASSWORD from compose files and shell history.
  5. Give people the least role that does the job. Use scoped access for line staff.
  6. Keep MI_ALLOW_PLAINTEXT_SECRETS unset.
  7. Use SSO or LDAP if you have a directory, and keep one local break-glass administrator. Do not use Skip TLS verify.
  8. Keep PostgreSQL and the historian off the plant network. Close the Lite read-only MQTT and PostgreSQL ports unless you use them.
  9. Protect /metrics with MI_METRICS_TOKEN or a separate listener.
  10. Classify data in Governance and test with an API key or assistant that denied values show withheld.
  11. Create one agent credential per assistant with the lowest ceiling. Revoke unused credentials.
  12. Use API keys with a short validity and a path limit. Rotate with a grace period.
  13. Set MI_AUDIT_RETENTION_DAYS to match your policy, and store the audit head hash outside the Console after each audit.
  14. Back up the configuration and the database regularly, and test a restore. See Backup and restore.
  15. Turn on safe write (MI_SAFE_WRITE=tag or required) and set limits on every writable tag. See Approvals and safe write.
  16. Enrolled runtimes: revoke certificates of decommissioned hosts, and watch for cert_revoked in runtime status.
  17. Run the Console as a non-root user. The images use user mii (uid 10001).

What is not covered​

  • There is no multi-factor authentication in the Console, and SAML is not implemented. Use OIDC SSO and enforce MFA in the identity provider.
  • Policies for approvals do not cover values that people with write rights write directly, or the runtime's own REST and MQTT write interfaces. Restrict those by role and network.
  • A person can approve a bad proposal. Use the two-person rule and approval policies for risky actions.