Commit Graph

75 Commits

Author SHA1 Message Date
David Lawrence 0fd1fa6ada arbitrary slots working
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:09:31 -08:00
David Lawrence fea898bd34 listing all keys in the yubikey works
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:09:31 -08:00
David Lawrence da18f54699 import-root, list, and remove working with yubikey
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:09:31 -08:00
David Lawrence 6ba7335793 fill in implementation of removeKey for yubikey
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:09:31 -08:00
David Lawrence be4c0669c1 move import/export to cryptoservice and add import to yubikey
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:09:31 -08:00
David Lawrence 22244fff65 improve password challenge messaging when using yubikey
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:08:41 -08:00
Jessica Frazelle 5f21ebd185 Add pkcs11 build tags
Add build tags and a check in Makefile to be sure you do not import
pkcs11 lib somewhere where it should not be. This will ensure docker
import and integration will continue to work.

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Jessica Frazelle <acidburn@docker.com> (github: endophage)
2015-11-12 01:07:00 -08:00
Jessica Frazelle 913c5ef033 add build tag files for pkcs11 dlopen lib
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Jessica Frazelle <acidburn@docker.com> (github: endophage)
2015-11-12 01:06:51 -08:00
Diogo Monica af1bf0c1d5 Removing debug adding pcs11 to makefiles
Signed-off-by: Diogo Monica <diogo@docker.com>
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
2015-11-12 01:06:46 -08:00
David Lawrence 07f0065152 ask for pin when signing
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-11-12 01:06:38 -08:00
Diogo Monica 53ed60ed89 Adding mandatory touch for signatures
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
2015-11-12 01:06:33 -08:00
Jessica Frazelle 4648666b7c add pkcs11 build tags
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Jessica Frazelle <acidburn@docker.com> (github: endophage)
2015-11-12 01:06:26 -08:00
Diogo Monica 21138e6bad Working version of Notary and Yubikey
Signed-off-by: Diogo Monica <diogo@docker.com>

Remove symlinks from notary-client repo creation

Signed-off-by: Ying Li <ying.li@docker.com>
Signed-off-by: Diogo Monica <diogo@docker.com>

WIP

Signed-off-by: Diogo Monica <diogo@docker.com>

working yubikey integration
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)

Fixing small colon bug

Signed-off-by: Diogo Monica <diogo@docker.com>

Added things. Ship it.

Signed-off-by: Diogo Monica <diogo@docker.com>

Bringing ecdsahwcryptosigner to 2015

Signed-off-by: Diogo Monica <diogo@docker.com>

Working version of notary and yubikey

Signed-off-by: Diogo Monica <diogo@docker.com>
2015-11-12 01:06:09 -08:00
Diogo Monica ae11483a7b initial work on pkcs11 support
Signed-off-by: David Lawrence <david.lawrence@docker.com>

