-
Notifications
You must be signed in to change notification settings - Fork 43
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
AWS EKS 1.24 client is not respecting jenkins-master pod role #263
Comments
Seems to be duplicate of #172 but that issue was closed and it seems not resolved |
It looks like the role is injected from the AWS environment. I'm just wondering if somehow AWS might be changing the environment under the hood in some cases, which might change the role used. If you wanted to debug this, you could potentially set the role to use explicitly in the plugin's configuration: unclassified:
awsCredentialsProvider:
client:
credentialsProvider:
assumeRole:
roleArn: "arn:aws:iam::111111111111:role/foo"
roleSessionName: "jenkins" This should hopefully keep it locked into the role you specify. |
@chriskilding I've tried that - but than I'm getting other error that |
When this error occurs, how are you accessing the credentials? (It can make a difference where you do this from.) E.g. are you viewing the credentials in the Web UI (i.e. the |
@chriskilding I'm trying to access credentials in Web UI first. |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
[root@ip-10-128-1-192 /]# cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"
Reproduction steps
Have jenkins pod running with attached role
kubectl describe pod jenkins-0 -n jenkins | grep AWS_ROLE AWS_ROLE_ARN: arn:aws:iam::000000000:role/service/eks/eks-cluster-jenkins-master-role
But when I try to get access to Secrets Manager it is using node-group role
2023-02-01 20:50:31.880+0000 [id=330] WARNING i.j.p.c.s.AwsCredentialsProvider#getCredentials: Could not list credentials in Secrets Manager: message=[User: arn:aws:sts::000000000:assumed-role/eks-node-group-20230123082959723000000001/i-0259469284873172d is not authorized to perform: secretsmanager:ListSecrets because no identity-based policy allows the secretsmanager:ListSecrets action (Service: AWSSecretsManager; Status Code: 400; Error Code: AccessDeniedException; Request ID: f9393b18-b391-4ac7-bacd-8f9442fd7861; Proxy: null)]
Expected Results
Plugin is using jenkins-master role arn:aws:iam::000000000:role/service/eks/eks-cluster-jenkins-master-role
Actual Results
As node-group role don't have needed permissions plugin can't read secretes from Secrets Manager
Anything else?
No response
The text was updated successfully, but these errors were encountered: