Skip to content

stoffee/vault-autounseal-azurerm-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vault POC using Azure Key Vault


Prerequisites


Terraform Azure Provider Prerequisites

A service principal is an application within Azure Active Directory which can be used to authenticate. Service principals are preferable to running an app using your own credentials. Follow the instruction in the Terraform documentation to create a service principal and then configure in Terraform.

Tips:

IMPORTANT: Ensure that your Service Principal has appropriate permissions to provision virtual machines, networks, as well as Azure Key Vault. Refer to the Azure documentation.

Deployment Steps

  1. Clone this repo

    $ git clone https://github.com/stoffee/vault-autounseal-azurerm-poc.git
  2. Provide Azure credentials in the terraform.tfvars.example and save it as terraform.tfvars

    NOTE: Overwrite the Azure location or environment name in the terraform.tfvars as desired.

  3. Add the SSL Certs to the setup.tpl

  4. Run the Terraform commands:

    # Pull necessary plugins
    $ terraform init
    
    $ terraform plan
    
    # Output provides the SSH instruction
    $ terraform apply -auto-approve
    ...
    Apply complete! Resources: 12 added, 0 changed, 0 destroyed.
    
    Outputs:
    
    ip = 52.151.16.65
    key_vault_name = poc-vault-90ad5386
    ssh-addr =
    Connect to your virtual machine via SSH:
    
    $ ssh -i ssh/private/key/location azureuser@52.151.16.65
  5. SSH into the virtual machine:

    $ ssh -i ssh/private/key/location azureuser@52.151.16.65
  6. Find your Root Token and Recovery Key

    $ cat /opt/vault/setup/vault.unseal.info

Clean up

Run terraform destroy when you are done exploring:

$ terraform destroy -auto-approve

$ rm -rf .terraform terraform.tfstate*

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published