Wiki Β· Docs
RU ← Main Website

Ligament 2FA Installation and Administration Guide

Official technical step-by-step administrator guide for deploying the Ligament Core engine in Docker, integrating with Active Directory/FreeIPA directories, configuring multi-factor authentication, and silently rolling out client agents via GPO.

1
Architecture & System Requirements

The Ligament platform functions completely autonomously inside your private infrastructure (100% On-Premise). Master encryption keys, user directories, active sessions, and security audit logs are stored securely in a relational PostgreSQL database. The engine makes zero external requests and is fully ready for air-gapped networks.

πŸ’‘

Minimum Host Requirements:

β€’ CPU: 1 vCPU / core (x86_64 or ARM64).
β€’ RAM: 1 GB (2 GB recommended for 500+ active users).
β€’ Disk: 10 GB SSD/NVMe for OS, Docker images, and PostgreSQL.
β€’ OS: Debian 12, Ubuntu 22.04/24.04, Rocky Linux 9, Astra Linux SE/CE, RED OS, Alt Linux.

Network Ports Matrix

Port Protocol Service Purpose
80 TCP HTTP HTTPS redirect and Let's Encrypt ACME HTTP-01 challenge
8080 TCP Web UI / API Admin console, User portal, REST API, Web SSO
443 TCP HTTPS / WSS Secure client access, branch relays, WebAuthn / Passkeys
1812 UDP RADIUS Auth MikroTik, VPN (OpenVPN, WireGuard), Wi-Fi 802.1X authentication
1813 UDP RADIUS Acct Accounting of session durations and network traffic
2
Deploying Ligament Core in Docker

The platform engine is distributed as an optimized official Docker Hub image aligorov/ligament_2fa. No build tools or compilers are required.

Option A: Quickstart via Official Script (Recommended)

The script checks Docker prerequisites, tests port availability (80/8080 TCP, 1812/1813 UDP), generates a secure PostgreSQL password in .env (chmod 0600), deploys containers, and extracts master recovery credentials.

bash β€” automated install script
mkdir -p /opt/ligament && cd /opt/ligament
curl -fsSL https://raw.githubusercontent.com/aligorov/ligament/main/install.sh -o install.sh
chmod +x install.sh && ./install.sh

Option B: Manual Docker Compose Deployment

Create directory /opt/ligament and save docker-compose.yml:

yaml β€” docker-compose.yml
services:
  db:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: twofa
      POSTGRES_PASSWORD: "${TWOFA_PG_PASSWORD:?Specify TWOFA_PG_PASSWORD in .env}"
      POSTGRES_DB: twofa
    volumes:
      - twofa_pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U twofa -d twofa"]
      interval: 5s
      timeout: 3s
      retries: 20
    restart: unless-stopped

  twofa:
    image: aligorov/ligament_2fa:latest
    hostname: ligament-auth
    depends_on:
      db:
        condition: service_healthy
    environment:
      TWOFA_DB_DSN: "postgres://twofa:${TWOFA_PG_PASSWORD}@db:5432/twofa"
      TRUSTED_PROXIES: "127.0.0.0/8,::1/128,172.16.0.0/12,10.0.0.0/8,192.168.0.0/16"
    ports:
      - "80:8080"
      - "8080:8080"
      - "1812:1812/udp"
      - "1813:1813/udp"
    volumes:
      - /etc/machine-id:/etc/host-machine-id:ro
    restart: unless-stopped

volumes:
  twofa_pgdata:

Generate the .env file and launch the stack:

bash β€” launch containers
echo "TWOFA_PG_PASSWORD=$(openssl rand -hex 24)" > .env
chmod 600 .env
docker compose up -d
3
Initial Admin Login & Security

The admin password is never written to container console logs. On first launch, the system provisions an admin account, stores the initial password in admin_password.txt, and generates 5 single-use emergency recovery codes in admin_recovery_codes.txt.

bash β€” extract password and break-glass codes
# Extract generated admin password:
docker cp $(docker compose ps -q twofa):/home/nonroot/admin_password.txt .

# Extract 5 emergency break-glass recovery codes:
docker cp $(docker compose ps -q twofa):/home/nonroot/admin_recovery_codes.txt .

# Display password:
cat admin_password.txt
⚠️

Required Post-Login Actions:

1. Open http://SERVER_IP:8080 in your browser (username: admin).
2. Store admin_recovery_codes.txt in a corporate vault (KeePass/Vault).
3. Delete the plaintext password file: rm -f admin_password.txt.
4. Change the admin password to a permanent one and link a 2FA factor (TOTP / Telegram).

4
Licensing & Air-Gapped Autonomy

By default, the free Community edition is active for up to 5 users indefinitely.

