Commit Graph

220 Commits

Author SHA1 Message Date
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
60271f3014 Enable the signer RPC health check calls to return the last checked health
status from the health package.

Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-14 14:49:39 -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
b18e890e1c Changing the default config to point to notary-server
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-10-12 18:21:39 -07:00
Diogo Monica
70fe89f69c Adding check for relative VS full path
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-10-12 18:15:38 -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
Diogo Monica
aeb96f27a2 Adding client-side root-ca server and config
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-10-12 17:13:39 -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
009400650e minor tweaks to key rotation
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-09 19:24:08 -07:00
David Lawrence
959d0267ac command skeletons in place, changelist actions implemented
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-10-09 19:24:08 -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
Ryan Cox
7bee606f43 Add support for 'notary status' command to show details about unpublished changes
Signed-off-by: Ryan Cox <ryan.a.cox@gmail.com>
2015-10-08 22:07:36 -07:00
Diogo Mónica
53467fd417 Merge pull request #85 from docker/simple_test_script
add a simple test script, eventually this can grow to be our CI script
2015-10-08 16:58:44 -07:00
Ying Li
d092f78f05 Merge pull request #205 from cyli/signer-healthcheck
Adding a DB check to the signer health check
2015-10-08 16:53:57 -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
815675eea9 After upgrading grpc, update how the server is set up with TLS for the signer
Signed-off-by: Ying Li <ying.li@docker.com>
2015-10-07 20:52:48 -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
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
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
moxiegirl
1ce6aa4c34 Merge pull request #196 from ggtools/birthday-pr
Minor improvements on server url
2015-09-24 17:15:01 -07:00
Christophe Labouisse
f9508e37e0 Add env var for default server url
The default server URL can now be set using the `NOTARY_SERVER_URL`
environment variable. Specifying the `--server` parameter still
override this value.

Signed-off-by: Christophe Labouisse <christophe@labouisse.org>
2015-09-19 17:25:12 +02:00
Christophe Labouisse
36594b360c Add missing --server option to verify.
Verify was making call to the server but didn't have a way to
override the default value.

Signed-off-by: Christophe Labouisse <christophe@labouisse.org>
2015-09-19 17:15:08 +02:00
Joe Beda
f7d0ea70af Use pure-go library to get user home directory.
Fixes #194.

Signed-off-by: Joe Beda <joe.github@bedafamily.com>
2015-09-10 16:07:38 -07:00
David Lawrence
2532363fa3 wrapping up token authentication
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
2015-08-19 14:36:30 -07:00
Derek McGowan
a5aea53ef5 Add username and password prompt
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-08-19 13:48:16 -07:00
Derek McGowan
16ff63599d Updated notary cli to use authenticated transport
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-08-19 13:48:16 -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
ec3167eedb Import and export symlinks in keystore
- Export symlinks by encoding them in the zip file.

- Detect symlinks in a zip file on import and create them on the local
  filesystem.

- Add test coverage.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2015-08-03 15:03:31 -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
056622d801 Merge pull request #163 from dmcgowan/refactor-keydbstore
Move key database to signer package
2015-07-30 21:13:32 -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
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
b04ed5042b Added -y no confirmation and more integration tests
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-30 16:22:14 -07:00
Diogo Monica
af2da799bf Added support for env passphrases and improved integration script
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-30 16:22:14 -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
Diogo Monica
59b02db807 Addressing nits
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-28 19:35:29 -07:00
Diogo Monica
27461ad9fb Added cli cert command, changed keylisting to be a map, fixed key removal
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-28 18:14:29 -07:00
Diogo Monica
297fc42e66 Fixing tests
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-28 15:32:01 -07:00
Diogo Monica
c4e4518d04 Adding version from version.go
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-28 15:27:41 -07:00
Diogo Monica
4cf84b3e46 Adding version to notary
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-28 15:27:41 -07:00