- Lab
- A Cloud Guru
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.
Path 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-server
andmariadb-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.cnf
file. - 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
database
named,my_database
. - Create a
table
namedtest_table
, and populate it with generic content. - Verify that the table was created successfully.
- Create a second
table
named,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
database
secrets engine. - In the Vault Server, grant access to the database.
- Create a user with access to the
test_table
. - Create a
policy
file with read-only access to the database. - Write the
policy
. - Create a
token
with thepolicy
. - Save the
token
for later use.
- In the Vault Server, enable a
-
Challenge
Get the Credentials and Test it Out
- In the Vault Server, retrieve the
Domain
name. - In the
Client
server, installjq
. - Install
mariadb-client
. - Request the credentials and copy the
password
andusername
. - From the
Client
server attempt to authenticate against the database with the newly created credentials. - Access the database.
- Fetch the data from
test_table
. - Attempt to
select
data fromanother_table
.
- In the Vault Server, retrieve the
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.