To upgrade to a commercial tier or activate a 30-day pilot:

  • Navigate to /admin β†’ License in the web console.
  • Paste the license key string and click "Save License".
  • Keys are cryptographically signed with Ed25519 β€” validated locally and applied instantly without server restarts or internet connectivity.
5
Network Domain & SSL/TLS Setup

Under /admin β†’ Settings β†’ Domain & Templates, configure your public URL in the server.domain parameter (e.g. https://auth.company.corp).

πŸ”’

Recommended Topology: The Ligament container runs on internal port 8080, while inbound traffic terminates on your reverse proxy (Nginx, Traefik, HAProxy, Caddy) forwarding X-Forwarded-For and X-Forwarded-Proto: https headers.

6
Active Directory & FreeIPA Integration

User provisioning and domain password verification operate over secure LDAPS. In /admin β†’ Settings β†’ Directory Services (LDAP), configure:

Parameter Value Description
enabledtrueEnable directory sync module
urlldaps://dc1.company.corp:636Encrypted Domain Controller endpoint
bind_dnCN=svc-ligament,OU=Services,DC=company,DC=corpService account DN for directory searches
bind_passwordβ€’β€’β€’β€’β€’β€’β€’β€’β€’β€’β€’β€’Service account password
base_dnDC=company,DC=corpRoot DN for user search tree
user_filter(&(objectCategory=person)(sAMAccountName={login}))Username search filter template
cache_passwordstruePassword caching for Wi-Fi 802.1X PEAP
7
Multi-Factor Authentication (MFA) Channels

In /admin β†’ Settings, enable your preferred verification channels:

  • Telegram Bot: Create a bot via @BotFather and specify the token in telegram.bot_token. Employees confirm sign-ins via in-chat prompts or Number Matching.
  • Corporate Email (SMTP): One-time passcode (OTP) delivery routed through your corporate mail server.
  • FIDO2 / Passkeys / WebAuthn: Hardware security tokens (YubiKey, Rutoken MFA) and platform biometrics (Windows Hello, Touch ID).
8
RADIUS Configuration (MikroTik, Wi-Fi 802.1X, VPN)

Ligament Core provides a built-in RADIUS server (UDP 1812 / 1813). To connect MikroTik RouterOS gateways, execute in the RouterOS terminal:

routeros β€” connect RADIUS server
/radius add address=192.168.1.10 secret="YourSecretKey" service=login,ppp,wireless timeout=5s
/user aaa set use-radius=yes
/ppp aaa set use-radius=yes accounting=yes
/radius incoming set accept=yes
9
Deploying Windows Logon Agents (MSI + GPO)

The native Credential Provider integrates into Windows workstations and servers to secure console and RDP logons with instant Auto-Logon.

Workstation Logon Interface

Windows LogonUI Screen with Ligament 2FA
πŸͺŸ Native Windows LogonUI Integration Integrates directly into the Windows lock screen: users type their credentials and confirm access via push notification (Number Matching), Telegram, or Passkey.
Passkey QR Sign-in on Windows Logon
πŸ”‘ Passkey QR Sign-in (Dynamic QR) Employees scan a dynamic on-screen QR code using their phone camera and approve via Face ID / Touch ID biometrics. Zero manual code typing.

Active Directory Group Policy (GPO) Setup:

1. Copy Ligament2FA.admx into \\domain\SYSVOL\domain\Policies\PolicyDefinitions\.
2. Copy Ligament2FA.adml into PolicyDefinitions\en-US\.
3. In gpmc.msc, enable Server URL (https://auth.company.corp:8080), Auto-Logon (Enabled), and Number Matching (Enabled).

10
Client Applications & Onboarding

For employees running Windows or Linux distributions, the graphical Ligament Authenticator app provides seamless pairing, notifications, and telemetry.

Sign-in via Ligament Authenticator Desktop App
πŸ’» Workstation Pairing in Ligament Authenticator Pairs the workstation with the user identity, handles background system notifications, and tracks connection health.
11
Branch Relay Nodes (Offline Resilience)

The lightweight Relay node addresses two critical branch office requirements:

  • Secure RDP & SSH Forwarding: Opens an outbound WSS (:443) tunnel to Core, granting secure remote admin access to internal hosts without a public IP or exposed ports.
  • Cached Backup RADIUS for Wi-Fi: During WAN outages, operates as an autonomous local RADIUS server (802.1X WPA2/WPA3 Enterprise) using cached credentials.
12
Monitoring, Auditing & Backup

β€’ Healthcheck: curl -I http://localhost:8080/healthz (returns HTTP 200 OK).
β€’ Live Audit Log: Streamed in real-time under /admin/audit.
β€’ Database Backup:

bash β€” PostgreSQL backup
docker compose exec -T db pg_dump -U twofa twofa | gzip > "ligament_backup_$(date +%F_%H%M).sql.gz"