Skip to main content
tiCrypt

Auth Service (ticrypt-auth)

ticrypt-auth handles authentication, authorization, and user management, and supervises all other services.

Configuration File

/etc/ticrypt/ticrypt-auth.conf. All options are in the ticrypt.auth section.

Main Configuration Structure​

ParameterTypeRequiredDescription
mongodbSection✅Database connection. See mongodb.
usersSection✅User registration settings. See Users.
sessionsSection✅Session management. See Sessions.
mfaSectionMulti-factor authentication. See MFA.
servicesSection✅Service supervision. See Services.
security.xssSection✅XSS attack response. See XSS Security.
mailboxesSectionMailbox feature toggle. See Mailboxes.
key-escrowSectionKey escrow subsystem. See Key Escrow.
server-assisted-authSectionSplit-credential hardening. See Split Credentials.
login-id-changeSectionWhether a Super-admin may change another user's login ID. See Login ID Change.
akka.remote.artery.canonical.hostnameSee Akka
akka.remote.artery.canonical.portSee Akka. Default 2552

Users​

ParameterTypeRequiredDefaultDescription
allow-self-registrationon, offonAllow users to register their own accounts, which stay inactive until an admin activates them
self-registration-tokenString✅Token used to bootstrap the first user and, when self-registration is on, required from new users who register
self-registration-reasonString"Account disabled pending administrator approval."Message shown to users who log in before their account is activated
default-permissionsArrString["@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
tip

If self-registration is enabled, generate a random value for self-registration-token to prevent server spamming:

openssl rand -base64 32

Sessions​

ParameterTypeDefaultDescription
session-idle-ttlDuration15 minutesMaximum inactivity before a session is closed
challenge-ttlDuration10 minutesHow long a login challenge remains valid
temporary-ttlDuration10 minutesHow long a temporary session created by a signed message remains valid
subsession-max-ttlDuration30 minutesMaximum lifetime of a subsession
banned-permissionsArrString[]Permissions stripped from all sessions, for example ["@mailbox"]. Uses the same syntax as default-permissions
max-challenge-attempts-before-lockInt5A user may request this many login challenges in a row without completing any. The next request locks the account
warning

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.

ParameterTypeDefaultDescription
check-ping-frequencyDuration2 secondsHow often to check service health
timeoutDuration20sHow long a service can go without answering before it is considered offline

XSS Security​

Controls the response to detected Cross-Site Scripting (XSS) attacks.

ParameterTypeDefaultDescription
kill-sessionBooltrueTerminate the session on XSS detection
lock-userBooltrueLock the user account on XSS detection
lock-user-reasonString"Account locked due to suspected malicious activity"Message shown to the locked user
warning

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.

ParameterTypeDefaultDescription
enabledBoolfalseEnable 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:

ParameterTypeRequiredDefaultDescription
enabledBoolfalseEnable the key escrow feature
min-keysInt3Minimum number of escrow groups required before key enrollment
site-key-pathStringIf enabledPath to the signed site key file
previous-site-key-pathsArrString[]Paths of the site keys this one replaced. Used only to decrypt data that was encrypted with an earlier site key
caution

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:

  1. Pull escrow group information (group membership and public keys) from the server.
  2. Generate a separate AES-256 Recovery Key Part for each escrow group.
  3. Combine all key parts into a single AES-256 Recovery Key.
  4. Encrypt the user's private key with the Recovery Key. The Recovery Key is then discarded.
  5. Encrypt each group's key part with every member's public key.
  6. 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​

ParameterTypeRequiredDefaultDescription
token-saltString✅Random salt for MFA tokens
num-factors-requiredInt0Number of required factors. 0 disables MFA.
required-for-registrationBooltrueWhether new users must complete MFA to register. Applies only when num-factors-required is greater than 0.
disable-case-sensitivityBoolfalseWhen 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-factorsArrString[]IDs of active factors from the factors section
default-token-ttlDuration2 daysDefault MFA token validity period
default-cert-ttlDuration30 minutesDefault MFA certificate lifetime
factorsSectionFactor definitions (see below)

Factor Definition​

Each factor in the factors section defines a sub-section:

ParameterTypeRequiredDefaultDescription
public-keyString✅Path to the factor's public key file
urlString✅URL of the factor's authentication page. It must not contain a query string: the frontend appends ?port=<port> to it.
token-ttlDurationMFA defaultHow long the MFA token is valid
cert-ttlDurationMFA defaultLifetime of the MFA certificate

How It Works​

When a user logs in with MFA enabled:

  1. The server responds with a list of factor URLs the user must authenticate with.
  2. The tiCrypt frontend opens the factor URLs one at a time, in the order listed, in a new window, with ?port=<port> appended.
  3. The factor's web page performs authentication and redirects the window to mfa.html on that port, passing a signed certificate in the msg query parameter. mfa.html hands the certificate to the frontend and closes.
  4. The frontend sends each certificate to the server, which checks it and returns an MFA token, until it has num-factors-required tokens.
  5. The frontend submits the MFA tokens with the standard login challenge.
  6. 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.

ParameterTypeDefaultDescription
saltLenInt4Salt length in bytes. Recommended: 32 (SHA-256 hash size).
tip

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.

note

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​

ParameterTypeDefaultDescription
enabledBoolfalseEnable split credentials
requiredBooltrueRequire split credentials for new users
tip

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:

  1. The AES-encrypted private key data
  2. The AES Initialization Vector (IV)
  3. The user's password
  4. 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.

Only for an MFA migration

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:

ParameterTypeDefaultDescription
enabledBoolfalseEnable 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:

  1. Saves the new login ID, lowercased when the MFA disable-case-sensitivity option is true.
  2. Ends all of the user's sessions and sends the loginEmailChanged notification 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.
  3. Deletes the user's MFA tokens, so they redo MFA at the next login. Their enrollment at the MFA provider is not touched.
  4. 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.
  5. 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@domain form. 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​

ErrorCause
sec-inval-permThe caller is not a Super-admin, or is trying to change their own login ID
usr-email-change-disabledlogin-id-change.enabled is not true
usr-bad-emailThe new login ID breaks the format rules, or is the user's current login ID
usr-dup-emailAn active or deleted user already holds the new login ID, ignoring case
usr-email-conflictThe user's login ID was changed by another request at the same time, three times in a row. Retry