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

Enable GCP Authentication #289

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Enable GCP Authentication #289

wants to merge 2 commits into from

Conversation

reedk-au
Copy link

@reedk-au reedk-au commented Jul 9, 2021

Fixes #280

Add a flag to source that will look for and use GCP application default credentials instead of using AWS credentials 0

Signed-off-by: Reed Kinning <[email protected]>
@reedk-au reedk-au marked this pull request as draft July 13, 2021 16:43
@reedk-au
Copy link
Author

Implementing the same on in and out, moved into draft status until completed. Comments and recommendations welcome in the meantime.

@reedk-au reedk-au marked this pull request as ready for review July 14, 2021 15:22
@chenbh
Copy link
Contributor

chenbh commented Jul 19, 2021

Hey, sorry for the late response.

I don't think this PR can be accepted in the current form, the reasoning is the same as the one in concourse/concourse#3023 and Aidan's comment in #287 (comment).

The tldr is that Concourse differentiates resources based on their source, and automagic metadata servers breaks this assumption. With this PR, if I have 2 worker nodes with different credentials, it is now possible for a check step to return different versions depending on which worker it was run on (if each VM's creds can see different GCR repos).

As an alternative, I would be open to something like the current AWS flow, where the authenticated session is constructed from credentials passed in from the source:

mySession := session.Must(session.NewSession(&aws.Config{
Region: aws.String(source.AwsRegion),
Credentials: credentials.NewStaticCredentials(source.AwsAccessKeyId, source.AwsSecretAccessKey, source.AwsSessionToken),
}))

Maybe you can do something similar by using google.CredentialsFromJSON and taking the TokenSource from there?

@@ -95,6 +96,8 @@ type Source struct {
DomainCerts []string `json:"ca_certs,omitempty"`

Debug bool `json:"debug,omitempty"`

GcpTokenSource *string `json:"gcp_token_source,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also need a corresponding README change

@reedk-au
Copy link
Author

No worries, thanks for the review @chenbh and this makes sense. Will see if we can get this to work and move this PR to a draft in the meantime.

@reedk-au reedk-au marked this pull request as draft July 21, 2021 15:27
@reedk-au reedk-au marked this pull request as ready for review December 8, 2021 03:31
@reedk-au reedk-au marked this pull request as draft December 8, 2021 03:32
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

Successfully merging this pull request may close these issues.

Google Container Registry authentication via oauth2 token
2 participants