Account Protection (Lua Subject Source)
The Account Protection subject source protects individual accounts under suspicious activity. It applies a progressive delay (backoff) and signals Step-Up/Challenge to frontends. Starting with v1.10.0, enforcement is disabled by default (dry-run): requests are not blocked unless explicitly enabled.
What it does
- Evaluates long-window, per-account metrics (24h/7d) and attack flags:
uniq_ips_24h,uniq_ips_7dfails_24h,fails_7d- distributed-attack participation flag
- Applies progressive backoff (sleep) to slow down automated attacks.
- Records protection mode state in Redis and exposes Step-Up hints for HTTP/OIDC frontends.
- Optionally rejects unauthenticated requests while protection is active (enforcement mode).
Headers and Redis keys
When protection is active, the subject source sets:
-
HTTP headers (for HTTP/OIDC flows):
X-Nauthilus-Protection: stepupX-Nauthilus-Protection-Reason: <comma-separated reasons>X-Nauthilus-Protection-Mode: dry-run(only when enforcement is disabled)
-
Redis keys:
ntc:acct:<username>:protection(HASH:active,reason,backoff_level,until_ts,updated)ntc:acct:<username>:stepup(HASH:required,reason,until_ts,updated)ntc:acct:protection_active(SET of usernames currently under protection)