Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon

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.

Google Cloud Platform icon

Path Info

Clock icon Intermediate
Clock icon 1h 0m
Clock icon Oct 23, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Unseal the Vault and Log in with the Root Token

    1. Retrieve the vault keys.
    2. Unseal the vault.
    3. Log in with the Initial Root Token.
  2. Challenge

    Install a MariaDB Server and Configure Remote Access

    1. In the Database Server, install mariadb-server and mariadb-client.
    2. Start and enable mariadb.service.
    3. Secure the server.
    4. Test Local Access to the MariaDB server.
    5. Exit the server.
    6. In the Database Server, open the 50-server.cnf file.
    7. Configure remote access.
    8. Restart mariadb.service.
    9. Install net-tools.
    10. Verify the changes.
  3. Challenge

    Create `my_database` and Configure a User for Access

    1. In the Database Server, log in to the database.
    2. Create a new database named, my_database.
    3. Create a table named test_table, and populate it with generic content.
    4. Verify that the table was created successfully.
    5. Create a second table named, another_table.
  4. Challenge

    Grant Vault Access to the Database and Create a User with Access to the `test_table`

    1. In the Vault Server, enable a database secrets engine.
    2. In the Vault Server, grant access to the database.
    3. Create a user with access to the test_table.
    4. Create a policy file with read-only access to the database.
    5. Write the policy.
    6. Create a token with the policy.
    7. Save the token for later use.
  5. Challenge

    Get the Credentials and Test it Out

    1. In the Vault Server, retrieve the Domain name.
    2. In the Client server, install jq.
    3. Install mariadb-client.
    4. Request the credentials and copy the password and username.
    5. From the Client server attempt to authenticate against the database with the newly created credentials.
    6. Access the database.
    7. Fetch the data from test_table.
    8. Attempt to select data from another_table.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans