Security
A checklist to harden an Antimatter server: what to expose, the limits and privacy settings to review, the outside services the server contacts, and how to report a security problem.
What to expose
| Port | Service | Exposure |
|---|---|---|
| 443/tcp, 443/udp, 80/tcp | Your HTTPS proxy (Caddy or nginx) | Public: this is how people reach Antimatter. |
| 8443/udp and 8443/tcp | Call media | Public, if people use calls from outside your network. |
| 8065/tcp | Antimatter's web server | Only to the proxy: publish it on 127.0.0.1 (HTTP_PORT=127.0.0.1:8065). |
| 8067/tcp | Metrics | Private network only, when enabled. No sign-in. |
| 8074/tcp and udp | Cluster gossip | Between cluster nodes only. |
| 5432, 9000, 8080, 8066 | PostgreSQL, file storage, GIF service, push proxy | Never. The compose files keep them on internal networks with no published port. |
The site's compose file also runs every container with no-new-privileges, runs Antimatter as an unprivileged user on a distroless image, and runs the GIF service with a read-only file system. The database, the storage and the GIF service sit on a network without Internet access.
Checklist after installing
- Create the first administrator account before anyone else can reach the server (Installing).
- Serve Antimatter over HTTPS only, and set the site URL to the
https://address (Domain and HTTPS). - Keep
.env,config.jsonand TLS keys readable by root (or the server's user) only:chmod 600 .env. - Decide who can create accounts, keep Enable Open Server off unless the community is public, and turn on Require Email Verification once email works (Sign-in and accounts).
- Turn on multi-factor authentication, and enforce it for administrators' accounts at least, or use your identity provider's.
- Review the outside connections below, in particular the STUN server Calls uses by default.
- Before adding model connections, set the AI encryption key (
AM_AI_ENCRYPTION_KEY) and keep a copy apart from the database backups (AI). - Back up, and test a restore (Backups and upgrades).
- Keep the images or the packages up to date: security fixes arrive with new versions.
Rate limiting
The server can limit how many API requests each client makes. It is off by default. In System Console › Environment › Rate Limiting:
| Setting | Key | Default |
|---|---|---|
| Enable Rate Limiting | RateLimitSettings.Enable | off |
| Maximum Queries per Second | RateLimitSettings.PerSec | 10 |
| Maximum Burst Size | RateLimitSettings.MaxBurst | 100 |
| Memory Store Size | RateLimitSettings.MemoryStoreSize | 10000 clients tracked |
| Vary rate limit by remote address | RateLimitSettings.VaryByRemoteAddr | on |
| Vary rate limit by user | RateLimitSettings.VaryByUser | off |
| Vary rate limit by HTTP header | RateLimitSettings.VaryByHeader | empty |
Behind a proxy, limits by address only work if the server knows each client's address (ServiceSettings.TrustedProxyIPHeader and ServiceSettings.TrustedProxyIPs, see Client addresses behind a proxy). Otherwise every request seems to come from the proxy, and everyone shares one limit. The same goes for IP filtering and for the addresses in audit logs.
Sign-in attempts are limited separately: Maximum Login Attempts (10) locks an account after that many failed passwords.
IP filtering
System Console › Site Configuration › IP Filtering limits access to the server by IP address, with allow and deny rules (an address or a CIDR range each). With Enable IP Filtering on, people whose address matches a deny rule, or no allow rule when there are allow rules, can't reach the server. The page refuses rules that would block your own address. Behind a proxy, set up client addresses first (Client addresses behind a proxy): otherwise every request seems to come from the proxy.
Uploads and file sharing
| Setting | Where | Default |
|---|---|---|
Maximum File Size (FileSettings.MaxFileSize) | Environment › File Storage | 100 MB. Keep the proxy's request size limit at least this. |
Maximum Payload Size (Bytes) (ServiceSettings.MaximumPayloadSizeBytes) | Environment › Web Server | 300000: the largest API request other than file uploads |
Allow File Sharing (FileSettings.EnableFileAttachments) | Site Configuration › File Sharing and Downloads | on |
| Allow File Uploads on Mobile, Allow File Downloads on Mobile | Site Configuration › File Sharing and Downloads | on |
Enable Public File Links (FileSettings.EnablePublicLink) | Site Configuration › Public Links | off: when on, people can share a file with a link that works without signing in |
Enable SVGs (ServiceSettings.EnableSVGs) | Site Configuration › Posts | off on a new server: when on, SVG images are shown inline |
Enable file search (ServiceSettings.EnableFileSearch) | Site Configuration › File Sharing and Downloads | on: off hides file search from the Files tab of search results, in both the classic web app and Fusion |
Enable file indexing (ElasticsearchSettings.EnableFileIndexing) | Environment › Elasticsearch, with Elasticsearch or OpenSearch set up | on: off stops indexing new or changed files, but files indexed before stay searchable |
Antimatter doesn't scan uploads for malware.
Privacy settings
In System Console › Site Configuration › Users and Teams:
| Setting | Key | Default | What it does |
|---|---|---|---|
| Show Email Address | PrivacySettings.ShowEmailAddress | on | Off, members' email addresses are hidden from everyone but administrators. Turn it off on public servers. |
| Show Full Name | PrivacySettings.ShowFullName | on | Off, full names are hidden and usernames shown instead. |
| Enable ignoring, blocking and message requests | PrivacySettings.EnableUserBlocking | on | See below. |
| Enable users to open Direct Message channels with | TeamSettings.RestrictDirectMessage | Any user on the Antimatter server | Or Any member of the team: only people who share a community. |
Ignoring, blocking and message requests
With Enable ignoring, blocking and message requests on (the default), people can ignore and block each other, and choose whether direct messages from people they don't know arrive normally, wait as message requests, or are refused outright (someone refused can't start a direct or group message with them, or write in one not yet accepted); each choice can differ per community, and the most restrictive of the communities people share wins. This suits public communities. In a workplace where colleagues must always be able to reach each other, turn it off (AM_PRIVACYSETTINGS_ENABLEUSERBLOCKING=false): none of these direct-message choices are enforced any more, but the lists and choices people made are kept, and apply again if you turn it back on. Which profile details each community's people see is enforced either way; system admins and the person themself always see everything.
Sessions and tokens
- Session lengths and idle timeout: see Sign-in and accounts. Shorter sessions mean a lost laptop or phone stays signed in for less time.
- Enable Personal Access Tokens (
ServiceSettings.EnableUserAccessTokens, off) lets people create API tokens; Maximum Personal Access Token Lifetime (days) limits them. Both are in System Console › Integrations › Integration Management. - To sign everyone out at once, for example after a suspected breach: Revoke All Sessions in System Console › User Management › Users.
- In Antimatter's interface, people are warned of a new sign-in to their own account while they are connected, and can disconnect it themselves (see Where you are signed in). System admins aren't told of other people's sign-ins.
- The Calendar app's private calendar feed link (see Mail and Calendar) is a capability: anyone who has it can read what its owner can see, so it ends up in your reverse proxy's access logs. Only its hash is stored on the server, so a leaked log entry alone doesn't expose it.
Connections to outside services
Antimatter contacts no service run by Mattermost, Inc. It sends no telemetry, crash reports or security update checks, and fetches no product notices. A configuration brought over from Mattermost that still names one of Mattermost's services (its push services, its app marketplace, its notices or its STUN server for calls) doesn't make the server contact them: those addresses are ignored.
The server and the apps connect to other outside services only for the features that need them, and to the services you configure:
| Feature | Contacts | By default |
|---|---|---|
| Calls: finding public addresses with STUN. The server and each person joining a call send a request, which shows the STUN server their IP address and port. | Cloudflare's public STUN server, stun.cloudflare.com | on, while the Calls app is enabled. To change it, see Calls. |
Link previews: the server fetches the pages linked in messages (Enable website link previews, ServiceSettings.EnableLinkPreviews) | the websites people link to | on. Turn off with AM_SERVICESETTINGS_ENABLELINKPREVIEWS=false. |
| Push notifications to the mobile app | your own push proxy (Push notifications) | off until you set its address |
The remote app marketplace (PluginSettings.EnableRemoteMarketplace) | the Marketplace URL you set | off, and no address |
| your SMTP server | the default server is localhost | |
| Model connections (rewrite, recaps, translation, read aloud, agents and apps), community admins' own model connections | the AI providers added in System Console › AI › Connections and agents or in a community's settings (AI) | none until someone adds one |
| Single sign-on, the AI chat app's AI services, speech-to-text and translation, outgoing webhooks, and apps such as Mail, Calendar, GitHub, GitLab or Jira | the services you configure | off until you configure them |
By default the server refuses to connect to private and loopback addresses for these (link previews, webhooks, apps, community model connections), so a message or an integration can't be used to reach your internal network. List the internal hosts it may reach in Allow untrusted internal connections to (ServiceSettings.AllowedUntrustedInternalConnections, in System Console › Environment › Developer); the site's compose file lists gifs there.
Reporting a vulnerability
Report security problems privately, as explained in the Antimatter security policy, not in public issues.