Enforcing 2FA
Configure and enforce two-factor authentication for enhanced security
Overview
Two-Factor Authentication (2FA), also known as Multi-Factor Authentication (MFA), adds an extra layer of security to user accounts by requiring a second form of verification beyond just a password. This significantly reduces the risk of unauthorized access even if passwords are compromised.
Security Recommendation
Enforce 2FA for all users, to significantly enhance account security and protect sensitive penetration testing data.
Enforcing 2FA Settings
- Log in to PentestPad with an administrator account
- Navigate to the sidebar menu
- Click on Administration
- Select General tag
- Locate Enforce users to set up multi factor authentication settings
Enabling System-Wide 2FA
To require 2FA for users:
- Navigate to Administration > General tag
- Toggle Enforce users to set up multi factor authentication to enabled
- Click Save Settings
User's next login
- Users can log in normally without 2FA
- System forces user to set 2FA before proceeding
Planning Tip
Announce 2FA enforcement to your team before enabling it. Provide setup instructions and support resources to ensure smooth transition.
How Users Enable 2FA
When 2FA is required or enabled by choice, users follow these steps:
- Log in with username and password
- System displays prompt: "Two-Factor Authentication Required"
- User sees QR code and setup instructions
- User opens authenticator app on their mobile device
- User scans QR code with authenticator app
- App generates a 6-digit verification code
- User enters verification code in PentestPad
- System displays backup codes (10 one-time codes)
- User saves backup codes in secure location
- Setup complete - 2FA is now active
Important
Users must save their backup codes in a secure location. These codes are the only way to access the account if they lose their authenticator device.
Alternative Setup: Manual Entry
If users cannot scan the QR code:
- Click "Can't scan the QR code?"
- System displays secret key (e.g.,
JBSWY3DPEHPK3PXP) - User manually enters this key in authenticator app
- Complete verification as normal
Supported Authenticator Apps
PentestPad supports TOTP (Time-based One-Time Password) compatible applications:
Recommended Apps
Google Authenticator
- Platforms: iOS, Android
- Features: Simple, reliable, free
- Best for: Basic 2FA needs
Microsoft Authenticator
- Platforms: iOS, Android
- Features: Backup, multi-device sync, passwordless login
- Best for: Microsoft ecosystem users
Authy
- Platforms: iOS, Android, Desktop, Chrome
- Features: Cloud backup, multi-device sync, encrypted backups
- Best for: Users who want desktop access
1Password
- Platforms: Cross-platform
- Features: Integrated password + TOTP management, secure sharing
- Best for: Teams using password managers
LastPass Authenticator
- Platforms: iOS, Android
- Features: One-tap verification, backup
- Best for: LastPass users
Any TOTP App Works
PentestPad uses the standard TOTP protocol (RFC 6238), so any compatible authenticator application will work.
Backup Codes
Understanding Backup Codes
Backup codes are one-time use recovery codes generated during 2FA setup:
Characteristics:
- Typically 10 codes provided at setup
- Each code can only be used once
- 8-10 characters long
- Can be used instead of authenticator app
- Remain valid until used or regenerated
When to Use Backup Codes
Use backup codes when:
- Lost or broken phone with authenticator app
- Authenticator app not working or corrupted
- Device not available (traveling, etc.)
- Need emergency access to account
- Switching to a new phone
How to Use a Backup Code
- Navigate to PentestPad login page
- Enter username and password
- When prompted for 2FA code, click "Use backup code"
- Enter one of your saved backup codes
- Log in successfully
- Immediately reconfigure 2FA in account settings
Best Practice
After using a backup code, set up 2FA again with your current device and generate new backup codes.
User Self-Service Reset
Users can reset their own 2FA using backup codes (see Backup Codes section above).
Troubleshooting Common Issues
User Cannot Scan QR Code
Solutions:
- Provide manual entry option - show secret key
- Check camera permissions on mobile device
- Try different authenticator app
- Ensure good lighting when scanning
- Move phone closer/farther from screen
Time Sync Issues
Problem: Codes not working even though entered correctly
Solution:
- Verify device time is accurate (not off by minutes)
- Enable automatic time sync on device:
- iOS: Settings > General > Date & Time > Set Automatically
- Android: Settings > System > Date & time > Automatic
- Check timezone is correct
- Try waiting for next code cycle (codes refresh every 30 seconds)
Codes Not Accepted
Troubleshooting steps:
- Verify correct time on device
- Check for typos - codes are case-sensitive
- Ensure using code from correct account in authenticator
- Wait for code to refresh (they expire quickly)
- Check if Caps Lock is on
- Try backup codes if codes consistently fail