-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Minio Client AWS Auth only supports Access Keys; Add Options to Credential Chain #32271
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
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
Thank you for your issue. We don't backport enhancements/features such as this, but we hope to release 1.23 this quarter, which would allow you to use this in a non-nightly version. |
Hello, thank you for the quick response! We have given the The first discovery is that the credential process workaround was not working immediately, but found it was due to this line the Minio SDK that is imported - https://github.com/minio/minio-go/blob/master/pkg/credentials/file_aws_credentials.go#L113 Since it’s checking for two arguments, we just added a dummy string afterwards and it worked perfectly to authenticate without the use of Access Keys. Working example:
Ideally it should be checking with Secondly, while reviewing the code again I realized I have misinterpreted what this line actually does, I now see this is a reference to the entire file from the Minio SDK, not just that one “EKSPodIdentity” function I mentioned originally. However, this does not work out of the box when trying this on the To summarize the issue here, it is trying to receive credentials using the normal EC2 Metadata endpoint with the identity file rather than the STS endpoint. Proposed SolutionTo work around the hard coded EC2 Metadata endpoint, we have the following idea:
We’ll try and work on a PR that accomplishes our proposal, but wanted to get this update out first. |
Thanks for that detailed followup @vkice-at-ocp :) |
…32581) Targeting issue #32271 This modification allows native Kubernetes + AWS (EKS) authentication with the Minio client, to Amazon S3 using the IRSA role assigned to a Service account by replacing the hard coded reference to the `DefaultIAMRoleEndpoint` with an optional configurable endpoint. Internally, Minio's `credentials.IAM` provider implements a discovery flow for IAM Endpoints if it is not set. For backwards compatibility: - We have added a configuration mechanism for an `IamEndpoint` to retain the unit test safety in `minio_test.go`. - We believe existing clients will continue to function the same without needing to provide a new config property since the internals of Minio client also often resolve to the `http://169.254.169.254` default endpoint that was being hard coded before To test, we were able to build a docker image from source and, observe it choosing the expected IAM endpoint, and see files uploaded via the client.
Our PR was merged in to resolve our issue, closing! |
Uh oh!
There was an error while loading. Please reload this page.
Feature Description
Objective
We propose the following features added to the Gitea release cycle (
release/v1.22
):main
branch into the current release cyclegetEKSPodIdentityCredentials
to this credential chain at the end, this way native Kubernetes authentication is handled.Details
We have deployed Gitea using the Helm Chart on our AWS EKS cluster. We’ve been able to stand it up with supporting infrastructure and figure out configurations, but we’ve discovered that the implementation of the Minio client under the Gitea release branch is only looking at AWS Access Keys (long term credentials) for authentication with AWS. The recommended best practice from AWS prefers relying on temporary credentials instead of long-term credentials, such as access keys where possible.
We hope to see implementation of short-lived tokens to authenticate the Minio client with AWS APIs, as this would provide better security and simplified implementation.
FileAwsCredentials
, which would allow us to be able to move off of access keys - https://github.com/go-gitea/gitea/blob/main/modules/storage/minio.go#L174-L192aws_session_token
via the Web Identity Token fileExpanding on the credential chain, this currently does not import other supported features from the
minio-go
SDK. Notably, as we are on AWS EKS, the ideal solution we were hoping to implement is using IRSA roles which would allow direct usage of the token file generated by the Service Account.AWS_WEB_IDENTITY_TOKEN_FILE
is set on the pods associated with our service account, pointing to the web identity token - https://github.com/minio/minio-go/blob/cca410398dd20409180d4ff2d017e34bea17c27c/pkg/credentials/iam_aws.go#L124-L127References
Current release for minio client, only contains access keys not the credential chain - https://github.com/go-gitea/gitea/blob/v1.22.3/modules/storage/minio.go#L88-L92
Main branch, this calls the credential chain - https://github.com/go-gitea/gitea/blob/main/modules/storage/minio.go#L99-L105
Found here, and contains the
FileAwsCredentials
, which allows us to use credential_process to convert our web identity token -> session token - https://github.com/go-gitea/gitea/blob/main/modules/storage/minio.go#L174-L192This is the Minio-Go SDK code, where ideally we'd like to see this EKS function imported as well - https://github.com/minio/minio-go/blob/cca410398dd20409180d4ff2d017e34bea17c27c/pkg/credentials/iam_aws.go#L318
Which directly looks at the env variable to grab our web identity token, as defined by associated a Kubernetes Service Account paired with an AWS IAM role - https://github.com/minio/minio-go/blob/cca410398dd20409180d4ff2d017e34bea17c27c/pkg/credentials/iam_aws.go#L124-L127
Screenshots
No response
The text was updated successfully, but these errors were encountered: