Skip to content

Multi-Factor Authentication

Multi-Factor Authentication (MFA) requires users to provide multiple forms of evidence to verify their identity. By combining factors, MFA dramatically reduces the risk of unauthorized access even when one factor is compromised.

Passwords are the weakest link in authentication:

Attack VectorHow Passwords Fail
PhishingUsers enter passwords on fake sites
Credential stuffingReused passwords from breached sites
Brute forceWeak passwords can be guessed
KeyloggersMalware captures passwords
Social engineeringUsers reveal passwords to attackers
Shoulder surfingPasswords observed while typing

MFA combines multiple independent factors:

  • Passwords
  • PINs
  • Security questions

Strengths: Easy to deploy, no hardware required Weaknesses: Can be guessed, phished, or stolen

  • Security keys (YubiKey)
  • Mobile phones (SMS, authenticator apps)
  • Smart cards

Strengths: Physical possession required Weaknesses: Can be lost or stolen

  • Fingerprints
  • Face recognition
  • Voice patterns
  • Retina scans

Strengths: Always with you, hard to replicate Weaknesses: Cannot be changed if compromised, privacy concerns

MethodPhishing ResistantConvenienceRecoveryCost
TOTP (Authenticator)PartiallyHighMediumFree
WebAuthn (Security Keys)YesMediumLow$25-50/key
YubiKey OTPPartiallyHighLow$25-50/key
SMS CodesNoHighHighLow
Push NotificationsPartiallyHighMediumVaries
Backup CodesNoLowN/AFree

How it works:

Pros:

  • Free (use any authenticator app)
  • Works offline
  • No per-authentication cost

Cons:

  • Codes can be phished in real-time
  • Shared secret stored on both sides
  • Account recovery requires backup

How it works:

Pros:

  • Phishing resistant (origin verification)
  • Private key never leaves device
  • User presence verification (touch)

Cons:

  • Requires hardware purchase
  • Can be lost (need backup method)
  • Not all browsers support fully

How it works:

Press button → YubiKey types: ccccccbcgujhingjrdejhgfnuetrgigvejhhgbkugded
↑ ↑
Static prefix One-time password

Pros:

  • Simple (just touch the key)
  • Works everywhere (emulates keyboard)
  • Yubico cloud validation available

Cons:

  • Codes sent in plain text (can be phished)
  • Requires Yubico infrastructure or self-hosting
  • One key per account typically

Why SMS is weak:

  • SIM swapping: Attackers convince carriers to transfer your number
  • SS7 attacks: Network-level interception of messages
  • Malware: Can intercept SMS on compromised phones

Not all actions need the same security level. Step-up MFA adds verification for sensitive operations:

ActionRequires Step-UpRationale
View applicationsNoLow-risk read operation
View logsNoLow-risk read operation
Run exec commandConfigurableCould access secrets
Deploy applicationYesChanges production
Manage usersYesPrivilege escalation
Manage API tokensYesCredential management
  1. Verify identity before enrollment

    Ensure the user is who they claim to be before letting them add MFA

  2. Require multiple methods

    Encourage users to register backup methods (TOTP + backup codes)

  3. Secure the enrollment process

    Use authenticated sessions, prevent session hijacking during enrollment

  4. Display recovery options

    Show backup codes only once, encourage secure storage

  1. Rate limit attempts

    Prevent brute-force attacks on 6-digit codes

  2. Lock out after failures

    Temporarily lock accounts after repeated failures

  3. Log all attempts

    Track successful and failed MFA attempts for forensics

  4. Clear session on MFA failure

    Don’t allow continued access after MFA rejection

ScenarioRecommended Recovery
Lost phone (TOTP)Use backup codes
Lost security keyUse backup key or admin reset
Forgot backup codesAdmin reset with identity verification
Compromised accountAdmin reset + security review
MethodTypeSetup Location
TOTPSomething you haveWeb UI or CLI
WebAuthnSomething you haveWeb UI
YubiKey OTPSomething you haveWeb UI
Backup CodesSomething you haveWeb UI
Terminal window
# MFA Settings
RGW_SETTING_MFA_REQUIRED_ROLES=admin,operator # Require MFA for these roles
RGW_SETTING_MFA_TIMEOUT_SECONDS=300 # Step-up MFA timeout

MFA is one layer; you still need:

  • Strong passwords
  • Session management
  • Authorization (RBAC)
  • Audit logging

Recovery options that bypass MFA defeat its purpose:

  • ❌ Email-only recovery
  • ❌ Security questions
  • ✅ Backup codes stored securely
  • ✅ Admin-verified identity reset

Partial deployment leaves gaps:

  • ❌ MFA optional for developers
  • ❌ MFA only for admins
  • ✅ MFA required for everyone, with different policies per role

TOTP can still be phished in real-time. For high-security environments:

  • ✅ Require WebAuthn/FIDO2 for admin accounts
  • ✅ Use hardware security keys
  1. Passwords alone are insufficient for securing sensitive systems
  2. MFA combines independent factors to dramatically reduce risk
  3. WebAuthn is most secure but TOTP is a good balance of security and convenience
  4. Step-up MFA adds verification for sensitive operations without friction for routine tasks
  5. Recovery planning is essential—users will lose devices
  6. SMS is weak—use app-based TOTP or hardware keys