Commit Graph

303 Commits

Author SHA1 Message Date
Daniel Dao
d77eb9a456 move server code to an importable package
Commit 6f8424ad38
added an public function so we can import redoctober's NewServer
function in external test packages to create an RO server without having
to actually install the binary in test environments.

This used to work until 0f06d0a051,
which makes it impossible to import main package in external packages.

This change moves `NewServer` and its related code to a non-main
package so other packages can still import it in tests or any other
places.

Signed-off-by: Daniel Dao <dqminh89@gmail.com>
2017-06-21 10:31:22 -07:00
Zi Lin
77e093946b Merge pull request #186 from cloudflare/nick/Ftof
Update License.
2017-02-14 12:22:45 -08:00
Nick Sullivan
7fb5610f35 Update License. 2017-02-14 12:17:09 -08:00
Zi Lin
9508cafd80 Merge pull request #185 from ferringb/cleanup-UI
static/index.html: Convert from single page to tabbed app
2017-01-09 10:25:36 -08:00
Brian Harring
767f3d3912 static/index.html: Convert from single page app to tabbed app.
The diff for this is a bit ugly due to indentation changes, but
essentially each navbar tag that exists, was converted into a tab.  From
there, only one tab is shown at a time- this makes navigation generally
suck less, and is visually less painful.

