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

Logging driver leaks a key generated by ovpn_getclient when used through "logspout"; a warning #189

Closed
vielmetti opened this issue Dec 31, 2016 · 3 comments · Fixed by #190

Comments

@vielmetti
Copy link
Contributor

vielmetti commented Dec 31, 2016

If you generate a key by running a command in a container, and if that container is set up to log data to some central logging system, then it can be possible to set up a situation where private keys leak out through the logs.

The command is ovpn_getclient, which puts data out to standard out:

% docker run -v ovpn-data-t2:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient USER > USER.ovpn

The logging system I'm using is gliderlabs/logspout, which is configured to send stdout and stderr for running containers into a central syslog system. Since ovpn_getclient does its thing through stdout, that data is logged through the standard Docker logging driver.

The simple fix I can see is to run the command in some way with logging disabled for that run, e.g.

docker run -v ovpn-data-t2:/etc/openvpn --log-driver=none --rm kylemanna/openvpn ovpn_getclient USER > USER.ovpn

of course that's also substandard because you're really wanting to generate some kind of a log when the client file is generated, but I can confirm that this didn't exit unwanted data to syslog.

The word of warning is that ovpn_getclient might generate some logs somewhere, and it would be good to look carefully to make sure they don't go somewhere unwanted.

@vielmetti
Copy link
Contributor Author

the source code includes a "combined-save" option that writes a file, but I don't readily see how to invoke it that way.

@kylemanna
Copy link
Owner

The stdout observation would be a good addition to the docs/paranoid.md. The combined-save is documented under docs/clients.md.

@vielmetti
Copy link
Contributor Author

Yup, I see a mention of combined-save at https://github.com/kylemanna/docker-openvpn/blob/master/docs/clients.md#client-configuration-mode - an example command line would be useful.

I'll send in a PR for the stdout observation.

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 a pull request may close this issue.

2 participants