Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Y24-012 Security related RT 798566 #4043

Open
TWJW-SANGER opened this issue Mar 4, 2024 · 4 comments
Open

Y24-012 Security related RT 798566 #4043

TWJW-SANGER opened this issue Mar 4, 2024 · 4 comments
Assignees
Labels
Size: M Medium - medium effort & risk Technical Debt Value: 5 Value to the insitute is very high

Comments

@TWJW-SANGER
Copy link

Describe the Housekeeping
See security related RT 798566

@stevieing stevieing added Size: M Medium - medium effort & risk Value: 5 Value to the insitute is very high labels Mar 7, 2024
@dasunpubudumal dasunpubudumal self-assigned this Apr 11, 2024
@dasunpubudumal
Copy link
Contributor

dasunpubudumal commented Apr 12, 2024

Dual Passwords for MySQL Reference: MySQL 8.3 Reference

@dasunpubudumal
Copy link
Contributor

dasunpubudumal commented Apr 15, 2024

The following procedure could be carried out for testing dual password feature (source referenced in #4043 (comment)) in a local MySQL 8.x database.

Note: Creating the user and updating grants are not a part of this story. These steps are purely for completion purposes of the procedure.

  1. Check the version of the database.
mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.3.0     |
+-----------+
1 row in set (0.01 sec)
  1. Create new user sample_user with password PASSWORD.
mysql> CREATE USER 'sample_user'@'localhost' IDENTIFIED BY 'PASSWORD';
  1. Check all users and privileges.
SELECT * FROM mysql.user;

This displays all users and privileges. The user sample_user has no privileges (i.e., privileges were not granted).

  1. Grant privileges for sample_user.
mysql> GRANT ALL ON *.* TO 'sample_user'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

Note that by providing all privileges, we're making this user as the same level as admin. We do this because the user needs to have APPLICATION_SUPPORT_ADMIN privilege to make it eligible for dual passwords.

  1. Attach a secondary password PASSWORD_2 for user sample_user.
ALTER USER 'sample_user'@'localhost' 
IDENTIFIED BY 'PASSWORD_2' 
RETAIN CURRENT PASSWORD;

This attaches another password PASSWORD_2 as the secondary password for the user account sample_user.


  1. Log in using PASSWORD_2 as the user's credential (i.e., the secondary password).
mysql -u sample_user -pPASSWORD_2;
  1. Log in using PASSWORD as the user's credential (i.e., the primary password).
mysql -u sample_user -pPASSWORD;
  1. Update the configurations of all consumer applications of the database.
  2. Deploy the configurations to UAT environment, and check application's functionality.
  3. Discard the old password.
ALTER USER 'sample_user'@'localhost'
  DISCARD OLD PASSWORD;

@dasunpubudumal
Copy link
Contributor

dasunpubudumal commented Apr 15, 2024

Identified that the following databases are in the host psdp-db:

barcode_warehouse
dba
delegated_user_management
labwhere_production
mixtio_production
mmonit_production
monitoring
print_my_barcode_production
process_tracking_production
samples_extraction_production
sequencescape_production
sequencescape_production_archive
sm_workflow_lims_production
sys
traction_production
traction_service_production
util

The following applications use the respective databases listed below.

Application Database Name
janitor labwhere_production
samples_extraction samples_extraction_production
asset_audits process_tracking_production
labwhere labwhere_production
print_my_barcode print_my_barcode_production
sequencescape sequencescape_production
sm_workflow sm_workflow_lims_production
traction-service traction_service_production

@dasunpubudumal
Copy link
Contributor

dasunpubudumal commented Apr 17, 2024

credentials project was updated with the latest KeePassXC database, with the new password for psdp user in psdp-db.

The grace period for switching off the old password begins today, and ends in one month's time i.e., on 18th May, 2024. When the grace period ends, please use the following query to discard the old password:

ALTER USER 'psdp'@'%' DISCARD OLD PASSWORD;

Make sure to log in to the SQL console with the psdp user for this.


Note: How dual password mechanism work is, when you invoke ALTER USER with RETAIN CURRENT PASSWORD, it makes the current password the secondary password and makes the new password primary. When invoking DISCARD OLD PASSWORD, it will remove the secondary password, making it invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: M Medium - medium effort & risk Technical Debt Value: 5 Value to the insitute is very high
Projects
None yet
Development

No branches or pull requests

3 participants