Commit Graph

65 Commits

Author SHA1 Message Date
Ying Li 6aa114a49f Fix all instances where 'propagate' was mispelled as 'propogate'
Signed-off-by: Ying Li <ying.li@docker.com>
2015-12-10 15:12:05 -08:00
HuKeping 639f1e80f0 Use the function to parse viper on server side
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-12-09 09:17:25 +08:00
David Lawrence c2c474b9c6 generalize notary server key storage to be able to handle any role, not just timestamps
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-12-03 11:25:45 -08:00
Ying Li 870fe0fd01 Define injected function types for notary-server/main.getTrustService
Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 17:24:28 -08:00
Ying Li 1dd04d4e5d trust_service is now a required section of the notary-server config.
The type must either be "local" or "remote".  Previously, any invalid
configuration would default to a local signing service, but since
a remote signing service is recommended, the user has to specifically
configure a local signing service.  We don't want it to be the
fallback.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 17:23:53 -08:00
Ying Li d62ac788a3 Fixed bug parsing trust service info in notary server.
Previously, if it wasn't a remote service, the config parser was
still setting the key algorithm to be whatever was configured.
Now, if we are using a local trust service, the algorithm is always
ED25519.

Also broke the trust parsing into its own function for testing.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 17:22:33 -08:00
Ying Li a94a47651f Adds specific memory backend support to server and signer.
The server already supported a memory backend, but now it must be
specified, rather than just being a fallback if no storage is
specified.  This also adds a signer backend to signer, which
previously required a MySQL backend.

Thanks @endophage for the excellent suggestion!

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li f1bd28caf4 The TLS certificates are now relative to the config file used.
Previously, if a relative path was provided, it was relative to the
current working directory to wherever the binaries were run.  Now
it is relative to whatever config file was used.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li c43776d36f Use shared configuration parsing tools in notary-server.
This changes the 'addr' parameter of notary-server's config to
'http_addr', so we can add a GRPC server to notary-server if
necessary.  This also allows environment variables to override
the notary-server config file entries, as notary-signer already
does.

The bugsnag configuration has also been changed so that the
bugsnag parameters are under the "bugsnag" key.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-30 10:58:57 -08:00
Ying Li 6ebb1fc7a8 Just connect to mysql as root, rather than as dockerdemo user with password.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-23 18:05:10 -05:00
Ying Li 204a4f1534 The NotarySigner cryptoservice now implements GetPrivateKey.
Previously, because it's a CryptoService wrapper around a remote signer
service, it returned nil all the time.  Now, because signing is done
via private key more than CryptoService, it has to return a PrivateKey.

The key doesn't have private bytes, but can be used for signing.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-11-15 01:45:21 -08: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
Ying Li 04a78e720f Factor out and test TLS configuration in notary-server.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-28 15:39:52 -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 a5e64ecf03 Do not use the viper singleton instance everywhere
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-19 11:50:04 -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 a49406de42 Log an error if the notary server cannot reach the signer or otherwise
if the signer is in trouble, but do not fail the health check, since
the server can operate for a while without the signer (the server will
have degraded performance, but is not down)

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-15 10:48:10 -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 cd5015592a Fix the key names for the server health checks
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 14:52:31 -07:00
Ying Li 30330f43e2 Register trust health checks and DB health check with the notary server.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 13:23:38 -07:00
Ying Li 6b98278282 Merge pull request #215 from cyli/server-uses-gorm
Use gorm for storing notary-server information
2015-10-14 13:09:37 -07:00
Diogo Monica 8299e01b0a Fixed comments, changed default config
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-10-12 17:14:23 -07:00
Ying Li 7fa991c3ff Gormizes the server database and make it SQL-DB agnostic.
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-12 16:45:41 -07:00
David Lawrence 98cde51f18 working basic key rotation for targets and snapshot key. Command is 'notary key rotate [GUN]'
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-09 20:35:06 -07:00
David Lawrence ac54370fb0 cleanup after discussing with Diogo
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-09 19:40:36 -07:00
David Lawrence 83f96997d3 changelist management of key rotation
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-09 19:23:47 -07:00
cyli 684a8253fb Provide the default uesrname/password in the mysql start file, for ease of starting with notary
As per #75, the default username/password should not be hardcoded, so when that changes this README should also change
2015-10-05 12:08:24 -07:00
Nathan McCauley bbe780fba1 Update README
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-08-11 23:26:49 -07:00
Diogo Mónica 52b064b6a6 Merge pull request #174 from docker/logging
Change logging to use contexts effectively
2015-08-10 10:31:21 -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
Jessica Frazelle 95cdfbeb58 add version to signer and server logs for debugging and issues
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-07-31 15:17:42 -07:00
Aaron Lehmann d7f11844c8 Accept configuration parameters from environment variables
For example, trust_service.type becomes
NOTARY_SERVER_TRUST_SERVICE_TYPE.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-07-31 13:05:34 -07:00
David Lawrence e7fa1951ab hard fail if TLS is only partially configured
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-31 10:49:42 -07:00
David Lawrence 58187d97d1 don't want bugsnag config template in config.json
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-30 16:39:08 -07:00
David Lawrence f7ca3ef62e make key algorithm configurable for local development with in memory ed25519 crypto service
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-30 11:53:39 -07:00
David Lawrence d27f480231 parse string log level from config
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-29 15:52:35 -07:00
Nathan McCauley 0642da80f1 review feedback
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 11:00:24 -07:00
Nathan McCauley f239757dfd keystore aliasing, take 2
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-20 10:58:20 -07:00
David Lawrence 7db33797a8 fixing timestamp errors on list
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-20 10:35:40 -07:00
David Lawrence d453c6548d client side of multi TUF file atomic update
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-17 17:48:06 -07:00
Richard Scothern e5d6180276 Enable remote signing service
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-07-16 11:16:40 -07:00
Richard Scothern df18a541e2 Fix the staging deployment.
Add a service name and ephemeral ports to notary server.
Remove certs as TLS is terminated in the ELB.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-07-16 09:50:52 -07:00
Diogo Mónica 0ed6072a4a Merge pull request #67 from docker/adding-certs
Adding new certificates
2015-07-15 22:35:54 -07:00
Diogo Monica 3debfbca10 Reissued all certs with correct SANs
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-15 21:42:24 -07:00
Diogo Monica ddfcd50471 Changing .pem to .crt everywhere
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-15 20:44:09 -07:00
Diogo Monica cdee810942 Changed notary-server to point at new certs
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-15 19:45:34 -07:00
David Lawrence 72d7d35221 fixing database queries
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-07-15 16:19:14 -07:00
Diogo Monica f03626a10e Refactored Rufus API
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-14 00:23:38 -07:00