Airlock supports multi-factor authentication (MFA) for local users. The otp type implements the TOTP standard — time-based one-time codes.
You can use any TOTP client to generate codes: Authy, FreeOTP, KeePassXC, or similar apps.
Available second_factor modes
| Value | Description |
|---|---|
otp | TOTP only (default) |
webauthn | WebAuthn only (hardware keys, biometrics) |
on | TOTP and WebAuthn; each user must have at least one MFA device |
optional | TOTP and WebAuthn are available but not required |
off | MFA disabled |
For SSO users, MFA is configured on the IdP side. Airlock does not prompt for MFA during SSO login, although users can still register devices.
Enabling TOTP
Dynamic configuration
Retrieve the current cluster_auth_preference resource:
airctl get cap > cap.yamlSet second_factor:
kind: cluster_auth_preference
metadata:
name: cluster-auth-preference
spec:
type: local
second_factor: "otp"
version: v2Apply:
airctl create -f cap.yamlFor mandatory MFA use second_factor: "on". For gradual rollout use "optional".
Static configuration
Add to /etc/airlock.yaml:
auth_service:
authentication:
type: local
second_factor: otpRestart the Auth Service after making changes.
Registering a TOTP device
A user registers TOTP via airsh:
airsh mfa add
# Choose device type [TOTP, WEBAUTHN]: totp
# Enter device name: phone
# Scan QR code with your TOTP app
# Enter an OTP token from the device: 123456
# MFA device "phone" added.List registered devices:
airsh mfa lsRemove a device:
airsh mfa rm phoneLogging in with TOTP
After registering a device, a one-time code is requested on login:
airsh login --proxy=airlock.example.com
# Enter password for Airlock user alice:
# Enter an OTP token from a registered device: 654321Lockout after failed attempts
A local user is locked for 20 minutes if there are several failed login or password reset attempts within a 30-minute window.
To unlock, an administrator runs:
airctl get users/alice > user.yamlSet status.is_locked to false and apply:
airctl create -f user.yamlNext steps
- Configure WebAuthn for hardware keys
- Review local users and role management