Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-3080

Maxpasswd not generating hashes usable by maxctrl

    XMLWordPrintable

Details

    Description

      The passwords generated with maxpasswd do not seem to be working as expected. My workflow for testing is the following:

      • Run maxscale and have it generate a file in /var/lib/maxscale/passwd
      • Run maxctrl with defaults and verify it authenticates and is able to run commands.
      • Generate new secrets file with maxkeys
      • Generate a new password with maxpasswd
      • Update /var/lib/maxscale/passwd with that generated password and updating the username.
      • Restart maxscale service
      • Attempt to use maxctrl to connect to the server and specifying the password I used previously and the username I updated.

      And this is where it fails as shown in the copy-paste output below. (NOTE: This is from a Docker container I've been using for testing, but the same pathology is present on a development/utility VM as well).

      root@171308b5fa2c:~# grep PRETTY /etc/*ease
      /etc/os-release:PRETTY_NAME="Ubuntu 20.04 LTS"
      root@171308b5fa2c:~# maxscale -v
      MaxScale 2.5.1
      root@171308b5fa2c:~# grep PRETTY /etc/*ease
      /etc/os-release:PRETTY_NAME="Ubuntu 20.04 LTS"
      root@171308b5fa2c:~# rm /var/lib/maxscale/.secrets
      root@171308b5fa2c:~# maxkeys /var/lib/maxscale
      Permissions of '/var/lib/maxscale/.secrets' set to owner:read.
      Ownership of '/var/lib/maxscale/.secrets' given to maxscale.
      root@171308b5fa2c:~# maxpasswd /var/lib/maxscale MaxPass
      068B951BD90D96B46150A851196B298F86C3CB3A0ED67F3B8F394660CDEFB057
      root@171308b5fa2c:~# cat /var/lib/maxscale/passwd
      [{"name": "max_ctrl", "account": "admin", "password": "068B951BD90D96B46150A851196B298F86C3CB3A0ED67F3B8F394660CDEFB057"**}**]
      root@171308b5fa2c:~# cat /var/lib/maxscale/.secrets
      {
          "description": "MaxScale encryption/decryption key",
          "maxscale_version": "2.5.1",
          "encryption_cipher": "EVP_aes_256_cbc",
          "encryption_key": "2386942BCA718B99E677E71DA9174219584A8DECB0320516B275D55B8C76184D"
      }root@171308b5fa2c:~# maxctrl -u max_ctrl -p MaxPass list servers
      Error: Server at localhost:8989 responded with status code 401 to `GET servers`:{
          "errors": [
              {
                  "detail": "Access denied"
              }
          ]
      }
      root@171308b5fa2c:~#

      Attachments

        Activity

          People

            Unassigned Unassigned
            dylannorthrup Dylan Northrup
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.