Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.14.0 breaks AWS EKS IRSA credentials for DynamoDB backend #21465

Closed
SeanKnight opened this issue Jun 27, 2023 · 12 comments · Fixed by #21951
Closed

v1.14.0 breaks AWS EKS IRSA credentials for DynamoDB backend #21465

SeanKnight opened this issue Jun 27, 2023 · 12 comments · Fixed by #21951
Assignees
Labels
auth/aws ecosystem helmchart Helm chart for deploying Vault on Kubernetes. Also consider hashicorp/vault-helm storage/dynamodb

Comments

@SeanKnight
Copy link

Describe the bug

Startup logs:

2023-06-27T00:36:30.759Z [INFO]  proxy environment: http_proxy="" https_proxy="" no_proxy=""
Error initializing storage of type dynamodb: NoCredentialProviders: no valid providers in chain. Deprecated.
    For verbose messaging see aws.Config.CredentialsChainVerboseErrors

To Reproduce

Steps to reproduce the behavior:

  1. Install vault on EKS cluster via helm chart (0.23.0 or 0.25.0) using image tag 1.14.0

Expected behavior
Vault starts up like it did on version 1.13.4

Environment:

  • Vault Server Version (retrieve with vault status): 1.14.0
  • Vault CLI Version (retrieve with vault version): n/a
  • Server Operating System/Architecture: linux/amd64

Vault server configuration excerpt:

storage "dynamodb" {
  ha_enabled = "true"
  region = "us-west-2"
  table = "vault"
}

Helm values excerpt:

server:
  image:
    repository: "hashicorp/vault"
    tag: "1.14.0"
  serviceAccount:
    annotations:
      "eks.amazonaws.com/role-arn": MY_ROLE_ARN

Additional context
Image tag 1.13.4 works but 1.14.0 does not

Possibly related since the version of hashicorp/go-secure-stdlib has changed in go.mod for vault 1.14.0:

@mpalmi mpalmi added auth/aws storage/dynamodb helmchart Helm chart for deploying Vault on Kubernetes. Also consider hashicorp/vault-helm labels Jun 27, 2023
@pjain-fastly
Copy link

We are running into the same issue and would appreciate a resolution. The new support for ACME is a feature we have been waiting for, since a long time.

@ubajze
Copy link

ubajze commented Jun 27, 2023

We are running into the similar issue after upgrading from 1.13 to 1.14, but in our case the seal configuration is causing problems:

vault Error parsing Seal configuration: error fetching AWS KMS wrapping key information: NoCredentialProviders: no valid providers in chain. Deprecated.
vault     For verbose messaging see aws.Config.CredentialsChainVerboseErrors

The issue #21478 mentions a workaround, but it is not working for us.

@ubajze
Copy link

ubajze commented Jun 27, 2023

@SeanKnight Based on #21478 you may need to add role_arn and web_identity_token_file to your configuration block.

@dave4086
Copy link

dave4086 commented Jun 28, 2023

I added both role_arn and web_identity_token_file to the storage config block (example of config below) and am still receiving role assumption errors. Vault is trying to use the worker node role rather than the role that is passed in through the role_arn setting.

storage "dynamodb" {
    ha_enabled = "true"
    table = "vault-dynamo-table"
    region = "us-east-1"
    role_arn = "arn:aws:iam::012345678901:role/nonprod-vault-role"
    web_identity_token_file = "/var/run/secrets/eks.amazonaws.com/serviceaccount/token"
 }

@SeanKnight
Copy link
Author

@ubajze adding role_arn and web_identity_token_file did not work. I'm not even getting to the unseal stage because storage is not loading.

@DeepakRai94
Copy link

DeepakRai94 commented Jun 30, 2023

We have exactly the same issue,

I tried to add, role_arn and web_identity_token_file to the both storage config block and awskms block but still getting role assumption errors.

Error initializing storage of type dynamodb: AccessDeniedException: User: arn:aws:sts:::assumed-role/node-role is not authorized to perform: dynamodb:DescribeTable on resource: arn:aws:dynamodb:eu-west-1::table/vault because no identity-based policy allows the dynamodb:DescribeTable action

storage "dynamodb" {
    ha_enabled = "true"
    table = "vault-dynamo-table"
    region = "eu-east-1"
    # Fixes for Vault 1.14+
    role_arn = "arn:aws:iam::<account ID>:role/<role name>"
    web_identity_token_file = "/var/run/secrets/eks.amazonaws.com/serviceaccount/token"
 }

seal "awskms" {
  region     = "eu-east-1"
  kms_key_id = "######"

  # Fixes for Vault 1.14+
  role_arn = "arn:aws:iam::<account ID>:role/<role name>"
  web_identity_token_file = "/var/run/secrets/eks.amazonaws.com/serviceaccount/token"
}

@ddanijel
Copy link

ddanijel commented Jul 3, 2023

Getting exactly the same error. Vault pods are ignoring the IRSA and using the node role. We have to use the IRSA because of multi-tenancy. Hope you can prioritize this issue.

@mtavaresmedeiros
Copy link

same thing here, the vault pods are ignoring the IRSA.
Vault 1.14.0

@jbouse
Copy link

jbouse commented Jul 5, 2023

I'm seeing this error as well and find it odd that the suggested fixes are to include the role_arn and web_identity_token_file settings directly to this seems to indicate that with the upgrade to 1.14.0 Vault has decided to no longer look for and/or acknowledge the env variables AWS_ROLE_ARN and AWS_WEB_IDENTITY_TOKEN_FILE that are recognized by the AWS SDK.

@fairclothjm
Copy link
Contributor

Hello and thanks for reporting. We will be looking into this issue soon. I will post any updates here as soon as I get them.

@fulcrum29
Copy link

Ran into the same issue. Any resolution in sight?

@bdwyertech
Copy link

The issue is because of how awsutil is used to derive credentials. The NewCredentialsConfig constructor method needs to be called instead of starting with an empty struct. the logic to determine which method to use to derive credentials has been moved from GenerateCredentialChain to NewCredentialsConfig.

  1. The go-kms-wrapping library needs to be fixed to fix the KMS auto unseal.
    hashicorp/go-kms-wrapping@0b76b18

  2. Vault itself needs to be updated to call NewCredentialsConfig instead of sucking in an empty struct.

See #21930

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth/aws ecosystem helmchart Helm chart for deploying Vault on Kubernetes. Also consider hashicorp/vault-helm storage/dynamodb
Projects
None yet
Development

Successfully merging a pull request may close this issue.