User Management Guide¶
This guide covers user administration in KrakenHashes, including user roles, authentication, multi-factor authentication (MFA), and security policies.
Table of Contents¶
- User Roles and Permissions
- Creating and Managing Users
- Password Policies and Requirements
- Multi-Factor Authentication Management
- Session Management
- User Deactivation and Deletion
- Audit Logging and User Activity
User Roles and Permissions¶
KrakenHashes implements a role-based access control (RBAC) system with the following roles:
User Roles¶
- User (default role)
- View and manage their own profile
- Submit password cracking jobs
- View their own job results
- Manage their own MFA settings
-
Access general system features
-
Admin
- All user permissions plus:
- View and manage all users
- Reset user passwords
- Enable/disable user accounts
- Modify system settings
- View all jobs and results
- Manage agents and vouchers
-
Access admin dashboard
-
System (special role)
- Reserved for system operations
- Cannot be assigned to regular users
- Cannot be modified or disabled
Permission Matrix¶
Action | User | Admin | System |
---|---|---|---|
View own profile | ✓ | ✓ | ✓ |
Edit own profile | ✓ | ✓ | ✓ |
View all users | ✗ | ✓ | ✓ |
Manage users | ✗ | ✓ | ✗ |
System settings | ✗ | ✓ | ✗ |
View all jobs | ✗ | ✓ | ✓ |
Creating and Managing Users¶
User Creation¶
Currently, users are created through the registration process. Admin creation of users is not directly implemented but can be achieved through the following methods:
- Self-Registration (if enabled)
- Users register themselves through the web interface
-
Email verification may be required
-
Admin-Initiated Registration
- Admin provides registration link to new users
- User completes registration process
User Management Operations¶
Listing Users¶
Admins can view all users through the admin dashboard: - Navigate to Admin → Users - Filter by role (admin, user) - View user details including: - Username and email - Role - Account status (enabled/disabled) - MFA status - Last login time
User Management page displaying the user accounts table with columns for Username, Email, Role, Status, MFA status, and Last Login information
Updating User Information¶
Admins can update: - Username - Email address - User role (user ↔ admin)
Note: System users cannot be modified.
Resetting User Passwords¶
Admins can reset user passwords in two ways:
- Temporary Password
- System generates a secure temporary password
- Password must be changed on next login
-
Share password securely with user
-
Custom Password
- Admin sets a specific password
- Must meet password policy requirements
- User should change on next login
Password Policies and Requirements¶
Default Password Requirements¶
The system enforces configurable password policies:
- Minimum Length: 8 characters (configurable)
- Character Requirements (configurable):
- Uppercase letters
- Lowercase letters
- Numbers
- Special characters
Password Policy Configuration¶
Admins can configure password policies via: 1. Navigate to Admin → Settings → Authentication 2. Adjust password requirements:
{
"minPasswordLength": 8,
"requireUppercase": true,
"requireLowercase": true,
"requireNumbers": true,
"requireSpecialChars": true
}
Password Security Features¶
- Passwords are hashed using bcrypt with default cost
- Password history tracking
- Last password change timestamp
- Forced password change capability
Multi-Factor Authentication Management¶
MFA Overview¶
KrakenHashes supports multiple MFA methods:
- Email-based MFA (default)
- 6-digit codes sent via email
- Configurable code validity period
-
Built-in cooldown between requests
-
Authenticator App (TOTP)
- Compatible with Google Authenticator, Authy, etc.
- SHA-512 algorithm
- 30-second time window
-
6-digit codes
-
Backup Codes
- 8 single-use recovery codes (configurable)
- Generated when MFA is enabled
- Can be regenerated by user
Global MFA Settings¶
Admins can configure MFA requirements:
- Mandatory MFA
- Require all users to enable MFA
- Configurable allowed methods
-
Email gateway must be configured first
-
MFA Configuration Options
User MFA Management¶
Enabling MFA for a User¶
Users can enable MFA through their profile: 1. Navigate to Profile → Security 2. Choose MFA method 3. Complete verification process 4. Save backup codes
User Profile Settings interface displaying account information, password change functionality, and MFA controls that reflect the authentication policies configured by administrators
Admin MFA Operations¶
Admins can: - View user MFA status - Disable MFA for a user (if not globally required) - Reset MFA settings in case of lockout
MFA Authentication Flow¶
- User enters username/password
- System validates credentials
- If MFA enabled, prompt for code
- User provides code via preferred method
- System validates code with retry limits
- Grant access upon successful verification
Session Management¶
Session Security Features¶
- JWT-based Authentication
- Configurable token expiry (default: 7 days)
- Secure HTTP-only cookies
-
Refresh token support
-
Account Security
- Failed login attempt tracking
- Automatic account lockout after threshold
- Configurable lockout duration
- Admin unlock capability
Session Configuration¶
{
"maxFailedAttempts": 5,
"lockoutDurationMinutes": 30,
"jwtExpiryMinutes": 10080, // 7 days
"sessionTimeout": 60 // minutes of inactivity
}
Managing User Sessions¶
Account Lockout¶
When a user exceeds failed login attempts: 1. Account is automatically locked 2. User sees lockout message with duration 3. Admin can manually unlock via Admin → Users → Unlock
Session Monitoring¶
- Last login timestamp tracked
- Failed login attempts counted
- Last failed attempt timestamp
- Account lock status and duration
User Deactivation and Deletion¶
Account Deactivation¶
Admins can disable user accounts:
- Disable Account
- User cannot log in
- Requires disable reason
- Tracks who disabled and when
- Account data preserved
-
Can be re-enabled later
-
Enable Account
- Restores account access
- Clears disable reason
- User can log in again
Important Considerations¶
- System users cannot be disabled
- Disabled users' data remains intact
- Active sessions are not immediately terminated
- User deletion is not implemented (data retention)
Deactivation Process¶
- Navigate to Admin → Users
- Select user to disable
- Click "Disable Account"
- Provide reason for audit trail
- Confirm action
To re-enable: 1. Find disabled user 2. Click "Enable Account" 3. User can now log in
Audit Logging and User Activity¶
User Activity Tracking¶
The system tracks the following user activities:
- Authentication Events
- Login attempts (successful/failed)
- MFA verification attempts
- Password changes
-
Account lockouts
-
Account Modifications
- Profile updates
- MFA changes
- Password resets
-
Role changes
-
Administrative Actions
- User account modifications
- Password resets by admin
- Account enable/disable
- MFA resets
Audit Information Captured¶
For each auditable event: - Timestamp - User ID performing action - Target user ID (if applicable) - Action type - Additional context (e.g., disable reason) - IP address (where applicable)
Accessing Audit Logs¶
While a dedicated audit log viewer is not yet implemented, audit information is stored in the database:
- Login tracking via
last_login
andfailed_login_attempts
- Account changes via
disabled_by
,disabled_at
,disabled_reason
- Password changes via
last_password_change
Security Best Practices¶
- Regular Reviews
- Review user list for inactive accounts
- Check for users with excessive privileges
-
Monitor failed login patterns
-
MFA Enforcement
- Consider mandatory MFA for admin users
- Regular review of MFA methods in use
-
Ensure email gateway configured for email MFA
-
Password Policies
- Enforce strong password requirements
- Consider regular password rotation for admins
-
Monitor for compromised credentials
-
Account Hygiene
- Disable accounts promptly when users leave
- Regular review of admin role assignments
- Document reasons for account actions
Troubleshooting Common Issues¶
MFA Issues¶
Problem: User locked out of MFA - Solution: Admin can disable MFA for user, user re-enables
Problem: Email codes not received - Solution: Check email gateway configuration, verify email address
Problem: Authenticator app out of sync - Solution: Verify system time, consider increasing TOTP skew tolerance
Account Access Issues¶
Problem: User account locked - Solution: Admin unlocks account or wait for lockout duration
Problem: Password reset not working - Solution: Verify password meets policy requirements
Problem: Cannot modify system user - Solution: System users are protected and cannot be modified
Configuration Issues¶
Problem: Cannot enable global MFA - Solution: Configure email gateway first in Email Settings
Problem: Users bypassing MFA - Solution: Check global MFA requirement is enabled
API Endpoints Reference¶
For programmatic access, the following admin endpoints are available:
GET /api/admin/users
- List all usersGET /api/admin/users/{id}
- Get user detailsPUT /api/admin/users/{id}
- Update userPOST /api/admin/users/{id}/disable
- Disable accountPOST /api/admin/users/{id}/enable
- Enable accountPOST /api/admin/users/{id}/reset-password
- Reset passwordPOST /api/admin/users/{id}/disable-mfa
- Disable MFAPOST /api/admin/users/{id}/unlock
- Unlock account
All endpoints require admin authentication via JWT token.