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

Encrypt/Remove kubeconfig secrets from build output #15

Open
dtzar opened this issue May 29, 2017 · 8 comments
Open

Encrypt/Remove kubeconfig secrets from build output #15

dtzar opened this issue May 29, 2017 · 8 comments

Comments

@dtzar
Copy link

dtzar commented May 29, 2017

When you use the general 2.x task it outputs the entire contents of the kubeconfig file to the build log/output in VSTS. We should not have this for security reasons.

@TsuyoshiUshio
Copy link
Owner

1.x is the same. Let's encode the kubecnfig file into Base64. Then it will be solved. See 5.1. Create an endopint on the README. :)

@TsuyoshiUshio
Copy link
Owner

Can I close this issue?

@dtzar
Copy link
Author

dtzar commented Jun 12, 2017

I imagine there is a way to either:

  1. Encrypt the contents of kube config since Base64 can easily be decoded: http://www.hashemian.com/tools/base64-encode-decode.php --> "Base64 decoding employs a reverse algorithm to yield the original content. While Base64 encoding alters the original content, it is not suitable as an encryption mechanism as it can be easily decoded to reveal the original content."
    or
  2. Remove the output of the kube config from the build log.

@rakelkar
Copy link
Collaborator

rakelkar commented Jun 13, 2017 via email

@dtzar
Copy link
Author

dtzar commented Jun 13, 2017

Not sure - somewhere here https://github.com/TsuyoshiUshio/KubernetesTask/blob/master/kubectl.ts I imagine with the kubeconfig.

@rakelkar
Copy link
Collaborator

rakelkar commented Jun 13, 2017 via email

@TsuyoshiUshio
Copy link
Owner

I don't know why. But I realised that if you have multiple lines of the parameter, vsts prints from the second line. VSTS doesn't print the first line. I should report to the VSTS production team about it.

The log is automatically out.
https://github.com/TsuyoshiUshio/KubernetesTask/blob/master/kubectl.ts#L31

@TsuyoshiUshio
Copy link
Owner

TsuyoshiUshio commented Jun 14, 2017

@dtzar It seems automatically printout when I use this.

this.kubeconfig = tl.getEndpointAuthorizationParameter(this.endpoint, 'kubeconfig', true);

I can't avoid it. However, this line smells. I'll investigate it.

https://github.com/Microsoft/vsts-task-lib/blob/master/node/task.ts#L364

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

3 participants