Skip to content

Conversation

@netfalo
Copy link
Contributor

@netfalo netfalo commented Sep 10, 2019

When the jenkins master is running on Kubernetes the authentication can be done using a Kubernetes service account token.

fixes #18

Jenkins master running on kubernetes can use a service account token
to authenticate with vault.

public class VaultKubernetesCredential extends AbstractVaultTokenCredential {

private static final String SERVICE_ACCOUNT_TOKEN_PATH = "/var/run/secrets/kubernetes.io/serviceaccount/token";
Copy link
Member

@jetersen jetersen Sep 10, 2019

Choose a reason for hiding this comment

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

This path is not the same as it would be on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really know that. The windows container support in kubernetes is relatively new and after a quick search I couldn't find any documentation on how the volumes work in windows containers, but I guess as in any regular windows.
The service account token is just a regular secret, so technically it can be mounted on any path even in unix containers. But the Service Account Admission Controller, which manages service accounts in kubernetes, mounts the token on this path by default. link to the documentation

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this option should only be visible if kubernetes secret is detected?

Copy link
Member

Choose a reason for hiding this comment

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

Can be achieved with isApplicable in the descriptor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps this option should only be visible if kubernetes secret is detected?

Do you mean to only show the VaultKubernetesCredential as option, when the mounted token is detected?

Copy link
Member

Choose a reason for hiding this comment

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

Simply a suggestion, don't know if it makes sense. I am fine with the feature as is.

@marcoreni
Copy link
Contributor

Is there an ETA on merging/releasing this?

@jetersen
Copy link
Member

😅 I been super busy at work lately.

I'd be happy if someone wants to co-maintain the plugin!
In any case I'll look into getting a release done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants