Face authentication for Linux PAM.
IR-required capture by default, layered static-presentation checks, a persistent daemon, and optional TPM-sealed encryption. 100% local — your face never leaves the machine.
SCRFD detection finds faces, affine alignment normalizes geometry, and ArcFace produces a 512-dimensional embedding for cosine similarity matching.
V4L2 frame acquisition with auto-detection. Prefers IR cameras for anti-spoofing. CLAHE enhancement for consistent lighting.
SCRFD neural network locates faces and extracts 5-point landmarks. Affine alignment produces a normalized 112x112 crop.
ArcFace produces a 512-dim L2-normalized vector. Cosine similarity against stored embeddings determines match or reject.
Multiple independent layers reduce static-presentation, tampering, and unauthorized-access risk. They do not claim complete spoof resistance.
Enabled by default. Rejects RGB-only operation and applies an IR texture check where a verified IR path is available.
Requires variation across a window of matched face embeddings. Rejects sufficiently static presentations; it does not establish that every photo or video replay will be rejected.
5 face-detected authentication failures per user per 60 seconds by default. Successful and no-face attempts do not consume this budget.
ONNX model files are SHA256-verified at every load. Tampered models are rejected before any inference runs.
D-Bus system bus policy restricts daemon access. Any local user may request authentication for itself; the daemon verifies the caller's UID and every other method is root-only.
PAM authentication messages use syslog. Optional structured audit logging writes JSONL when enabled; it is disabled by default. Journal and log-file availability depends on the distribution.
Three places it pays for itself the first day you install it.
A configured sudo PAM service can offer face before password fallback. The daemon keeps models loaded; measure the camera-specific reopen cost with sudo facelock bench camera-reopen.
Facelock can be added to an existing locker's PAM service. Hyprlock has a built-in user-side adapter; other lockers must own and validate their UI integration.
Display-manager PAM is sensitive and system-dependent. It is not part of the current validated matrix; test in a disposable guest with a recovery path.
A complete face authentication stack written in Rust, with sane defaults and the knobs you need when you outgrow them.
Requires an IR-classified camera by default. Frame variance and IR texture checks target static presentations; they are not a video-replay guarantee.
Persistent daemon keeps ONNX models loaded, so repeated authentication avoids model reload. sudo facelock bench camera-reopen measures the hardware-specific cold-camera cost.
All processing happens on-device via ONNX Runtime. Authentication and inference make no network requests; setup and explicit model downloads can use the network. No cloud services, telemetry, or analytics. Facelock does not upload your face data.
The PAM module can be added to named Linux-PAM services. The wizard edits only services you select; sensitive shared and login stacks require explicit authorization.
Optional TPM 2.0 support for encrypting face embeddings at rest. Hardware-bound keys ensure biometric data stays protected even if the disk is copied.
Choose persistent daemon mode or direct/oneshot operation. With daemon mode configured, backend-using management commands try D-Bus and can fall back to direct execution. In oneshot mode, PAM invokes its dedicated authentication subprocess.
Facelock is designed from the ground up to keep your biometric data private.
Face detection and recognition run entirely on your CPU or GPU via ONNX Runtime. No images or embeddings are ever transmitted over the network.
No analytics or telemetry. Setup and explicit model-download commands can use the network; authentication and inference do not download models or contact servers.
New enrollment uses AES-256-GCM with a local keyfile by default; TPM sealing is optional. Database encryption protects a copy obtained without its key, not a disk copy containing both the database and an unsealed keyfile.
Facelock's source is dual-licensed under MIT or Apache-2.0. Dependencies and model weights have their own licenses; review the model notice before deployment.
Channel status checked 2026-09-06: v0.2.0 is the latest stable release, published with direct Debian 13, Ubuntu 26.04, and Fedora 44 packages. Every stable channel serves it: the three AUR entries, both APT suites, and the production COPR.
On Ubuntu 26.04, use the resolute suite instead of trixie in the source line. Check the keyring fingerprint before trusting the source, or install the suite-specific Debian package directly from the release.
Under the compatibility policy, existing v0.1.4 entries naming main or legacy keep working until 0.3.0. main maps to Trixie and legacy exports empty indexes. At 0.3.0, apt update fails until the entry is removed. Rewrite those entries to trixie or resolute now.
The older 0.1.3 build stays in the repository, and dnf resolves to 0.2.0. A checksum-verified RPM is also published on the release.
The setup wizard includes enrollment and only edits PAM when selected. Keep a root recovery shell open. See docs for exact release status, source prerequisites, and safe testing.
Implementation-backed properties and their limits. See the contracts and security model before deployment.
| Feature | Facelock behavior |
|---|---|
| Language | Rust, with native-library and FFI boundaries; memory safety is not a guarantee against all runtime failures. |
| Daemon mode | Models stay loaded. Authentication latency still depends on the camera, runtime and configured checks. |
| IR enforcement | Default on. Requires an IR-classified camera; format evidence does not attest sensor authenticity. |
| Frame variance check | Default on. Checks matched embedding variation; not a video-replay guarantee. |
| TPM encryption | Optional TPM-sealed key. Protection depends on the selected policy and protection of any key backups. |
| Model verification | SHA256 verification before model loading; mismatched files are rejected. |
| Rate limiting | 5 face-detected authentication failures per user per 60 seconds by default, including persistent accounting for oneshot authentication. |
| D-Bus activation | Can start the daemon on demand. The persistent process retains models after authentication; there is no zero-idle-memory promise. |
| Constant-time matching | Constant-time selection and comparison primitives reduce matching side channels; the entire camera/authentication pipeline is not constant-time. |
| GPU acceleration | CUDA, ROCm and OpenVINO are runtime options requiring a compatible ONNX Runtime build and device drivers. |
| Audit logging | PAM syslog messages and optional structured JSONL authentication records (disabled by default); see the contracts for rejection-path coverage. |
| systemd hardening | ProtectSystem=strict and NoNewPrivileges, with explicit writable state paths. The unit retains CAP_SETUID and CAP_SETGID for desktop notifications. |
| PAM dependency boundary | Direct dependencies are libc, toml, serde and zbus. Camera and inference libraries stay outside the PAM module; binary size varies by build. |