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

Support for passphrase protected certificate keys

Details

    • New Feature
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • 25.08
    • N/A
    • None

    Description

      Feature - External Script for SSL Password

      • So that I can maintain security on my SSL certificate,
      • As a MaxScale user,
      • I want MaxScale to run an external script that provides the SSL password.

      Acceptance Test - Script Execution for SSL Password

      • Given MaxScale is configured to use an SSL certificate that requires a password
      • And an external script is available to provide the SSL password
      • When MaxScale starts or reloads its configuration
      • Then MaxScale runs the external script to retrieve the SSL password
      • And MaxScale uses the retrieved SSL password to unlock the SSL certificate

      Acceptance Test - Handling Script Execution Failure

      • Given MaxScale is configured to use an SSL certificate that requires a password
      • And an external script is available to provide the SSL password
      • When MaxScale starts or reloads its configuration
      • And the external script fails to execute or returns an error
      • Then MaxScale logs the error indicating the failure to retrieve the SSL password
      • And MaxScale does not start or continue loading the configuration

      Acceptance Test - Logging Successful Script Execution

      • Given MaxScale is configured to use an SSL certificate that requires a password
      • And an external script is available to provide the SSL password
      • When MaxScale successfully executes the external script
      • Then MaxScale logs a message indicating the successful retrieval of the SSL password
      • And MaxScale uses the retrieved SSL password to unlock the SSL certificate

      Acceptance Test - Security of SSL Password

      • Given MaxScale is configured to use an SSL certificate that requires a password
      • And an external script is available to provide the SSL password
      • When MaxScale retrieves the SSL password from the external script
      • Then the SSL password is not stored in plaintext in any logs or configuration files
      • And the SSL password is only used in-memory to unlock the SSL certificate

      Background

      Maxscale should support TLS certificates with password / passphrase protected keys.

      I haven't tested how it would deal with such keys, but I assume it would "suffer" from the same TLS library default behavior as the MariaDB server and would try to prompt the user for passwords / passphrases, so breaking automated service startups when faced with such keys.

      What makes things more complicated here is that unlike the server Maxscale does not only have to deal with a single certificate, but can have different certificates per server, listener, and for the REST API. Also the same key may be used in multiple places.

      Attachments

        Issue Links

          Activity

            JoeCotellese Joe Cotellese (Inactive) added a comment - - edited

            UPDATE: Ah, it's the "Integration" field.

            I don't remember why and I can't find it in Airfocus. julien.fritsch how do I find things in Airfocus by Jira ticket ID? I can see the other Jira fields in my filter, just not the ID.

            JoeCotellese Joe Cotellese (Inactive) added a comment - - edited UPDATE: Ah, it's the "Integration" field. I don't remember why and I can't find it in Airfocus. julien.fritsch how do I find things in Airfocus by Jira ticket ID? I can see the other Jira fields in my filter, just not the ID.

            Ok, I don't know why it's closed but according to the last comment on the Airfocus ticket "This isn't documented so according to Julien it's a new feature."

            JoeCotellese Joe Cotellese (Inactive) added a comment - Ok, I don't know why it's closed but according to the last comment on the Airfocus ticket "This isn't documented so according to Julien it's a new feature."
            hholzgra Hartmut Holzgraefe added a comment - - edited

            Well, I filed it as a feature request in the first place. So yes, new feature.

            Similar to MDEV-14091 on the server side, which I mentioned in an earlier comment, but forgot to add as a "related to" link.

            hholzgra Hartmut Holzgraefe added a comment - - edited Well, I filed it as a feature request in the first place. So yes, new feature. Similar to MDEV-14091 on the server side, which I mentioned in an earlier comment, but forgot to add as a "related to" link.

            See my proof-of-concept patch on MDEV-14091, I basically mimicked the way the PosgreSQL server does it. It's unfortunately not too well documented in the PostgreSQL manual yet

            https://www.postgresql.org/docs/current/runtime-config-connection.html#id-1.6.7.6.5.3.13.1.3

            but there's also e.g.:

            https://www.2ndquadrant.com/en/blog/postgresql-passphrase-protected-ssl-keys-systemd/

            which describes it rather well.

            By delegating the task to provide the password / passphrase to an external process any additional complexity is up to the user, similar to how we have it with auth_pam_tool for PAM authentication.

            hholzgra Hartmut Holzgraefe added a comment - See my proof-of-concept patch on MDEV-14091 , I basically mimicked the way the PosgreSQL server does it. It's unfortunately not too well documented in the PostgreSQL manual yet https://www.postgresql.org/docs/current/runtime-config-connection.html#id-1.6.7.6.5.3.13.1.3 but there's also e.g.: https://www.2ndquadrant.com/en/blog/postgresql-passphrase-protected-ssl-keys-systemd/ which describes it rather well. By delegating the task to provide the password / passphrase to an external process any additional complexity is up to the user, similar to how we have it with auth_pam_tool for PAM authentication.
            JoeCotellese Joe Cotellese (Inactive) added a comment - - edited

            Re: Storing the password in a secure manner.

            Can we encrypt the passphrase johan.wikman with a user provide salt?

            What I am thinking is if the user provides a salt in the configuration, any parameters we need to encrypt could use that salt.

            JoeCotellese Joe Cotellese (Inactive) added a comment - - edited Re: Storing the password in a secure manner. Can we encrypt the passphrase johan.wikman with a user provide salt? What I am thinking is if the user provides a salt in the configuration, any parameters we need to encrypt could use that salt.
            johan.wikman Johan Wikman added a comment -

            Off the top of my head, I don't see why not.

            johan.wikman Johan Wikman added a comment - Off the top of my head, I don't see why not.

            People

              Unassigned Unassigned
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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