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

Feature Request: add support for AWS IAM Roles for Service Account #400

Open
oridool opened this issue Jan 4, 2021 · 1 comment
Open

Comments

@oridool
Copy link

oridool commented Jan 4, 2021

Hi,
I'd like the exporter to connect to a managed AWS Elasticsearch, and to assume IAM Role rather than specify a username+password. I've configured the cluster to work with IAM roles rather than users.
If the POD is running in EKS, AWS credentials can be fetched using IAM Roles for Service Account (IRSA):
https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html

Is it possible to add such support to this project?

Thank you.

@nimi-ummer
Copy link

nimi-ummer commented Apr 24, 2024

@steveteuber For IRSA implementation with least privileges the use of aws.role-arn throws the below error:
caller=roundtripper.go:61 msg="failed to retrive aws credentials" err="operation error STS: AssumeRole, https response error StatusCode: 403
AWS role:

     "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::<account>:oidc-provider/oidc.eks.<aws-region>.amazonaws.com/id/<id>"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "<oidc>:sub": [
                        "system:serviceaccount:<namespace>:<serviceaccount>"                        
                    ],
                    "<oidc>:aud": "sts.amazonaws.com"
                }
            }
        }
    ]

policy:

    "Statement": [
        {
            "Action": [
                "es:ESHttpPut",
                "es:ESHttpPost",
                "es:ESHttpPatch",
                "es:ESHttpHead",
                "es:ESHttpGet",
                "es:ESHttpDelete"
            ],
            "Effect": "Allow",
            "Resource": "arn:aws:es:<opensearch-domain>/*"
        }
    ],
   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants