Skip to content

Add identity-based TLS auth and UI for client/daemon auth#8265

Closed
dmcgowan wants to merge 20 commits intomoby:masterfrom
dmcgowan:tls_libtrust_auth
Closed

Add identity-based TLS auth and UI for client/daemon auth#8265
dmcgowan wants to merge 20 commits intomoby:masterfrom
dmcgowan:tls_libtrust_auth

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Add identity-based TLS authentication and use public keys to authenticate access.
This is an implementation of the proposal from #7667.

FSNotify support has not been added to detect changes to authorized keys but may be added in a follow up PR.

@dmp42 dmp42 added this to the 1.3.0 milestone Sep 26, 2014
docker/docker.go Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@vieux seems the flag is not used, just the variable. This could definitely be cleaned up.

@dmcgowan
Copy link
Copy Markdown
Member Author

Updated authorized keys and allowed hosts flags according to @bfirsh recommendation

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Sep 30, 2014

@dmcgowan error in tests: 2014/09/30 00:45:14 TLS Handshake error: tls: oversized record received with length 20527

@dmcgowan dmcgowan force-pushed the tls_libtrust_auth branch 2 times, most recently from c448912 to 1ab43b0 Compare October 1, 2014 01:24
@dmcgowan
Copy link
Copy Markdown
Member Author

dmcgowan commented Oct 1, 2014

@vieux the integration tests have been fixed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should just print the warning everytime you use insecure

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hmm, I agree we are trying to steer users away from using non-TLS on any tcp connection. Let me think more about how the wording will need to change. Should definitely be switched back to log.Infof, not sure why it changed to Debugf.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

maybe "DON'T BIND INSECURELY ON A TCP ADDRESS IF YOU DON'T KNOW WHAT YOU'RE DOING" and the check is just for "Insecure"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LOL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a reason this isn't just named err

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

not likely a good one, just didn't get changed when refactored, I can updated

@tiborvass
Copy link
Copy Markdown
Contributor

@dmcgowan Needs rebase + nits correction

@dmcgowan
Copy link
Copy Markdown
Member Author

Rebased and fixed changes. Another commit was added to put back what was removed from #8563. The reason for the removal (accidental key file root ownership) has still not been address though and likely should be address before merging this.

@SvenDowideit
Copy link
Copy Markdown
Contributor

seems to need docs to go with it.

@bfirsh
Copy link
Copy Markdown
Contributor

bfirsh commented Oct 29, 2014

@dmcgowan This is a pretty major change to how Docker works, but this pull request doesn't make it clear what it does. Is there a document somewhere with an overview of how this system works, both from a UI and technical perspective? Perhaps we could link to that or include it directly in the pull request description here.

I think changing the title might help people understand the implications of this change too. "Add UI for client/daemon auth and enable TLS by default" maybe.

dmcgowan and others added 20 commits January 7, 2015 10:54
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
- Removed integration tests which are covered by new tests.
- Disabled tests on Drone for same reason as 07cedaa

Signed-off-by: Ben Firshman <[email protected]>
- Can switch between "identity", "cert" and "none"
- Replaced --insecure with --auth=none
- Moved logic to generate TLS configs to separate auth files
- Renamed --tlscert -> --auth-cert
- Renamed --tlskey -> --auth-key
- Renamed --tlscacert -> --auth-ca
- Add DOCKER_AUTH_{CERT,KEY,CA} envvars for configuring cert auth.
- Added backwards compatibility for --tls... options. The existing tests
  for this have been left to ensure correct behaviour.

The DOCKER_CERT_PATH environment variable has been disabled for these
new options. Changing behaviour on whether files exist in the default
location (~/.docker/cert.pem, etc) seems dangerous if these files
are accidentally missing. This option was added in the first place to
make boot2docker work with cert auth, but now we have identity auth,
this is unnecessary.

Signed-off-by: Ben Firshman <[email protected]>
- Change allowed-hosts to known-hosts since known hosts is a more familiar concept than allowed hosts for similar functionality
- Add deprecation warning to old tls flags
- Use dash for key files instead of underscore for consistency with other key files

Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Docker-DCO-1.1-Signed-off-by: Sven Dowideit <[email protected]> (github: SvenDowideit)
the code is using path.Split, path.Join etc. instead of filepath.Split, filepath.Join. path assumes '/' separators, but Windows of course uses '\'. Talk about the gift that keeps on giving...I've been fixing bugs like this in portable code since 1983.

See docker-archive-public/docker.machine#76

Signed-off-by: John Gossman <[email protected]>
Update the flag processor to use the HOME directory for client configuration file defaults and the /etc directory for daemon configuration file defaults

Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
@icecrime
Copy link
Copy Markdown
Contributor

icecrime commented Jan 8, 2015

Considering the amount of review required, and the extra eyes that security related PR mandates, I'm removing the 1.5 milestone (freezes on Jan 20th).

@icecrime icecrime removed this from the 1.5.0 milestone Jan 8, 2015
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This else is unnecessary and reduces readability

@crosbymichael
Copy link
Copy Markdown
Contributor

@bfirsh can you please get us some information on the reasons why on this approach? We can continue this discussion on the original proposal.

Please reopen when it is ready and that auth code is reviewed by the qualified parties.

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.