Auth Service (ticrypt-auth)
ticrypt-auth handles authentication, authorization, and user management, and supervises all other services.
/etc/ticrypt/ticrypt-auth.conf. All options are in the ticrypt.auth section.
Main Configuration Structure
| Parameter | Type | Required | Description |
|---|---|---|---|
mongodb | Section | ✅ | Database connection. See mongodb. |
users | Section | ✅ | User registration settings. See Users. |
sessions | Section | ✅ | Session management. See Sessions. |
mfa | Section | Multi-factor authentication. See MFA. | |
services | Section | ✅ | Service supervision. See Services. |
security.xss | Section | ✅ | XSS attack response. See XSS Security. |
mailboxes | Section | Mailbox feature toggle. See Mailboxes. | |
key-escrow | Section | Key escrow subsystem. See Key Escrow. | |
server-assisted-auth | Section | Split-credential hardening. See Split Credentials. | |
login-id-change | Section | Whether a Super-admin may change another user's login ID. See Login ID Change. | |
akka.remote.artery.canonical.hostname | See Akka | ||
akka.remote.artery.canonical.port | See Akka. Default 2552 |
Users
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
allow-self-registration | on, off | on | Allow users to register their own accounts, which stay inactive until an admin activates them | |
self-registration-token | String | ✅ | Token used to bootstrap the first user and, when self-registration is on, required from new users who register | |
self-registration-reason | String | "Account disabled pending administrator approval." | Message shown to users who log in before their account is activated | |
default-permissions | ArrString | ["@group", "@file", "@directory", "@session"] | Default permission set for new accounts. A value starting with @ names a group of permissions; @session is required to log in |
If self-registration is enabled, generate a random value for self-registration-token to prevent server spamming:
openssl rand -base64 32
Sessions
| Parameter | Type | Default | Description |
|---|---|---|---|
session-idle-ttl | Duration | 15 minutes | Maximum inactivity before a session is closed |
challenge-ttl | Duration | 10 minutes | How long a login challenge remains valid |
temporary-ttl | Duration | 10 minutes | How long a temporary session created by a signed message remains valid |
subsession-max-ttl | Duration | 30 minutes | Maximum lifetime of a subsession |
banned-permissions | ArrString | [] | Permissions stripped from all sessions, for example ["@mailbox"]. Uses the same syntax as default-permissions |
max-challenge-attempts-before-lock | Int | 5 | A user may request this many login challenges in a row without completing any. The next request locks the account |
Long durations (over 1 hour) for challenge-ttl and temporary-ttl can introduce security vulnerabilities. Keep these values short.
Services
ticrypt-auth supervises all other tiCrypt services, monitoring their health via periodic pings.
| Parameter | Type | Default | Description |
|---|---|---|---|
check-ping-frequency | Duration | 2 seconds | How often to check service health |
timeout | Duration | 20s | How long a service can go without answering before it is considered offline |
XSS Security
Controls the response to detected Cross-Site Scripting (XSS) attacks.
| Parameter | Type | Default | Description |
|---|---|---|---|
kill-session | Bool | true | Terminate the session on XSS detection |
lock-user | Bool | true | Lock the user account on XSS detection |
lock-user-reason | String | "Account locked due to suspected malicious activity" | Message shown to the locked user |
At minimum, kill-session should be true. Keeping lock-user at true is strongly recommended to prevent repeated attack attempts. The comment in the shipped ticrypt-auth.conf shows lock-user = false, but the line is commented out and the value in effect is true.
Mailboxes
The mailboxes feature provides an end-to-end encrypted data path from external users to tiCrypt users.
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | Bool | false | Enable the mailbox feature |
Key Escrow
The key escrow subsystem allows a user's private key to be cryptographically placed into escrow, requiring collaboration between multiple individuals to recover it. This supports compliance requirements such as court-ordered data access.
Configuration
The ticrypt.auth.key-escrow section:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
enabled | Bool | false | Enable the key escrow feature | |
min-keys | Int | 3 | Minimum number of escrow groups required before key enrollment | |
site-key-path | String | If enabled | Path to the signed site key file | |
previous-site-key-paths | ArrString | [] | Paths of the site keys this one replaced. Used only to decrypt data that was encrypted with an earlier site key |
Do not enable key escrow without a signed site key. New users will be unable to register.
How It Works
The key escrow system uses a chain of trust with three tiers:
Site Key The root key pair for the escrow subsystem. The public key is signed by a Tera Insights certificate embedded in the server software, establishing the chain of trust. The private site key signs certificates for administrative actions (adding/removing escrow users and groups). Keep the private site key on an air-gapped machine.
Escrow Users Identified by RSA key pairs, with public keys signed by the site key (or by another authorized escrow user). Escrow users have dedicated accounts separate from normal tiCrypt accounts. Escrow users should not be regular tiCrypt users.
Escrow Groups
Groups of escrow users that each receive one key part of the Recovery Key. All members of a group receive the same key part, providing redundancy. At least min-keys groups must exist before escrow enrollment is possible.
The Escrow Mechanism
When a tiCrypt administrator marks a user account as requiring escrow, the user's next login triggers a restricted session that performs the following:
- Pull escrow group information (group membership and public keys) from the server.
- Generate a separate AES-256 Recovery Key Part for each escrow group.
- Combine all key parts into a single AES-256 Recovery Key.
- Encrypt the user's private key with the Recovery Key. The Recovery Key is then discarded.
- Encrypt each group's key part with every member's public key.
- Send the encrypted private key and encrypted key parts to the server.
Recovery requires representatives from every escrow group to collaborate, each contributing their key part to reconstruct the Recovery Key.
Multi-Factor Authentication
MFA adds one or more additional authentication factors beyond the user's private key. See the MFA Setup page for the MFA server interface contract and integration patterns.
Configuration
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
token-salt | String | ✅ | Random salt for MFA tokens | |
num-factors-required | Int | 0 | Number of required factors. 0 disables MFA. | |
required-for-registration | Bool | true | Whether new users must complete MFA to register. Applies only when num-factors-required is greater than 0. | |
disable-case-sensitivity | Bool | false | When true, the email in an MFA certificate is lowercased before the user is looked up, so a certificate whose email differs from the login ID only by case is accepted when the login ID is lowercase. | |
enabled-factors | ArrString | [] | IDs of active factors from the factors section | |
default-token-ttl | Duration | 2 days | Default MFA token validity period | |
default-cert-ttl | Duration | 30 minutes | Default MFA certificate lifetime | |
factors | Section | Factor definitions (see below) |
Factor Definition
Each factor in the factors section defines a sub-section:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
public-key | String | ✅ | Path to the factor's public key file | |
url | String | ✅ | URL of the factor's authentication page. It must not contain a query string: the frontend appends ?port=<port> to it. | |
token-ttl | Duration | MFA default | How long the MFA token is valid | |
cert-ttl | Duration | MFA default | Lifetime of the MFA certificate |
How It Works
When a user logs in with MFA enabled:
- The server responds with a list of factor URLs the user must authenticate with.
- The tiCrypt frontend opens the factor URLs one at a time, in the order listed, in a new window, with
?port=<port>appended. - The factor's web page performs authentication and redirects the window to
mfa.htmlon that port, passing a signed certificate in themsgquery parameter.mfa.htmlhands the certificate to the frontend and closes. - The frontend sends each certificate to the server, which checks it and returns an MFA token, until it has
num-factors-requiredtokens. - The frontend submits the MFA tokens with the standard login challenge.
- The server validates all tokens and grants a session only if all factors pass.
For the certificate format and the hand-off page, see MFA Setup.
Signature Algorithms
The signature algorithm string format is: ALGO_NAME[#param1=value[,param2=value,...]]
RSA-PSS-SHA256 (Recommended) RSA with Probabilistic Signature Scheme and SHA-256. Built-in salt and improved padding over PKCS1.
| Parameter | Type | Default | Description |
|---|---|---|---|
saltLen | Int | 4 | Salt length in bytes. Recommended: 32 (SHA-256 hash size). |
Always specify saltLen=32 when using RSA-PSS-SHA256. The default of 4 is kept for compatibility but is weaker than recommended.
RSA-PKCS1-SHA256 RSA with PKCS1 v1.5 and SHA-256. Use only when PSS signatures are unavailable. Include your own salt in the payload, as the algorithm does not generate one.
RSA-PKCS1-SHA1 (Deprecated) RSA with PKCS1 v1.5 and SHA-1. Present only for legacy compatibility. SHA-1 has known weaknesses and this algorithm will be removed in a future release.
Split Credentials
Split credentials harden user private keys against offline attacks. If a user's device containing their encrypted private key is stolen, split credentials prevent decryption without also compromising the server or the MFA factor.
Split credentials require MFA to be enabled with at least one active factor. The feature automatically disables itself if no additional authentication factors are configured.
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | Bool | false | Enable split credentials |
required | Bool | true | Require split credentials for new users |
Keep required at true in nearly all cases. Only set to false if some users cannot use additional authentication factors.
How It Works
Decrypting a tiCrypt private key requires four pieces of information:
- The AES-encrypted private key data
- The AES Initialization Vector (IV)
- The user's password
- The password salt
Normally, the IV and salt are stored alongside the encrypted key in the private key file. With split credentials enabled, the IV and salt are stored on the server instead and only returned after successful MFA verification.
This means neither the client nor the server alone has enough information to recover the private key. An attacker who steals the key file must also defeat the MFA factor or compromise the server.
Split credentials only apply to users who register (or change their password) after the feature is enabled. Existing users can enroll by changing their private key password, which triggers the frontend to store the IV and salt on the server.
Login ID Change
A login ID change replaces the login ID (usually an email address) that a user signs in with, while the account keeps its user ID, files, drives, memberships and public key. Only a Super-admin can change another user's login ID, and only while the login-id-change section enables it. Users cannot change their own login ID.
Use a login ID change only when you are migrating from an old MFA provider to a new one that knows your users under different IDs. Do not use it for any other reason, such as a user's name or email address changing. Disable it again once the migration is done.
Why it is off by default. The login ID is the name the MFA provider and the user's private key file know the user by. A change ends every session of the user and makes them redo MFA, and if the MFA provider does not yet know the user under the new ID, they cannot log in at all. A Super-admin could also point a user's login ID at an MFA identity they control, which reduces that account to the private key as its only factor. Enabling the change is therefore a deliberate site decision, and every change is recorded in the audit log.
Configuration
The ticrypt.auth.login-id-change section:
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | Bool | false | Enable only while migrating from an old MFA provider to a new one. Allows a Super-admin to change another user's login ID with PUT /users/<uid>/email. While false or unset, the request fails with usr-email-change-disabled and changes nothing |
login-id-change {
enabled = true
}
The setting is read when ticrypt-auth starts: restart the service after changing it. While it is enabled, the backend lists auth/change-user-email in GET /info/capabilities.
Before you change a login ID
- Confirm this is an MFA migration. Change login IDs only to move users from an old MFA provider to a new one.
- Register the new ID with the MFA provider first. The MFA provider must know the user under the new login ID before the change. Otherwise the user cannot log in until it does. See MFA Setup.
- Tell the user. The change ends all of their sessions, and they must log in again with the new login ID.
What a change does
In the web app (2.19.1 or later), a Super-admin makes the change with Change login ID in the user's menu in Management > Users. See Change a User's Login ID. The web app's warning says the old login ID stays blocked for other users for 90 days; backend 3.16.5 frees it at once.
The request is PUT /users/<uid>/email with the body {"email": "<new login ID>"}, sent in a Super-admin session. On success, the backend:
- Saves the new login ID, lowercased when the MFA
disable-case-sensitivityoption istrue. - Ends all of the user's sessions and sends the
loginEmailChangednotification to their open tabs. The web app logs them out and its login page tells them that their login ID changed and that their key file must have the new login ID. - Deletes the user's MFA tokens, so they redo MFA at the next login. Their enrollment at the MFA provider is not touched.
- Keeps the previous login ID on the account. A login with the old ID fails with
usr-old-login-id, whose message tells the user that their login ID has changed and that their key must be reformed for the new one. - Writes a user email changed (
UE) record to the audit log. Failed requests are recorded too.
The old login ID is free for another account at once.
Login ID rules
The same rules apply to a login ID change, to registration and to accounts created by an administrator:
- Format: the login ID must not be empty, contain whitespace or HTML, or be longer than 254 characters. It no longer has to be in
name@domainform. The Login ID RegEx system setting can still restrict which IDs people register with. - Uniqueness: a login ID is taken while an active or a deleted user holds it, ignoring case. A deleted user holds their login ID until they are purged, so a new account cannot take it; restore the deleted user instead, or wait until the deleted-user cleanup purges them.
Errors
| Error | Cause |
|---|---|
sec-inval-perm | The caller is not a Super-admin, or is trying to change their own login ID |
usr-email-change-disabled | login-id-change.enabled is not true |
usr-bad-email | The new login ID breaks the format rules, or is the user's current login ID |
usr-dup-email | An active or deleted user already holds the new login ID, ignoring case |
usr-email-conflict | The user's login ID was changed by another request at the same time, three times in a row. Retry |