Ir al contenido

Brute-force protection

OkYouIn is on the sign-in path of your VPNs and applications, so it is also where guessing attacks arrive. Several independent layers deal with them, each keyed differently so that one attacker technique cannot slip past all of them:

LayerCounts perStopsWhere to configure
Blocked IPsclient addressone address guessing across many accountsLogging ▸ Blocked IPs
Account lockoutaccountguessing one account’s passwordSettings ▸ System ▸ Authentication & Sessions
CAPTCHA and honeypotclient addressscripted guessing on the console loginSettings ▸ System ▸ Authentication & Sessions
Push flood protectionuserpush bombing (“MFA fatigue”)Settings ▸ System ▸ MFA Settings
MFA limits for RADIUSuser, and application + addresscode guessing and push spam through RADIUS devicesAccess ▸ Settings ▸ RADIUS

On top of these, OkYouIn never tells a client why a sign-in failed: an unknown user, a wrong password, a locked account and a policy denial all get the same answer, so the responses cannot be used to find valid account names.

Failed sign-ins are counted per client address in the database, so every server process — and the RADIUS path — counts together. An address that fails too often is blocked for a while, and longer each time it comes back.

Open Logging ▸ Blocked IPs. The page lists active and expired blocks (address, source, reason, failures, strike, Blocked until, last username tried) and holds the Brute-force protection settings.

SourceFailures
Consolewrong password, unknown, inactive or locked account, console access denied, the honeypot field filled in
MFAa wrong, already used or invalid code or token; an unknown e-mail link
Deviceinvalid pairing or status tokens, codes or passkeys sent to the web app’s device endpoints
RADIUSwrong password, unknown user, wrong domain, locked user, wrong or replayed MFA code, failed MFA
SSO, APIfailed sign-ins on the single sign-on page and through the Verify API (the end user’s address)

A directory that does not answer is not counted — that says nothing about the password.

RADIUS counts the end user, never the device. For RADIUS, the address counted is the end user’s, from Calling-Station-Id. The RADIUS client (the NAS) itself is never counted or blocked. A request whose Calling-Station-Id is missing or not an IP address is not counted here at all; account lockout and the MFA limits still apply to it.

IPv6 addresses are counted per /64, since one host can use a whole /64.

A success clears nothing. Failures simply age out of the window. Otherwise an attacker could reset the count by signing in to an account of its own between guesses.

SettingDefaultRange
Block automaticallyon—
Failures before a block103–1000
Counting window (minutes)151–1440
Block time (minutes)151–1440
Escalate repeat offenceson—

With the defaults, 10 failures from one address within 15 minutes block it for 15 minutes. With Escalate repeat offences on, an address blocked again within 24 hours after its previous block ended is blocked four times longer each time, up to 24 hours:

Strike12345 and later
Block15 min60 min4 h16 h24 h

A blocked address is refused before any work is done — before the user is looked up, before a password is hashed or a directory is asked. Web requests get the same “Too many requests” answer as an ordinary rate limit; RADIUS gets an Access-Reject with “Too many sign-in attempts, try again in N minutes”. Because a blocked address never reaches the password check, it cannot keep a victim’s account locked out either.

Each automatic block is written to the audit log and opens a warning alert for that address (one alert per address, so a repeat offender does not flood your notification channels). Unblocking resolves it.

Never blocked (allowlist) takes network objects. Addresses inside them are never counted and never blocked, and an existing block of theirs is not enforced. Put here your offices, monitoring systems and your own administration network.

Block IP blocks one address (an IPv6 address blocks its /64) for 1 minute up to 365 days, with an optional comment. You cannot block an allowlisted address or the address you are connected from. Manual blocks apply even when Block automatically is off.

Unblock ends a block at once and forgets the address’s failures and repeat-offence history. Forget does the same for an expired block.

Viewing the page needs View on the Blocked IPs RBAC section, blocking and unblocking needs Manage. Changing the protection settings needs the Settings edit permission, so an operator can unblock a user’s address without being able to weaken the protection.

After Max login attempts consecutive wrong passwords (default 5), the account is locked for Lockout duration (minutes) (default 15). This applies to every password check OkYouIn makes — the console, the single sign-on page and RADIUS — for local accounts and for directory accounts whose password OkYouIn verifies. A correct password resets the count.

A locked account is refused everywhere until the lock expires or an administrator clicks Unlock on the user. The user can be e-mailed when they are locked and unlocked (Settings ▸ Integrations ▸ Email, notifications Account locked / Account unlocked). Wrong MFA codes never lock the account; they are limited separately (below).

The console login form has two extra defences, both on by default:

  • Enable adaptive CAPTCHA — a self-hosted ALTCHA proof-of-work, shown only after Challenge threshold failed logins from one address within 15 minutes (default 3; 0 = always). Correct credentials below the threshold — including API scripts — are never challenged. Challenge complexity (default 50 000) sets how much CPU each challenge costs the browser.
  • Enable honeypot field — a hidden decoy field that real users and API clients never fill in; a submission that fills it is refused like a wrong password.

Per-address rate limits on login, token refresh, password change and CAPTCHA requests are set by RATE_LIMIT_* environment variables on the server, not in the console.

Whoever holds a user’s password can start sign-in after sign-in, each one sending the user a push, until a tired tap on Approve lets them in. Push flood protection limits the sign-in pushes one user receives — Telegram, OkYouIn web app push and e-mail Approve links, from every application together.

Configure it under Settings ▸ System ▸ MFA Settings, card Global MFA Settings, section Push flood protection:

SettingDefaultMeaning
Pushes per user / Within5 / 10 minutesAt most 5 pushes to one user in 10 minutes. 0 = off.
Pause after failed pushes3 in a rowPushes in a row that were denied, reported as “This wasn’t me” or left unanswered pause pushes to that user. An approval starts the count again. 0 = off.
Failed within10 minutesThose failed pushes must fall within this time.
Pause length15 minutesHow long pushes stay paused after the last failed one.

When a push is refused, it is not sent and the user’s legitimate pending push stays. The sign-in fails with “Too many sign-in requests were sent to you — try again in N min.”, the event is audited and a warning alert for that user fires. Where a code can still be used, the user is not stuck:

  • an e-mail still goes out with its code, just without the Approve / Deny links;
  • OkYouIn web app push on the console asks for the app’s offline code instead.

TOTP codes are never limited here — they are not pushes.

RADIUS sign-ins have their own limits under Access ▸ Settings ▸ RADIUS, card MFA limits per user. They are shared with the Windows logon agent and the single sign-on page:

SettingDefaultMeaning
Challenges per window / Challenge window (seconds)30 / 600New MFA challenges (code prompts, e-mailed codes, pushes) one user may get; then sign-ins are refused with “Too many sign-in attempts, try again in N minutes”. Every SSH login and every sudo through pam_radius is one challenge.
Wrong codes per window / Wrong-code window (seconds)10 / 900Wrong MFA codes of one user, any application; then further codes are refused.
Failed pushes before a pause / Pause (seconds)5 / 30Denied or unanswered pushes from one client address to one application start a short pause for that address and application. Other applications and addresses are not affected.

The console login has its own budget per login attempt: five wrong codes, and at most five pushes sent 20 seconds apart, before the user has to start over with the password.

  • Logging ▸ Blocked IPs — every automatic and manual block.
  • Access log — refusals with their reason: IP address blocked (brute-force protection), Too many pushes to the user (push flood), Rate limited, User locked.
  • Audit log — blocks, unblocks, lockouts and push-flood refusals.
  • Alerts — one per blocked address and one per push-flooded user.