Skip to main content

AWS Secrets Manager

Keep secret values in AWS Secrets Manager. Read Secret stores first for how stores, Resolve on and the default store work.

What you need​

SettingDescription
RegionThe region of your secrets, e.g. eu-west-1
AuthenticationAccess key or IAM role (see below)

Entry names are secret names or ARNs, e.g. prod/stripe. Key/value secrets created in the AWS console are JSON; read one field with #: prod/db#password.

IAM permissions​

Read only (worker-pool stores, or references to existing secrets):

{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": ["secretsmanager:GetSecretValue"],
"Resource": "arn:aws:secretsmanager:eu-west-1:123456789012:secret:prod/*"
}]
}

To let Blokkio also create, update and delete secrets (values typed into Blokkio, connection credentials of the default store), add secretsmanager:PutSecretValue, secretsmanager:CreateSecret, secretsmanager:TagResource and secretsmanager:DeleteSecret for blokkio-* and the names you use. Secrets encrypted with a customer managed KMS key also need kms:Decrypt on that key.

Resolve on Blokkio cloud​

Access key. Create an IAM user with the policy above, then Security credentials → Create access key. Enter the access key ID and the secret access key in Blokkio. The secret access key is encrypted and never shown again.

IAM role (recommended). Blokkio assumes a role in your account; no long-lived key leaves AWS.

  1. Create a role with the policy above.

  2. Set its trust policy to allow Blokkio's AWS account and require the External ID shown in the store dialog (blokkio- followed by your workspace ID). The external ID stops other Blokkio customers from using your role:

    {
    "Version": "2012-10-17",
    "Statement": [{
    "Effect": "Allow",
    "Principal": { "AWS": "arn:aws:iam::<BLOKKIO_ACCOUNT_ID>:root" },
    "Action": "sts:AssumeRole",
    "Condition": { "StringEquals": { "sts:ExternalId": "blokkio-<your workspace id>" } }
    }]
    }
  3. Enter the role ARN in Blokkio and click Test connection.

Replace <BLOKKIO_ACCOUNT_ID> with the AWS account the Blokkio services run in. If Test connection says No AWS credentials were found, use an access key instead.

Resolve on your worker pool​

The worker uses the AWS default credential chain of its machine: AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY, a profile, IRSA / EKS Pod Identity, the ECS task role or the EC2 instance profile. Choose:

AuthenticationWhat the worker needs
Worker's IAM role / default credentialsRun the worker with a role that has the read policy. Optionally enter a Role ARN: the worker then assumes that role with its own credentials
Access key in the worker's environmentAWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY on the worker container

Behaviour​

  • Blokkio writes plain-string secrets tagged managed-by: blokkio. Deleting a secret Blokkio created schedules its deletion with a 7-day recovery window.
  • Binary secrets are returned base64-encoded.
  • Blokkio always reads the AWSCURRENT version.

Test it live​

Blokkio's automated tests mock AWS. To try a real account you need: a region, and either an IAM user's access key or a role ARN whose trust policy allows Blokkio with the external ID; plus one secret to reference (e.g. a key/value secret to read with #field). For worker-pool stores, a worker on EC2/ECS/EKS with a role that has secretsmanager:GetSecretValue.

Troubleshooting​

MessageWhat to do
AWS denied access (AccessDenied)Add the actions above to the policy, for the secret's ARN
AWS rejected the access keyCheck the access key ID and secret access key; the key may be inactive
Assuming the AWS role failedCheck the role ARN and the trust policy (principal and external ID)
AWS couldn't decrypt the secretGrant kms:Decrypt on the secret's KMS key
No AWS credentials were foundOn a worker: give it a role or set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY