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

New version of notary with pkcs11 client integration #17937

Merged
merged 6 commits into from Nov 14, 2015

Conversation

diogomonica
Copy link
Contributor

Vendoring in new notary version with client-side pkcs11 support.

@jfrazelle took care of all of the building bits that were necessary to have this successfully cross-compile. Thank you Jess!

@cpuguy83
Copy link
Member

ouch -- 7,239 additions and 1,854 deletions.
Someone's been busy!

@jessfraz
Copy link
Contributor

the commits are separated to make it easier

@jessfraz
Copy link
Contributor

Ping @tianon there are various parts about this that I hate that I hope you have a better solution for but the 2 biggest ones: 

  1. How to have a dependency in the deb for only experimental, I kinda like how I did it w the rpm but unsure how to do something like that w a control file
  2. We need a latest clang version for compiling and avoiding clang warnings but as you can see their packages don't alias clang-3.8 as /usr/bin/clang 😞

Such struggles w this one I hate it all a bit myself

@cpuguy83
Copy link
Member

FAIL: docker_cli_push_test.go:235: DockerTrustSuite.TestTrustedPushWithIncorrectDeprecatedPassphraseForNonRoot

@jessfraz
Copy link
Contributor

yes i know I have informed them

@tianon
Copy link
Member

tianon commented Nov 12, 2015

@jfrazelle does the software actually shell out to yubico-piv-tool? I don't think our dependency on it is quite at the level of Recommends, since it's not actually required for most users, but Suggests sounds pretty appropriate (https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps for reference).

Until it moves out of experimental, we could do something like we do with putting apparmor into Recommends; ie, https://github.com/docker/docker/blob/9c6e3396ef7ba44837ffaede0345ab3a105e8116/hack/make/.build-deb/rules#L6-L7, so something like:

    echo 'yubico:Suggests=$(shell [ "$DOCKER_EXPERIMENTAL" ] && echo yubico-piv-tool)' >> debian/docker-engine.substvars

there in override_dh_gencontrol and Suggests: ${yubico:Suggests} over in debian/control like https://github.com/docker/docker/blob/9c6e3396ef7ba44837ffaede0345ab3a105e8116/hack/make/.build-deb/control#L15

Is this a tool users of a Yubi are likely to have installed for other Yubi things, or is it something more specific to the way we use the Yubi inside Notary?

@tianon
Copy link
Member

tianon commented Nov 12, 2015

Also, if the tool isn't installed and a user attempts to use it for something within Docker, does a nice error message bubble up to the level of the client?

@jessfraz
Copy link
Contributor

It dlopens an so file or dylib depending on architecture so I think recommends? Or whatever you think is best

@tianon
Copy link
Member

tianon commented Nov 12, 2015 via email

@jessfraz
Copy link
Contributor

It includes the so

@tianon
Copy link
Member

tianon commented Nov 12, 2015 via email

@jessfraz
Copy link
Contributor

Shit I think it's their deb package that it's in... :( this could be a problem because we were going to have to build these and I wasn't planning on building that one

@jessfraz
Copy link
Contributor

Because we have to have version 1.1.0

@jessfraz
Copy link
Contributor

Let me look into the lib one making a patch for it so we can get 1.1.0 on like wheezy and jessie etc

@jessfraz
Copy link
Contributor

So close to flipping a table this entire PR is a gigantic nightmare

@jessfraz
Copy link
Contributor

FWIW the rpm installs the so :( so that ones correct

@jessfraz
Copy link
Contributor

This one is what I was going to package for our repo 

https://github.com/Yubico/yubico-piv-tool-dpkg
With https://github.com/jfrazelle/repo-pkg

@diogomonica
Copy link
Contributor Author

@tianon @jfrazelle the yubico-piv-tool is actually necessary for anyone that wishes to check the mode on their yubikey/operate on keys (list, delete, etc)/advanced use cases not covered by docker. I would say that Recommend seems appropriate in this case.

This is something that we can change in the future, as more functionality to manage yubikeys is added onto docker and notary, but for now this seems like the only way to have a decent experience with the yubikeys.

Also, the use of pkcs11 is best-effort, if no .so's are found, notary silently ignores it.

@tianon
Copy link
Member

tianon commented Nov 12, 2015 via email

@jessfraz jessfraz force-pushed the notary-pkcs11-client-integration branch 2 times, most recently from 9dc4c04 to 6edd5af Compare November 12, 2015 21:24
@jessfraz
Copy link
Contributor

ok updated w windows fix and also tianons suggestions :) way better than the gross thing i did w install.sh

@jessfraz jessfraz force-pushed the notary-pkcs11-client-integration branch 2 times, most recently from dced1d2 to a68f398 Compare November 12, 2015 21:39
@jessfraz
Copy link
Contributor

also updated packagers.md

@jessfraz jessfraz force-pushed the notary-pkcs11-client-integration branch from a68f398 to 61c1a92 Compare November 12, 2015 22:20
@cpuguy83
Copy link
Member

Very minimal changes to engine side +1
Reviewed vendored in changes, seems OK (nothing horrendous stands out) +1
Tested trusted push/pull functionality (minus yubikey) +1
Tested trusted push/pull going back to 1.9.0 client +1

Soft LGTM

@diogomonica
Copy link
Contributor Author

@cpuguy83 I have one for you. You can test it in Barcelona :)

@cyli
Copy link
Contributor

cyli commented Nov 13, 2015

I've tested the following cases, both with a mac binary that I built on a mac using the same method as homebrew, and with a mac binary that @diogomonica built on linux using make cross.

  • pull/push with yubikey and DOCKER_CONTENT_TRUST=1
  • pull/push without yubikey and DOCKER_CONTENT_TRUST=1
  • push/pull without DOCKER_CONTENT_TRUST

Have not tested on Linux. LGTM as far as macs are concerned :)

@tonistiigi
Copy link
Member

Tested pushing and key rotation with yubikey and all seemed to work. LGTM (no review of the packaging).

@diogomonica
Copy link
Contributor Author

@tianon would love your explicit LGTM, since this involves building magic.

@jessfraz
Copy link
Contributor

You need mine too ;)

@diogomonica
Copy link
Contributor Author

@jfrazelle would love your explicit LGTM, since this involves building magic.

@cpuguy83
Copy link
Member

@diogomonica 🤘

I won't say how long it took me to find that emoji keyword.

@jessfraz
Copy link
Contributor

LGTM

@tianon
Copy link
Member

tianon commented Nov 13, 2015

I really wish this PR could've been in smaller chunks -- it's very hard to review being so massive. 😢

(I almost didn't even look at c86517e557c93c8cbb26305704d91409dd207e39 because it didn't sound related to building, but glad I did.)

@jessfraz
Copy link
Contributor

yeah sorry I specifically hated the sym,ink of clang in that one :(

@jessfraz
Copy link
Contributor

there are def aspects of this PR I hate, it blows

jessfraz and others added 6 commits November 13, 2015 13:19
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
@jessfraz jessfraz force-pushed the notary-pkcs11-client-integration branch from 61c1a92 to 52021ac Compare November 13, 2015 21:21
@tianon
Copy link
Member

tianon commented Nov 13, 2015

Ok, latest iteration LGTM

@icecrime
Copy link
Contributor

No docs required as far as I can tell.

icecrime pushed a commit that referenced this pull request Nov 14, 2015
…ration

New version of notary with pkcs11 client integration
@icecrime icecrime merged commit 7a6f2cd into moby:master Nov 14, 2015
@thaJeztah thaJeztah added this to the 1.10.0 milestone Jan 15, 2016
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.

None yet

9 participants