Book Image

WildFly Cookbook

Book Image

WildFly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Securing and protecting passwords using a vault


In this recipe, you will learn how to secure and protect our password, still providing them to our WildFly configuration. The vault is a place where you store passwords, encrypted using a keystore. For our recipe, we will create a keystore and store a password used to connect to the MySQL database. MySQL installation is out of the scope of this book; if you need more information, refer to the MySQL documentation site at https://dev.mysql.com/doc/refman/5.5/en/installing.html.

Getting ready

To get started, let's first create an ad-hoc folder to run our WildFly:

  1. In a terminal window run the following commands:

    $ cd $WILDFLY_HOME
    $ cp -a standalone sec-std-cfg-node-3

    Now it's time to create our keystore.

  2. Within the same terminal window, execute the following:

    $ cd $WILDFLY_HOME
    $ cd sec-std-cfg-node-3/configuration
    $ mkdir vault
    $ cd vault
    $ keytool -v -genkey -alias wildfly.vault -keyalg RSA -keysize 2048 -sigalg SHA1withRSA -keystore wildfly.vault...