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

Add certificates files for docker engine daemon socket TLS #44

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

Conversation

osfrance
Copy link

@osfrance osfrance commented Jul 4, 2018

Add certificates files for docker engine daemon socket TLS for production environment (see https://docs.docker.com/engine/security/https/)

Add certificates files for docker engine daemon socket TLS for production environment (see https://docs.docker.com/engine/security/https/)
@osfrance osfrance mentioned this pull request Jul 4, 2018
Add certificates files for docker engine daemon socket TLS for production environment (see https://docs.docker.com/engine/security/https/)
@osfrance
Copy link
Author

osfrance commented Jul 4, 2018

Add modifications to check_swarm.py script

@timdaman
Copy link
Owner

timdaman commented Jul 5, 2018

Thanks for the PR. I am reviewing this change and looking into the test results. I will keep you posted.

Copy link
Owner

@timdaman timdaman left a comment

Choose a reason for hiding this comment

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

Hey, finally had a few minutes. Looks good. A couple things I noticed.

  1. I think we should display a more helpful message if the use gives us non-nonsensical arguments. Otherwise they may me left scratching their heads for a while.
  2. Some of the tests are broken. I think fixing there is as simple as adding the https handler in the check_docker pytest fixtures.
  3. It would be even better to also move the https handler initialization into into a seperate function (taking args as a argument). This would ensure we are initializing appropriately. If you are strapped for time I can look into that.

# Add Certificate files for secure connection:
if args.secure_connection:
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
if args.cafile and args.certfile and args.keyfile:
Copy link
Owner

Choose a reason for hiding this comment

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

We should display a useful message if an incomplete set of options are specified.


if args.cafile and args.certfile and args.keyfile:
   ...use handler with context
elif allargs.cafile or args.certfile or args.keyfile:
  display error about argument usage "cafile, c, and certfile, and keyfile must be used together"
else:
  use default handler

# Add Certificate files for secure connection:
if args.secure_connection:
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
if args.cafile and args.certfile and args.keyfile:
Copy link
Owner

Choose a reason for hiding this comment

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

See above.

@Henry78
Copy link

Henry78 commented Jun 18, 2019

This (still) works for the latest release. Would like to see it merged to master.

@timdaman
Copy link
Owner

timdaman commented Jun 19, 2019

Me too however there are still quality issues that need to be addressed. The tests need to pass and a error message should be added for bad argument usage. I don't have a test environment for this daemon configuration.

I would help but I have no good simulation of your environment to use for testing. Perhaps you can update the Vagrantfile to provide a Docker daemon with a suitable configuration?

Here are some hints on how I do testing. https://github.com/timdaman/check_docker/blob/master/DEVLOPEMENT.md

@rbw
Copy link

rbw commented Dec 17, 2019

@osfrance @timdaman need help with this one?

@timdaman
Copy link
Owner

@rbw I could use some. The biggest issue is I don't have a Docker server setup with cert auth. I could try to make one but I figure someone who has something in the field should probably be the person to do that since they know what it should look like in operation.

Then there is writing up the tests and polishing the args, I can help with some of that but assistance is most welcome.

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.

None yet

4 participants