Password Security Configuration
The password security section in mineLogin allows server administrators to configure various aspects of password handling and security. These settings are crucial for protecting user accounts and maintaining the overall security of your server.
Here's the relevant section from the configuration file:
passwords-security:
hash-type: BCRYPT
delete-password-after-change-account-type: true
salt-for-passwords: false
password-restrictions:
minimum-password-length: 6
maximum-password-length: 16
regex: ^[a-zA-Z0-9!%&#@*]*
disallowed-passwords:
- password
- password123
- haslo123
- haslo1
- dick123
- pussy1
- pussy123
Options Explained
Hashing Algorithm
yamlhash-type: BCRYPT
- Purpose: Specifies the algorithm used for hashing passwords.
- Options: BCRYPT, SHA512, SHA256, MD5
- Recommendation: BCRYPT is the most secure option among these.
Password Deletion on Account Type Change
yamldelete-password-after-change-account-type: true
- Purpose: Determines whether to delete the password from the database when a player changes their account type (e.g., from cracked to premium).
- Values:
true
orfalse
- Security Implication: Enhances security by removing potentially unnecessary stored passwords.
Password Salting
yamlsalt-for-passwords: false
- Purpose: Enables or disables the use of salt in password hashing.
- Values:
true
orfalse
- Note: Modern hashing algorithms like BCRYPT include salting by default, so this may be redundant if using BCRYPT.
Password Restrictions
yamlpassword-restrictions: minimum-password-length: 6 maximum-password-length: 16 regex: ^[a-zA-Z0-9!%&#@*]*
minimum-password-length
: Sets the minimum number of characters required for passwords.maximum-password-length
: Sets the maximum number of characters allowed for passwords.regex
: Defines a regular expression pattern that passwords must match.
Disallowed Passwords
yamldisallowed-passwords: - password - password123 - haslo123 - haslo1 - dick123 - pussy1 - pussy123
- Purpose: Lists specific passwords that are not allowed to be used.
- Format: A list of strings representing banned passwords.
Best Practices
Hashing Algorithm
- Use BCRYPT as it's designed for password hashing and includes built-in salting.
- Avoid MD5 as it's considered cryptographically broken.
Password Deletion
- Keep
delete-password-after-change-account-type
enabled for enhanced security.
- Keep
Password Restrictions
- Set a reasonable minimum length (8-12 characters is common).
- Don't set the maximum length too low; longer passwords can be more secure.
- Use a regex that enforces a mix of characters (e.g., requiring uppercase, lowercase, numbers, and symbols).
Disallowed Passwords
- Regularly update the list of disallowed passwords.
- Include common weak passwords, keyboard patterns, and terms related to your server.
Implementation Tips
Educate Users
- Provide guidelines for creating strong passwords.
- Explain the importance of unique passwords for each service.
Password Strength Meter
- Consider implementing a visual password strength meter during registration.
Regular Security Audits
- Periodically review and update your password security settings.
Two-Factor Authentication
- Encourage or require 2FA for an additional layer of security.
Handling Existing Passwords
- If changing hashing algorithms, implement a system to rehash passwords upon next login.
Example Enhanced Configuration
passwords-security:
hash-type: BCRYPT
delete-password-after-change-account-type: true
salt-for-passwords: false
password-restrictions:
minimum-password-length: 10
maximum-password-length: 64
regex: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{10,64}$
disallowed-passwords:
- password
- 123456789
- qwerty123
- minecraft
- yourservername
- admin1234
This configuration:
- Uses BCRYPT for secure hashing.
- Requires passwords to be 10-64 characters long.
- Enforces the use of uppercase, lowercase, numbers, and special characters.
- Includes server-specific terms in the disallowed passwords list.
Remember to restart your server or reload the plugin after making changes to these settings. Always test new security configurations thoroughly before applying them to a live server.