datastax / vault-plugin-secrets-datastax-astra

HashiCorp Vault Plugin for Datstax Astra
Apache License 2.0
8 stars 6 forks source link

vault-plugin-secrets-datastax-astra

This HashiCorp Vault plugin provides token lifecycle management for DataStax Astra DB. Due to the nature of the Astra DB object hierarchy, API tokens are not tied to users and do not currently have descriptions. It's easy to lose track of what tokens are being used for what purpose and who is using them. HashiCorp Vault allows you to associate metadata with a token (such as user who created it, what it's being users for) and additionally logs who's access the tokens to ensure token ownership and usage can be well understood. The DataStax Astra DB plugin for HashiCorp Vault functionality includes:

For more, see the expanded docs topic.

Prerequisites

Install the vault plugin into an existing vault

Download the plugin binary for your OS from:

https://github.com/datastax/vault-plugin-secrets-datastax-astra/releases/tag/v0.1.0

Ensure the plugin is installed in the vault/plugins/vault-plugin-secrets-datastax-astra folder.

Or, build the plugin from source.

go build -o vault/plugins/vault-plugin-secrets-datastax-astra cmd/vault-plugin-secrets-datastax-astra/main.go

Enable the plugin in your vault instance.

vault secrets enable -path=astra vault-plugin-secrets-datastax-astra

Configure the plugin

Add root tokens for each Astra DB org:

vault write astra/config org_id="<YOUR ORG ID>" astra_token="<YOUR APP TOKEN>" url="https://api.astra.datastax.com" logical_name="<YOUR LOGICAL NAME>"

List the created org/token configs:

vault list astra/configs

Use the installed token to automatically generate Vault roles from Astra DB roles:

 sh vault/plugins/vault-plugin-secrets-datastax-astra/update_roles.sh

List the roles created:

vault list astra/roles

Use Vault to create a new Astra DB token:

vault write astra/org/token org_id=<YOUR ORG ID> role_name="<YOUR ROLE NAME>"

Next steps

For more, see the expanded docs topic.