In parallel, the markup for each tab was adjusted to be more consistent.
2017-01-09 08:58:33 -08:00
Zi Lin
7d8077902b ro owner command should be robust with base64 encoded RedOctober encryption.
- We would avoid sending double base64 encoded request to server, triggering cryptic error message
2017-01-04 14:00:46 -08:00
Zi Lin
6b441d2e85 fix a casing in error message 2017-01-04 12:24:58 -08:00
Zi Lin
43ffe45e72 GetOwners returns labels on the encryption too 2017-01-04 12:24:58 -08:00
Zi Lin
1a1d8dec00 Merge pull request #182 from cloudflare/kyle/vendor-sentry
kyle/vendor sentry
2016-12-21 15:27:28 -08:00
Kyle Isom
db2d698b74 Add raven-go to vendored packages. 2016-12-21 15:08:22 -08:00
Kyle Isom
b6ab57791e Enable sentry reporting. (#180)
This commit adds basic sentry reporting. If enabled by setting the
appropriate configuration value, it will report panics and errors.
Certain functions in the core package (Delegate, Encrypt, Decrypt,
Restore, and ResetPersisted) have additional Sentry reporting as
these are the most common errors.
2016-12-08 14:40:08 -08:00
Kyle Isom
a2cd47445f Send hipchat message on startup (if configured). (#179)
+ If a valid hipchat configuration is provided, send a message when
  Red October has restarted.
+ If persistence is inactive, alert the channel that this is the case.
2016-12-06 17:49:54 -08:00
Kyle Isom
7c4413ab4a Permit usernames with spaces. (#178)
+ We have an account with a space in it; the tool should accomodate
  this.

+ Additionally, support supplying only the username to the program.
2016-12-06 17:28:58 -08:00
Kyle Isom
29dd3b2411 Fix the concurrent map write error. (#177)
+ Add a lock to the keycache.
+ Ensure that all instantiations of keycaches use New, rather
  than the old keycache.Cache{make()} construct. This no longer
  works with the lock in place.
+ Update travis to run the race detector on a few specific packages
  that should help identify this type of problem in the future.
2016-12-06 15:41:18 -08:00
Zi Lin
75dfb8ef6e Merge pull request #176 from gliptak/warnings1
Cleanup Go Report Card warnings
2016-11-09 14:41:47 -08:00
Gábor Lipták
6b9fad5e9d Cleanup Go Report Card warnings 2016-11-09 17:21:39 -05:00
Zi Lin
78e9720635 Zi/disable dead loop retry (#175)
* disable endless retry logic

- we should do the retry logic at application cmd/ro, cmd/ro will need to
  deal with keyboard interrupts as well

* update test self-signed certificate with a expiry of 100 years

* ro tool supports retries after getting delegation errors
2016-10-17 15:19:30 -07:00
Kyle Isom
70d3edbf9d Add ReEncrypt test to integration test. (#172) 2016-10-13 13:04:26 -07:00
Daniel, Dao Quang Minh
f0610dfd75 make docker: build a docker image for redoctober (#159)
* make docker: build a docker image for redoctober

* add a convenient entrypoint to generate certificates out of the box

* add detection based on RO_CERTS and RO_KEYS

instead of detection based on the presence of RO_DATA, add RO_CERTS and RO_KEYS
which are paths to the ceritificates and keys so we can generate them more
effectively.

Signed-off-by: Daniel Dao <dqminh@cloudflare.com>

* dockerfile: bump golang to 1.7.1
2016-10-07 10:14:46 -07:00
Daniel, Dao Quang Minh
ad1d045520 Switch to cloudflare/backoff library (#174) 2016-10-03 10:44:55 -07:00
Kyle Isom
988ad42f8e Merge pull request #173 from cloudflare/brendan/fix
Fix typo.
2016-09-19 00:12:52 -07:00
Brendan McMillion
7050c7c6aa Fix typo. 2016-09-18 20:01:13 -07:00
Zi Lin
73c19a03e3 Merge pull request #171 from cloudflare/kyle/usernames-in-error
Improve user names in delegation error.
2016-09-06 15:01:10 -07:00
Kyle Isom
59eac91639 Improve user names in delegation error.
When delegating to a group of users, Red October will return the
error "User not found" if the user can't be found. This makes it
difficult to figure out the user that couldn't be found. This change
goes through the list of users and includes all usernames that
couldn't be found in the error message.
2016-09-06 13:51:55 -07:00
Zi Lin
4f560dbd0c Merge pull request #170 from cloudflare/kyle/delegation-restore
Properly restore delegations.
2016-08-24 13:47:43 -07:00
Kyle Isom
9f39413adb Properly restore delegations.
This change addresses several points:

1. The integration tests didn't verify that delegations could be used
   for decryption following a restore. The integration tests now
   verify this.

2. There was no functionality for clearing persisted delegations if
   needed. The vault admin can now do this via the command line tool.

3. Restoring active delegations wasn't storing the key with the
   delegation. Keys are now serialised properly.

4. [Minor] The MSP package now reports the name of the offending user
   when it can't find a user name in the database.
2016-08-24 13:22:13 -07:00
jkroll-cf
a4b17c3d35 Merge pull request #168 from cloudflare/kyle/restore-endpoint-ui
Add the restoration function to the HTML UI and CLI.
2016-08-17 13:56:29 -07:00
Kyle Isom
198b6ddfab Restore doesn't require usage count.
Always delegate for 1 use.
2016-08-17 12:11:24 -07:00
Kyle Isom
0b506b14ed Don't vet vendored code.
Ideally, it would be vettable. Ideally, *this* codebase would be
golintable. But, here we are, and neither ideal matches reality. C'est
la vie.
2016-08-16 15:37:49 -07:00
Kyle Isom
4da501264a Add CLI support for restore endpoint.
+ Add the relevant parts to the command line tool and the client
  package.
+ Small improvements to cryptor's restore function:
  + Don't try to restore if the store is already active.
  + Flush the persistence key cache once the restoration occurs.
+ The redoctober program now explicitly mentions that a config file is
  invalid when that's the case.
2016-08-16 15:12:14 -07:00
Kyle Isom
4d7d8257e7 Add missing vendored files. 2016-08-16 14:59:05 -07:00
Kyle Isom
39e11fa81d Add the restoration function to the HTML UI.
+ Add a new restore UI box. When a user delegates successfully for a
  restoration, the current restoration state is returned.
+ Add the persistence state to the summary output.
+ Rename "ordernum" to "slot": this is a longstanding complaint about
  the UI, and I fixed it while I was mucking about with this PR.
2016-08-12 10:19:10 -07:00
Kyle Isom
5a8e70047a Add a restore endpoint to Red October core. (#167)
This takes the work done in 7c95007cda and
provides an interface via the server's API.
2016-08-12 09:09:56 -07:00
Kyle Isom
014590054a Fix vendoring, round 2. (#166)
Remove submodule.
2016-08-10 12:24:36 -07:00
Kyle Isom
e7cb6d7d5e Update vendored packages. (#165) 2016-08-08 14:14:50 -07:00
jkroll-cf
7dacca1d9c Merge pull request #163 from cloudflare/kyle/keycache-interface
kyle/keycache_feedback
2016-08-05 16:19:29 -07:00
Kyle Isom
5396cdc899 Address @jkroll-cf's feedback on keycache interface.
+ persistLabels moved from cryptor to persist package global.
+ Restore now explicitly checks for the case where there aren't enough
  shares to return `ErrRestoreDelegations`.
+ The users responsible for restoring the cache are now logged.
2016-08-05 15:23:10 -07:00
Kyle Isom
510b7ba9f6 Implementation of a file-backed persistence store. (#160)
This is a rather large change. It consists of the following changes:

+ Direct access to the keycache has been removed from the core
  package. This forces all interaction with the cache to go
  through the Cryptor, which is required for persistence. The
  Cryptor needs to know when the cache has changed, and the only
  way to do this effectively is to make the Cryptor responsible
  for managing the keycache.

+ A new persist package has been added. This provides a Store
  interface, for which two implementations are provided. The
  first is a null persister: this is used when no persistence
  is configured. The second is a file-backed persistence store.

+ The Cryptor now persists the cache every time it changes.

Additionally, a number of missing returns in a function in the core
package have been added.
2016-08-04 17:12:08 -07:00
Kyle Isom
1cf72b1f6d Vendor dependencies. (#162) 2016-08-04 15:52:25 -07:00
jkroll-cf
7546ac3c76 Add a CreateUser function to the ro command line tool, to match the one in the client library. Previously, the ro tool mapped user creation onto /create, which is for creating the disk vault and admin user. (#161) 2016-08-04 12:53:09 -07:00
Zi Lin
c230e7a0c9 Merge pull request #157 from cloudflare/kyle/no-merge
Don't merge configurations.
2016-07-21 16:06:36 -07:00
Kyle Isom
8735061583 Don't merge configurations.
In practice, this introduced more problems than it solved.
2016-07-15 15:38:42 -07:00
Kyle Isom
79eda1eea1 Switch to string fields for key and certificate paths. (#154)
This simplifies our deployment process, allowing us to use existing
configuration management tools designed for templating command-line
parameters to template the config files in a straightforward manner.
2016-07-14 09:42:32 -07:00
jkroll-cf
a11d1e51d3 Merge pull request #153 from cloudflare/kyle/status-endpoint
Add a status endpoint to the server.
2016-07-13 11:30:09 -07:00
Kyle Isom
cb16b159f3 Add a status endpoint to the server.
This pull request adds a status endpoint to the Red October server; as
of this pull request, the status endpoint only returns the current
delegation persistence state. The HTTP UI has not been updated, as
this is scoped out for a future request; however, the CLI utility now
features a status command to fetch this information.
2016-07-13 10:20:06 -07:00
Kyle Isom
941cdb4e96 Initial persistent delegation fields in config file. (#152) 2016-07-08 14:16:09 -07:00
Kyle Isom
a082c88a3c Add support for config files. (#151) 2016-06-29 10:22:53 -07:00
Kyle Isom
8aa5b84f9c Merge pull request #145 from cloudflare/kyle/prometheus
Add initial prometheus support to redoctober.
2016-06-08 11:32:17 -07:00
Kyle Isom
a63eaba58f Re-add integration tests.
This uses the prometheus endpoint to determine whether the redoctober
server has started.
2016-06-06 13:22:53 -07:00
Kyle Isom
79269824ee Add initial prometheus support to redoctober.
This doesn't add any redoctober-specific metrics yet; it's primarily
intended to be a healthcheck at this point.
2016-05-27 14:01:41 -07:00