- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
Implement HashiCorp Vault Authentication to MariaDB
As part of this hands-on lab, we will need to set up and configure a MariaDB server, and create a database. Then, we will need to enable a vault to generate credentials, which will allow a user to access the newly created database.
Lab Info
Table of Contents
-
Challenge
Unseal the Vault and Log in with the Root Token
- Retrieve the vault keys.
- Unseal the vault.
- Log in with the
Initial Root Token.
-
Challenge
Install a MariaDB Server and Configure Remote Access
- In the Database Server, install
mariadb-serverandmariadb-client. - Start and enable
mariadb.service. - Secure the server.
- Test Local Access to the MariaDB server.
- Exit the server.
- In the Database Server, open the
50-server.cnffile. - Configure remote access.
- Restart
mariadb.service. - Install
net-tools. - Verify the changes.
- In the Database Server, install
-
Challenge
Create `my_database` and Configure a User for Access
- In the Database Server, log in to the database.
- Create a new
databasenamed,my_database. - Create a
tablenamedtest_table, and populate it with generic content. - Verify that the table was created successfully.
- Create a second
tablenamed,another_table.
-
Challenge
Grant Vault Access to the Database and Create a User with Access to the `test_table`
- In the Vault Server, enable a
databasesecrets engine. - In the Vault Server, grant access to the database.
- Create a user with access to the
test_table. - Create a
policyfile with read-only access to the database. - Write the
policy. - Create a
tokenwith thepolicy. - Save the
tokenfor later use.
- In the Vault Server, enable a
-
Challenge
Get the Credentials and Test it Out
- In the Vault Server, retrieve the
Domainname. - In the
Clientserver, installjq. - Install
mariadb-client. - Request the credentials and copy the
passwordandusername. - From the
Clientserver attempt to authenticate against the database with the newly created credentials. - Access the database.
- Fetch the data from
test_table. - Attempt to
selectdata fromanother_table.
- In the Vault Server, retrieve the
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.