[JIRA] (JENKINS-61938) Can aws-secrets-manager-credentials-provider-plugin be configured to use a credential binding for authentication?

8 views
Skip to first unread message

fakemailred888@gmail.com (JIRA)

unread,
Apr 16, 2020, 5:55:04 PM4/16/20
to jenkinsc...@googlegroups.com
red der created an issue
 
Jenkins / New Feature JENKINS-61938
Can aws-secrets-manager-credentials-provider-plugin be configured to use a credential binding for authentication?
Issue Type: New Feature New Feature
Assignee: Chris Kilding
Components: aws-secrets-manager-credentials-provider-plugin
Created: 2020-04-16 21:54
Environment: Jenkins cjoc on GKE
Priority: Minor Minor
Reporter: red der

It seems like the AWS-secrets-manager-credentials-provider-plugin plugin assumes your running on EC2 (with a role) or have injected aws creds via env vars directly into the master's session

Id like to just configure access via a credential binding like I can for most of the other plugins

So I can tell the aws-secrets-manager-credentials-provider-plugin which cred binding to use which has AWS access keys with read access to Secrets Manager

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

chris+jenkins@chriskilding.com (JIRA)

unread,
Apr 17, 2020, 11:34:02 AM4/17/20
to jenkinsc...@googlegroups.com
Chris Kilding commented on New Feature JENKINS-61938
 
Re: Can aws-secrets-manager-credentials-provider-plugin be configured to use a credential binding for authentication?

Hi red,

The plugin is designed the way it is because most Jenkins installations will be in the same AWS account as their secrets, and because moving Jenkins further from the secrets imposes steep costs. It will be most secure if it authenticates using IAM instance profiles (EC2) or fine-grained service roles (EKS), and it will be most reliable if it can access Secrets Manager within Amazon's internal network, so both these things are encouraged.

When Jenkins is run in a different cloud from Secrets Manager, the costs become apparent:

  • Jenkins can't use IAM instance profiles, so you must provision an AWS access key pair for Jenkins, and then guard that key pair closely, because if it is stolen then the attacker can access every secret that Jenkins can access.
  • Jenkins can't access Secrets Manager through Amazon's network, so its Secrets Manager connection is at the mercy of the public Internet. You can improve this somewhat by establishing an AWS PrivateLink between Jenkins and Secrets Manager, but it still won't be as good.

No code in this plugin can solve the data locality problem, as it arises from your cloud architecture, and can only be properly addressed by altering your cloud architecture. So before going the multi-cloud route, consider if you can:

  • Co-locate CJOC with the secrets (move CJOC to EC2 or EKS).
  • Co-locate the secrets with CJOC (move the secrets that CJOC needs to Google Cloud; this will only work if CJOC is the only user of those secrets).

If none of the above options work then you will need to use the "escape hatch" of passing the AWS key pair to the CJOC container through environment variables or system properties.

chris+jenkins@chriskilding.com (JIRA)

unread,
Apr 17, 2020, 11:35:02 AM4/17/20
to jenkinsc...@googlegroups.com

I have looked at having the plugin depend on the AWS Global Configuration plugin, which allows an AWS key pair credential to be selected in the Jenkins UI.

Unfortunately it needs a good cleanup to make it more generic (I think it was extracted from the S3 plugin, and this shows), before I could use it as a dependency.

chris+jenkins@chriskilding.com (JIRA)

unread,
Apr 17, 2020, 11:36:03 AM4/17/20
to jenkinsc...@googlegroups.com
Chris Kilding edited a comment on New Feature JENKINS-61938
I have looked at having the plugin depend on the AWS Global Configuration plugin, which allows an AWS key pair credential to be selected in the Jenkins UI.
This would be the most appropriate place to get the AWS credential from, as the user would only have to specify it once for all their AWS-using plugins.

Unfortunately it needs a good cleanup to make it more generic (I think it was extracted from the S3 plugin, and this shows), before I could use it as a dependency.
Reply all
Reply to author
Forward
0 new messages