How to securely provide ssl keystore and key passwords











up vote
1
down vote

favorite












I use ssl keystores for Jetty 9 and Kafka. I need to provide keystore and key passwords to access the keystore and private key. However, I don't want to provide these passwords in clear text in the configuration files. What other options are there to securely provide/encrypt the passwords? what is the pros and cons of each approach?










share|improve this question




























    up vote
    1
    down vote

    favorite












    I use ssl keystores for Jetty 9 and Kafka. I need to provide keystore and key passwords to access the keystore and private key. However, I don't want to provide these passwords in clear text in the configuration files. What other options are there to securely provide/encrypt the passwords? what is the pros and cons of each approach?










    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I use ssl keystores for Jetty 9 and Kafka. I need to provide keystore and key passwords to access the keystore and private key. However, I don't want to provide these passwords in clear text in the configuration files. What other options are there to securely provide/encrypt the passwords? what is the pros and cons of each approach?










      share|improve this question















      I use ssl keystores for Jetty 9 and Kafka. I need to provide keystore and key passwords to access the keystore and private key. However, I don't want to provide these passwords in clear text in the configuration files. What other options are there to securely provide/encrypt the passwords? what is the pros and cons of each approach?







      apache-kafka jetty keystore jks






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 7 at 16:00









      Joakim Erdfelt

      32.2k45695




      32.2k45695










      asked Aug 7 at 15:51









      Mulugeta Ayalew Tamiru

      162




      162
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          Since Kafka 2.0.0, all password configs can be preloaded in zookeeper before you start brokers. The kafka-configs.sh tool can be used to store passwords in an encrypted format in Zookeeper avoiding the need to specify them in plaintext in the properties file.



          See the Updating Broker Configs section in the Kafka docs, especially the "Updating Password Configs in ZooKeeper Before Starting Brokers" paragraph.






          share|improve this answer





















          • Thanks Michael. Could you may be direct me to an example of how to do this? Thanks
            – Mulugeta Ayalew Tamiru
            Aug 9 at 12:27










          • Have you read the documentation I linked in my answer? If so what is not clear?
            – Mickael Maison
            Aug 11 at 15:54










          • How to I know the listener.name.{listenerName} or how do I set it?
            – Mulugeta Ayalew Tamiru
            Aug 13 at 10:02










          • It's the name of the listeners you have set in listeners. For example, if you have listeners=PLAINTEXT://:9092 then PLAINTEXT is a listener name
            – Mickael Maison
            Aug 13 at 10:32










          • Thanks. I ran the config command, however I am getting an error ERROR Dynamic password config listener.name.SSL.ssl.truststore.password could not be decoded, ignoring. (kafka.server.DynamicBrokerConfig) Aug 13 11:31:50 available-kafka-03 kafka[31050]: org.apache.kafka.common.config.ConfigException: Password encoder secret not configured even though I have specified password.encoder.secret in the command. Any thougths on this?
            – Mulugeta Ayalew Tamiru
            Aug 13 at 11:38


















          up vote
          0
          down vote













          Yes. It is mandatory to add password encoder in server.properties,
          otherwise server can not decode password.



          It works for me when I add password.encoder.secret to server.properties.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51730893%2fhow-to-securely-provide-ssl-keystore-and-key-passwords%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            Since Kafka 2.0.0, all password configs can be preloaded in zookeeper before you start brokers. The kafka-configs.sh tool can be used to store passwords in an encrypted format in Zookeeper avoiding the need to specify them in plaintext in the properties file.



            See the Updating Broker Configs section in the Kafka docs, especially the "Updating Password Configs in ZooKeeper Before Starting Brokers" paragraph.






            share|improve this answer





















            • Thanks Michael. Could you may be direct me to an example of how to do this? Thanks
              – Mulugeta Ayalew Tamiru
              Aug 9 at 12:27










            • Have you read the documentation I linked in my answer? If so what is not clear?
              – Mickael Maison
              Aug 11 at 15:54










            • How to I know the listener.name.{listenerName} or how do I set it?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 10:02










            • It's the name of the listeners you have set in listeners. For example, if you have listeners=PLAINTEXT://:9092 then PLAINTEXT is a listener name
              – Mickael Maison
              Aug 13 at 10:32










            • Thanks. I ran the config command, however I am getting an error ERROR Dynamic password config listener.name.SSL.ssl.truststore.password could not be decoded, ignoring. (kafka.server.DynamicBrokerConfig) Aug 13 11:31:50 available-kafka-03 kafka[31050]: org.apache.kafka.common.config.ConfigException: Password encoder secret not configured even though I have specified password.encoder.secret in the command. Any thougths on this?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 11:38















            up vote
            0
            down vote













            Since Kafka 2.0.0, all password configs can be preloaded in zookeeper before you start brokers. The kafka-configs.sh tool can be used to store passwords in an encrypted format in Zookeeper avoiding the need to specify them in plaintext in the properties file.



            See the Updating Broker Configs section in the Kafka docs, especially the "Updating Password Configs in ZooKeeper Before Starting Brokers" paragraph.






            share|improve this answer





















            • Thanks Michael. Could you may be direct me to an example of how to do this? Thanks
              – Mulugeta Ayalew Tamiru
              Aug 9 at 12:27










            • Have you read the documentation I linked in my answer? If so what is not clear?
              – Mickael Maison
              Aug 11 at 15:54










            • How to I know the listener.name.{listenerName} or how do I set it?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 10:02










            • It's the name of the listeners you have set in listeners. For example, if you have listeners=PLAINTEXT://:9092 then PLAINTEXT is a listener name
              – Mickael Maison
              Aug 13 at 10:32










            • Thanks. I ran the config command, however I am getting an error ERROR Dynamic password config listener.name.SSL.ssl.truststore.password could not be decoded, ignoring. (kafka.server.DynamicBrokerConfig) Aug 13 11:31:50 available-kafka-03 kafka[31050]: org.apache.kafka.common.config.ConfigException: Password encoder secret not configured even though I have specified password.encoder.secret in the command. Any thougths on this?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 11:38













            up vote
            0
            down vote










            up vote
            0
            down vote









            Since Kafka 2.0.0, all password configs can be preloaded in zookeeper before you start brokers. The kafka-configs.sh tool can be used to store passwords in an encrypted format in Zookeeper avoiding the need to specify them in plaintext in the properties file.



            See the Updating Broker Configs section in the Kafka docs, especially the "Updating Password Configs in ZooKeeper Before Starting Brokers" paragraph.






            share|improve this answer












            Since Kafka 2.0.0, all password configs can be preloaded in zookeeper before you start brokers. The kafka-configs.sh tool can be used to store passwords in an encrypted format in Zookeeper avoiding the need to specify them in plaintext in the properties file.



            See the Updating Broker Configs section in the Kafka docs, especially the "Updating Password Configs in ZooKeeper Before Starting Brokers" paragraph.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 8 at 8:56









            Mickael Maison

            6,73032529




            6,73032529












            • Thanks Michael. Could you may be direct me to an example of how to do this? Thanks
              – Mulugeta Ayalew Tamiru
              Aug 9 at 12:27










            • Have you read the documentation I linked in my answer? If so what is not clear?
              – Mickael Maison
              Aug 11 at 15:54










            • How to I know the listener.name.{listenerName} or how do I set it?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 10:02










            • It's the name of the listeners you have set in listeners. For example, if you have listeners=PLAINTEXT://:9092 then PLAINTEXT is a listener name
              – Mickael Maison
              Aug 13 at 10:32










            • Thanks. I ran the config command, however I am getting an error ERROR Dynamic password config listener.name.SSL.ssl.truststore.password could not be decoded, ignoring. (kafka.server.DynamicBrokerConfig) Aug 13 11:31:50 available-kafka-03 kafka[31050]: org.apache.kafka.common.config.ConfigException: Password encoder secret not configured even though I have specified password.encoder.secret in the command. Any thougths on this?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 11:38


















            • Thanks Michael. Could you may be direct me to an example of how to do this? Thanks
              – Mulugeta Ayalew Tamiru
              Aug 9 at 12:27










            • Have you read the documentation I linked in my answer? If so what is not clear?
              – Mickael Maison
              Aug 11 at 15:54










            • How to I know the listener.name.{listenerName} or how do I set it?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 10:02










            • It's the name of the listeners you have set in listeners. For example, if you have listeners=PLAINTEXT://:9092 then PLAINTEXT is a listener name
              – Mickael Maison
              Aug 13 at 10:32










            • Thanks. I ran the config command, however I am getting an error ERROR Dynamic password config listener.name.SSL.ssl.truststore.password could not be decoded, ignoring. (kafka.server.DynamicBrokerConfig) Aug 13 11:31:50 available-kafka-03 kafka[31050]: org.apache.kafka.common.config.ConfigException: Password encoder secret not configured even though I have specified password.encoder.secret in the command. Any thougths on this?
              – Mulugeta Ayalew Tamiru
              Aug 13 at 11:38
















            Thanks Michael. Could you may be direct me to an example of how to do this? Thanks
            – Mulugeta Ayalew Tamiru
            Aug 9 at 12:27




            Thanks Michael. Could you may be direct me to an example of how to do this? Thanks
            – Mulugeta Ayalew Tamiru
            Aug 9 at 12:27












            Have you read the documentation I linked in my answer? If so what is not clear?
            – Mickael Maison
            Aug 11 at 15:54




            Have you read the documentation I linked in my answer? If so what is not clear?
            – Mickael Maison
            Aug 11 at 15:54












            How to I know the listener.name.{listenerName} or how do I set it?
            – Mulugeta Ayalew Tamiru
            Aug 13 at 10:02




            How to I know the listener.name.{listenerName} or how do I set it?
            – Mulugeta Ayalew Tamiru
            Aug 13 at 10:02












            It's the name of the listeners you have set in listeners. For example, if you have listeners=PLAINTEXT://:9092 then PLAINTEXT is a listener name
            – Mickael Maison
            Aug 13 at 10:32




            It's the name of the listeners you have set in listeners. For example, if you have listeners=PLAINTEXT://:9092 then PLAINTEXT is a listener name
            – Mickael Maison
            Aug 13 at 10:32












            Thanks. I ran the config command, however I am getting an error ERROR Dynamic password config listener.name.SSL.ssl.truststore.password could not be decoded, ignoring. (kafka.server.DynamicBrokerConfig) Aug 13 11:31:50 available-kafka-03 kafka[31050]: org.apache.kafka.common.config.ConfigException: Password encoder secret not configured even though I have specified password.encoder.secret in the command. Any thougths on this?
            – Mulugeta Ayalew Tamiru
            Aug 13 at 11:38




            Thanks. I ran the config command, however I am getting an error ERROR Dynamic password config listener.name.SSL.ssl.truststore.password could not be decoded, ignoring. (kafka.server.DynamicBrokerConfig) Aug 13 11:31:50 available-kafka-03 kafka[31050]: org.apache.kafka.common.config.ConfigException: Password encoder secret not configured even though I have specified password.encoder.secret in the command. Any thougths on this?
            – Mulugeta Ayalew Tamiru
            Aug 13 at 11:38












            up vote
            0
            down vote













            Yes. It is mandatory to add password encoder in server.properties,
            otherwise server can not decode password.



            It works for me when I add password.encoder.secret to server.properties.






            share|improve this answer



























              up vote
              0
              down vote













              Yes. It is mandatory to add password encoder in server.properties,
              otherwise server can not decode password.



              It works for me when I add password.encoder.secret to server.properties.






              share|improve this answer

























                up vote
                0
                down vote










                up vote
                0
                down vote









                Yes. It is mandatory to add password encoder in server.properties,
                otherwise server can not decode password.



                It works for me when I add password.encoder.secret to server.properties.






                share|improve this answer














                Yes. It is mandatory to add password encoder in server.properties,
                otherwise server can not decode password.



                It works for me when I add password.encoder.secret to server.properties.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 22 at 18:16









                Ivan Aracki

                1,63832540




                1,63832540










                answered Nov 22 at 16:49









                Jaaouane Aymen

                1




                1






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51730893%2fhow-to-securely-provide-ssl-keystore-and-key-passwords%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    What visual should I use to simply compare current year value vs last year in Power BI desktop

                    Alexandru Averescu

                    Trompette piccolo