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

mlaunch: Use default SASL/SCRAM mechanisms when creating users. #880

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

matthewdale
Copy link
Contributor

Description of changes

There is currently a check that explicitly prevents creating a SCRAM-SHA-256 user credential for newer server versions. Remove that SASL/SCRAM default mechanism override now that all official MongoDB drivers support SASL/SCRAM mechanism SCRAM-SHA-256 (see DRIVERS-439).

Fixes #879

Testing

  1. Create a standalone deployment with auth enabled.
python3 mtools/mlaunch/mlaunch.py init \
    --dir ~/data/mtools/5.0.0 \
    --single \
    --binarypath $(m bin 5.0.0)  \
    --auth
  1. List user info and confirm that credentials for all default SASL/SCRAM mechanisms for MongoDB v5.0.0 are created (SCRAM-SHA-1, SCRAM-SHA-256).
mongosh "mongodb://user:password@localhost:27017/admin" --quiet --eval "db.system.users.find()"
[
  {
    _id: 'admin.user',
    userId: UUID("72e25aa8-a058-47a4-b83b-d7c856291511"),
    user: 'user',
    db: 'admin',
    credentials: {
      'SCRAM-SHA-1': {
        iterationCount: 10000,
        salt: <REDACTED>,
        storedKey: <REDACTED>,
        serverKey: <REDACTED>
      },
      'SCRAM-SHA-256': {
        iterationCount: 15000,
        salt: <REDACTED>,
        storedKey: <REDACTED>,
        serverKey: <REDACTED>
      }
    },
    roles: [
      { role: 'dbAdminAnyDatabase', db: 'admin' },
      { role: 'readWriteAnyDatabase', db: 'admin' },
      { role: 'userAdminAnyDatabase', db: 'admin' },
      { role: 'clusterAdmin', db: 'admin' }
    ]
  }
]

O/S testing:

O/S Version(s)
Linux
macOS 12.4
Windows

@stennie
Copy link
Collaborator

stennie commented Jul 18, 2022

Thanks @matthewdale !

@stennie stennie merged commit 7fcb8ef into rueckstiess:develop Jul 18, 2022
@stennie stennie added this to the 1.7.1 milestone Jul 18, 2022
@stennie stennie added the mlaunch label Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mlaunch: Confusing override of default SASL/SCRAM mechanisms when creating users
2 participants