Can't use IAM role for AWS Secrets Manager
Affected module backend
Describe the bug We are trying to use AWS Secrets Manager as backend for secrects in OpenMetadata, we have chosen type: managed-aws and during the bootrap for the openmetadata pod, it is trying to move all existing secrets from local vault to AWS SM. Unfortunately, we can see error that we don't give enough permissions to put secrets in AWS service. We created special service account that has IAM role associated, but in the logs it looks like that role is not even used and only the role from EC2 instance where pod is running. Anyone has successfully configure openmetadata in k8s with service account + iam role (IIRSA)?
We use the same service account and IAM role for ingesting s3 and it works (proper IAM role is in-use). Moreover, during the bootstrap we exec to the pod and installed aws-cli and with this proper IAM role is used, we checked it by aws sts get-caller-identity It looks like the adoption of AWS SDK is working differently and it doesn't take into account associated IAM role with pod.
Error:
DEBUG [2023-08-09 09:28:06,776] [main] o.a.h.wire - http-outgoing-1 << "{"__type":"AccessDeniedException","Message":"User: arn:aws:sts::AWS_ACCOUNT_ID:assumed-role/<EC2_ROLE_NAME> is not authorized to perform: secretsmanager:CreateSecret on resource: /openmetadata/database/test/authtype/password because no identity-based policy allows the secretsmanager:CreateSecret action"}"
Most probably, this is related to this thread: https://github.com/aws/aws-sdk-java-v2/issues/1470 and the solution might be adding dependency to sts library
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>sts</artifactId>
</dependency>
To Reproduce
- Setup k8s service account with IAM role annotation
- Enable managed-aws secrets in Openmetadata
Expected behavior No problems with access to AWS Secrets Manager
Version:
- OpenMetadata version: 1.1.0
- OpenMetadata Ingestion package version: [e.g.
openmetadata-ingestion[docker]==XYZ]
Additional context Add any other context about the problem here.
I am facing same problem, can this be prioritized in the next release?
Hello, got something similar. The sts library is part of this pull-request: https://github.com/open-metadata/OpenMetadata/pull/11913
@pmbrull anything we need to do here with recent changes
@tutte if you can please chip in here
@Michalosu @ArtyomyuS can you confirm if you still have this issue?
Pere: to add context here, we're internally using the Secrets Manager with EKS roles without any complications. Happens out of the box
Closing this. If you're still facing the issue, feel free to reach out in Slack. Since we use the exact same EKS Secrets Management method, the error might come from the configuration