Skip to main content

Connect secrets managers

Your security team has a rule: credentials live in the vault, and nothing else keeps a copy. A security tool that demands its own copy of every token is an awkward first conversation.

So do not give Dwaar a copy. Connect your secrets manager, and other connections can read their credentials from it each time they need them. Dwaar keeps no copy of a vault secret.

Connect HashiCorp Vault​

This works with Vault, OpenBao and HCP Vault, using AppRole.

Prerequisites​

  • A role that holds integrations:create.
  • A Vault address reachable from Dwaar over https.
  • An AppRole with a read-only policy on the paths Dwaar may use.

Steps​

  1. Open Integrations, choose HashiCorp Vault, and name the connection.
  2. Enter the values below and press Test connection.
FieldRequiredValue
Server URLYesFor example https://vault.acme.com:8200.
NamespaceNoThe Vault Enterprise or HCP namespace, for example admin/platform. Leave empty otherwise.
AppRole mountNoWhere the AppRole auth method is mounted, for example approle.
KV v2 mountNoThe KV version 2 secrets engine Dwaar reads from, for example secret.
Role IDYesThe AppRole role_id.
Secret IDYesThe AppRole secret_id. Dwaar seals it and only uses it to log in to your Vault.

Connect AWS Secrets Manager​

Method: IAM role, using the same external id flow as AWS accounts.

Prerequisites​

  • A role that holds integrations:create.
  • Permission to create an IAM role in the AWS account.

Steps​

  1. Open Integrations, choose AWS Secrets Manager, then Add connection.
  2. Follow the guide beside the form, Create a read-only IAM role for Secrets Manager. It offers Open CloudFormation quick-create, with your values filled in, or the policies to create the role by hand.
  3. Enter the values below and press Test connection.

The stack creates the role dwaar-secrets-read, which may only read secrets whose names start with dwaar/. Keep your secrets under another prefix? Change SecretNamePrefix in the stack's Parameters before you create it.

FieldRequiredValue
Role ARNYesFor example arn:aws:iam::<account-id>:role/dwaar-secrets-read. It must trust Dwaar's principal with your external id and allow secretsmanager:GetSecretValue on the secrets Dwaar may read, plus kms:Decrypt through Secrets Manager if their key is customer-managed.

Test connection proves Dwaar can assume the role. It does not read a secret yet: a secret is read the first time a connection that uses it is tested or runs. | Region | Yes | The region of the secrets. Add one connection per region. |

Scope secretsmanager:GetSecretValue to specific secrets. Do not grant it on everything just because that is faster.

Use a vault secret in another connection​

Once a secrets manager is connected, connect forms that take a secret offer two sources: Enter value and From vault.

  1. On the other connection's form, set the source to From vault.
  2. Choose the vault connection.
  3. Enter where the secret lives.
SourceWhereWhich field
HashiCorp VaultPath in the vault's KV v2 mount, for example dwaar/githubKey: the field inside the secret that holds the value
AWS Secrets ManagerSecret name or ARN in the connection's region, for example prod/dwaar/githubJSON key (optional): the key of a JSON secret. Leave empty for a plain-text secret.

A secrets manager's own login cannot come from a vault. Something has to be the first credential.

What you should see​

The connection's Credential row says it is read from your vault each time Dwaar uses it. Rotate the secret in your vault and Dwaar picks up the new value on its next read.

Match Dwaar's reads to your audit log​

The Access tab on a secrets manager connection lists every read Dwaar made, with its request id.

For Vault, Dwaar also sends that id in the X-Dwaar-Request-Id header. Add the header to Vault's audited request headers, and you can match each row to your Vault audit log. Your auditors can then check Dwaar's list of reads against yours, rather than taking anyone's word for it.

Try this next​

Connect Vault, then move one existing token into it and replace that connection's credential using From vault. Run Test connection, then check the Access tab. You should see the read. Once you have seen it work once, move the rest.