Signed-off-by: Diogo Monica <diogo@docker.com> (github: endophage)
2015-11-12 01:05:55 -08:00
David Lawrence f791c01974 cryptoservices can abstract multiple keystores
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-30 11:05:43 -07:00
David Lawrence 06990fd5a1 integreating with @cyli's improvements
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-30 10:15:52 -07:00
Ying Li 91d54899d7 Add a GetPrivateKey method to cryptoservice so that we can future-proof
cryptoservice having multiple keystores

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-29 16:34:40 -07:00
Ying Li f9019873a6 Merge pull request #243 from endophage/key_types
creating concrete types for the various key ciphers
2015-10-29 14:21:33 -07:00
David Lawrence b7ce16ab6f fixes for Diogo's comments
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-28 19:24:51 -07:00
David Lawrence f73560d839 creating concrete types for the various key ciphers
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-28 16:02:55 -07:00
Ying Li 126691ac9e Update the notary server and signer configs to make use of client authentication.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-28 15:42:33 -07:00
Ying Li 34aecae033 Split out parsing the client TLS in notary-server.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-28 15:40:41 -07:00
David Lawrence daa36b43b7 Merge pull request #242 from docker/unify-root-nonroot-keystore
Unify root nonroot keystore
2015-10-28 13:14:19 -07:00
David Lawrence fa70a79ed7 go fmt was complaining about import order after my sed replacement
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-27 17:22:08 -07:00
David Lawrence 2833a88292 adding gotuf to notary
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-27 16:36:06 -07:00
Ying Li 75b63b84cd Add import/export to KeyStore interface so that the import_export code
makes use of this rather than mangle files manually to import/export
root keys.  (Regular keys it just zips up the whole directory.)

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-27 16:19:14 -07:00
Ying Li 61f9f84254 Use configuration option structures to set up client TLS and server TLS.
Test for if client cert is passed without a client key and vice versa.
Fail in ConfigureClientTLS if only one of client cert/key is passed.
Lint fixes.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-21 18:43:33 -07:00
Ying Li fb1013b997 Add servername to the client TLS config, and use it to build notary-server's
TLS connection to notary-signer.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-19 17:29:54 -07:00
Ying Li 3c58f3cffc Simplify server health check to only check only the key management client.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-16 15:11:19 -07:00
Ying Li 6db76a873e Small cleanup as per review comments
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-16 14:48:05 -07:00
Ying Li 81380e0862 Even simpler - cancel the GRPC call using the context object passed
to the GRPC clients - thanks @endophage!

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-16 09:46:08 -07:00
Ying Li faff328d62 Simplify by using a single buffered channel, instead of having a done
channel and a regular channel - thanks @aaronlehmann!

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-15 11:43:17 -07:00
Ying Li 23a5d42bf6 Use a done channel to clean up and prevent the goroutine from writing
to a closed channel.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-15 11:15:07 -07:00
Ying Li a1edc02b82 Use a function interface instead of declaring an anonymous interface in
the function arguments.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-15 10:34:11 -07:00
Ying Li b94915628b Changing docstring to re-trigger CI
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-15 09:13:24 -07:00
Ying Li 33e031444e Better line wrapping and more comments
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 18:10:21 -07:00
Ying Li bca919c65f Making an RPC call would hang forever if the connection to the GRPC server dies
(it just retries to connect, and the RPC call would just block until it does), so change up
how this works by timing out the health check.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 18:03:19 -07:00
Ying Li 4028941b3f Add health checks functions to the trust service client API.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 13:23:21 -07:00
Diogo Monica c5e3580189 Added base signer Dockerfile, and changed base to be go 1.5.1
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-10-12 17:13:39 -07:00
Ying Li a70605a9e6 Shorten health check name and remove redundant logging
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-08 15:42:14 -07:00
Ying Li 2740fd011a Fix docstring comment
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-07 21:00:01 -07:00
Ying Li 75516a1e84 Add the CheckHealth implementations to the RPC servers, go fmt some other files
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-07 20:51:53 -07:00
Ying Li 701e5df79e Change the rpc Server objects to take a function that can check health
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-07 18:12:51 -07:00
Ying Li a67ed67bdc Add a health check function for the key DB store that verifies we can access the required table
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-07 16:31:24 -07:00
Aaron Lehmann a833f055e2 Change logging to use contexts effectively
Use the github.com/docker/distribution/context package to get a logger
that adds a unique ID and useful information about each HTTP request.

Use this logger in HTTP handlers instead of using logrus or the log
package directly.

Remove [Notary Server] and [Notary Signer] prefixes from log messages.

The distribution/context package was already vendored, so there are no
Godeps changes necessary.

Sample output:

    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="retrieving timestamp key for docker.com/docker"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=debug msg="generated ECDSA key with keyID: ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=debug msg="generated new ecdsa key for role:  and keyID: ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notarysigner_1 | time="2015-07-31T23:02:01Z" level=info msg="CreateKey: Created KeyID ea89e7dc49a13feab1e5ed349760b148c3c6ebd86968b2bc6cb0d003a8b79f78"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="Creating new timestamp key for docker.com/docker. With algo: ecdsa"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="Inserting timestamp key for docker.com/docker"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=debug msg="200 GET timestamp key" docker.com/docker=gun http.request.host="192.168.99.100:4443" http.request.id=a720da02-4312-48ae-b122-6d4bce9d3b20 http.request.method=GET http.request.remoteaddr="192.168.99.1:58178" http.request.uri="/v2/docker.com/docker/_trust/tuf/timestamp.key" http.request.useragent="Go 1.1 package http"
    notaryserver_1 | time="2015-07-31T23:02:01Z" level=info msg="response completed" http.request.host="192.168.99.100:4443" http.request.id=a720da02-4312-48ae-b122-6d4bce9d3b20 http.request.method=GET http.request.remoteaddr="192.168.99.1:58178" http.request.uri="/v2/docker.com/docker/_trust/tuf/timestamp.key" http.request.useragent="Go 1.1 package http" http.response.duration=29.703624ms http.response.status=200 http.response.written=181

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-31 16:06:56 -07:00
Derek McGowan bd9d7c9c74 Move key database to signer package
The key database is not generally used but only used by the signing service.
Move the implementation to the signer package to be imported by the signer.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-30 16:22:47 -07:00
Diogo Monica e568babc0a Added one more test, and fixed delete bug
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-24 06:47:04 -07:00
Diogo Monica b4b364df5f Removing unused hex_bytes.go
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-23 03:45:05 -07:00
Diogo Monica a2a0385c53 Fixing rsa hardware crypto service nil-interface bug
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-22 17:17:02 -07:00
Diogo Monica 6f4e6fffea Fixing protobufs and signer
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-22 16:51:55 -07:00