Release native admin final 2.1.0

This commit is contained in:
SoGi committed 2026-10-22 16:31:51 +02:00
1 parent 71c778b9d7
commit d05253ba84
12 files changed
+1723 -113

No files matched your search

+86 -8
View File
@@ -1,13 +1,91 @@
# Native C++ runtime
# DUO-RDP native C++ release
Этот каталог - canonical source для текущего DUO-RDP native release. Он заменяет прежний C#/Python broker, HTTP OTP service, PyInstaller GUI-admin и installer chain.
This directory is the native replacement for the former C# pipe broker, Python
OTP HTTP server, Python admin UI and PyInstaller installer chain.
- `DuoRdpAuthService.exe` - Windows service и единственный OTP runtime. Он обслуживает `\\.\pipe\duordp-auth-pipe` по JSONL protocol v2, хранит OTP-сессии в памяти, отправляет Telegram через WinHTTP, проверяет TOTP и читает machine-DPAPI конфиг.
- `DuoRdpAdmin.exe` - launcher для `DuoRdpAuthService.exe --admin`; токен передаётся только через `--token-stdin`.
- `DuoRdpInstaller.exe` и `DUOUnIstall.exe` - native installer/recovery. Installer проверяет DLL, конфиг, service и live pipe до регистрации Filter. Uninstaller сначала снимает Filter и по умолчанию сохраняет config/logs.
- `DuoRdpAuthService.exe` is a Windows service and the sole OTP runtime.
It keeps the existing `\\.\pipe\duordp-auth-pipe` JSONL v1 contract used by
the Credential Provider. It reads the existing machine-DPAPI configuration
format, sends Telegram messages with WinHTTP, verifies TOTP and stores OTP
sessions in-process.
- `DuoRdpAdmin.exe` is a native Win32 settings application. It self-elevates
with UAC, then talks to the service through its Administrator/SYSTEM-only
named pipe. The GUI never reads the DPAPI configuration directly. On its
first launch it asks for an administrator login and the same password twice;
later launches require that login and password before any 2FA value is read.
The password is stored only as a salted PBKDF2 verifier inside the same
machine-DPAPI protected config.json.
It manages users and groups, per-user/default Telegram targets, TOTP
generation, Telegram/TOTP proof, global rules and OTP limits.
- `DuoRdpInstaller.exe` and `DUOUnIstall.exe` are native installer/recovery
tools. The installer validates the DLL, starts and checks the pipe before it
enables the Credential Provider Filter. The uninstaller removes the filter
first and preserves config/logs unless `--purge-data` is explicit.
Каждый явный `RequestOtp` заменяет запись конкретной плитки. Старый код этой плитки перестаёт работать немедленно; коды параллельных плиток не конфликтуют. Login-submit код сам не отправляет.
Manual resend semantics are intentional and testable: every `RequestOtp` from
the explicit Credential Provider button creates a replacement record. The
previous code is invalid immediately. Automatic Login-submit still sends at
most one initial code per user/tile; it tells the user to use the explicit
`Отправить новый одноразовый код` command for a new code.
Legacy `ENCv1` config намеренно блокируется до любых изменений: сначала его нужно мигрировать старым admin tool, затем ставить native release. Это предотвращает fail-closed lockout.
The native release reads plaintext and machine-DPAPI (`ENCdpapi`) configs. An
existing legacy `ENCv1` config is intentionally rejected by the installer
*before* it changes a service or enables the Credential Provider Filter. Migrate
that config once with the old administration tool, then install the native
release; this gate prevents a fail-closed login lockout.
Инструкции: [сборка](../../docs/BUILD.md), [установка](../../docs/INSTALL.md), [проверка](../../docs/TESTING.md), [protocol](../../docs/PROTOCOL.md).
Every native GUI save writes a timestamped encrypted `config_*.json` backup
beside the active configuration before an atomic replacement. Changing a
user's Telegram token/target, TOTP secret or groups invalidates its verified
state; it becomes active again only after a real Telegram or TOTP proof.
Legacy numeric-ID and login-key duplicates are canonicalized into one numeric
row, so a stale token cannot win by map ordering.
When Credential Provider group discovery is incomplete, the service also
resolves local and global Windows group memberships before applying group
rules.
## Configure
1. Run `C:\Program Files\DuoRdp\DuoRdpAdmin.exe` as a local Administrator.
2. On the first opening, enter the administrator login and password twice.
On every later opening, enter that login and password once.
3. Add a user row, Telegram token/target and/or a TOTP secret. Use
**Generate TOTP** when needed.
4. Click **Apply row**, then **Save settings**.
5. Click **Send test**, enter the last received Telegram code (or the current
TOTP code), and click **Verify**.
6. Enable global 2FA only after at least one required row shows Verified.
The native window displays configured Telegram values and Google Authenticator
keys after administrator authentication; it does not mask them with asterisks.
The old `--admin` CLI remains only for scripted inspection and limited edits.
It no longer has a fake `--verify` switch; verification must happen through
the GUI proof flow.
## Build
MSVC 2022 / Windows SDK:
```powershell
cmake -S . -B build -A x64
cmake --build build --config Release
```
The included `scripts/mingw64-toolchain.cmake` supports a reproducible
cross-build on Linux with `x86_64-w64-mingw32-g++`.
## Acceptance checks
Run on Windows before any install:
```text
DuoRdpAuthService.exe --self-test
DuoRdpAuthService.exe --admin-self-test
DuoRdpAuthService.exe --pipe-self-test
DuoRdpInstaller.exe --self-test
```
Do not register the Credential Provider Filter until the service and the pipe
health check pass. A broken filter can remove the normal password tile from the
logon screen.