Commit Graph

47 Commits

Author SHA1 Message Date
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
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
Gábor Lipták
6b9fad5e9d Cleanup Go Report Card warnings 2016-11-09 17:21:39 -05: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
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
Kyle Isom
198b6ddfab Restore doesn't require usage count.
Always delegate for 1 use.
2016-08-17 12:11:24 -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
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
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
Joshua Kroll
ef19255714 Copy predicate when re-encrypting. Fixes #143. 2016-05-06 23:28:21 -07:00
ejcx
6991a38586 Take a slice of users for orders
Don't assume that the creator of the order wants the delegations.
Instead it's much nicer with our current scheme to take in a big
slice of people who want delegations, so that each person who ne
eds a delegation doesn't need to make an order.
2016-01-29 15:51:38 -08:00
ejcx
9292e137d2 Take care of Nick's nitpicks. All good changes 2016-01-25 16:48:42 -08:00
ejcx
52f350d17f Fix uses being a string and breaking tests 2016-01-21 12:40:55 -08:00
ejcx
378ebddf90 Make red october have slices of labels, and a link generator 2016-01-21 12:31:24 -08:00
e
95940ed3fa Add hipchat and ordering support to redoctober. Also fix XSS in RO
Supports MSP and requires several arguments to add hipchat integration to
red october. RedOctober will then alert on creation of an order, any new
delegation, or several other states.
2016-01-12 11:21:47 -08:00
Andrew Buss
13f6616e60 Allow encryption with a single owner
The "minimum" parameter was ignored, so when a single user
was provided as an owner, the encrypted data had no KeySet value
and could not be decrypted.

This change fixes the API and cryptor to pay attention to the Minimum
parameter and handle the case where Minimum is 1
2015-11-30 03:07:07 -08:00
Brendan McMillion
2422b2920d Update owners API and README with predicates. 2015-11-11 15:23:14 -08:00
Brendan Mc
becabb40e9 Integration with Bren2010/MSP 2015-11-11 15:20:17 -08:00
Kyle Isom
c0932d9cb5 Merge pull request #102 from ejcx/multiDel
Multiple delegations to redoctober
2015-11-11 08:28:35 -08:00
ejcx
c9a381d5c2 Multiple delegations to redoctober
The idea is to create a new type (to avoid ugly string parsing) and
then, instead of iterating through delegations with the username, iterate
through the delegations and look for your username and matching slot. Also
in cases we don't have the slot (everything but delegation), find the slot
when we match a user.
2015-11-11 08:26:26 -08:00
Kyle Isom
b7956979f4 Merge pull request #99 from ejcx/evan/ro-98
Return error when attempting to delegate to non-existant user
2015-10-29 15:06:17 -07:00
evan
846ac3f6c4 Return error when attempting to delegate to non-existant user to UI and API 2015-10-29 14:20:38 -07:00
J Delaney
9443fdbf7a Add dedicated API for creating users 2015-10-09 13:00:08 -07:00
Zi Lin
b1ac8b4cc0 Add new operation: re-encrypt
're-encrypt' allows us to re-encrypt an RO encryption to a different set
of owners and labels. Currently two delegations are sufficient to carry
out this operation.
2015-08-11 16:43:28 -07:00
Kyle Isom
209df8d9a6 Add purge command to clear delegations. Closes #48. 2015-07-21 00:03:22 -07:00
Giulio Iotti
6e4957554c Implement purge action to remove all delegates, closes #48 2015-07-20 23:48:16 -07:00
Kyle Isom
9ae97534ff Don't discard result of errors.New. 2015-07-20 15:52:24 -07:00
Kyle Isom
e0e6b260a0 Note the component that a log entry originates from.
Instead of just 'init', use 'core.init' for core commands. Likewise,
in the HTTP server, note log entries originate from the server.
2015-07-20 09:54:51 -07:00
Kyle Isom
e37be3a12a Consistent and more thorough logging.
This PR makes log entries consistent in their format, and ensures
that all the core functions are logged.
2015-07-20 09:54:04 -07:00
Nick Sullivan
27477addba Merge pull request #66 from cloudflare/kyle/export
Add export endpoint, permitting backing up the vault.
2015-07-10 14:13:33 -07:00
Kyle Isom
6c2bc7c773 Improve logging for various actions in the core package. 2015-07-09 15:27:43 -07:00
Kyle Isom
ead76f2c30 Add export endpoint, permitting backing up the vault. 2015-07-09 13:28:18 -07:00
Kyle Isom
f8fd086af1 User summary fix and IP logging. 2015-07-09 11:37:29 -07:00
Alessandro Ghedini
4183569465 Add support for listing required delegations for an encrypted secret
This patch adds the /owners API endpoint that returns the list of users
that "own" the given secret. These are the users that can delegate their
passwords for decrypting the secret.

It also adds the "Get Owners" form in the web UI that uses the new API.

Fixes #62
2015-06-17 11:07:26 +02:00
Kyle Isom
923804458d goimports and go vet cleanups. 2015-05-07 15:35:07 -07:00
Brendan Mc
935b929dd5 Return to idiomatic style & Backwards compatible left&right owners 2015-05-04 19:05:19 -07:00
Brendan Mc
7e08548caf Patched HMAC vulnerability. 2015-05-01 16:46:57 -07:00
Brendan Mc
e61103147c Minimized global state and made user type an option. 2015-05-01 16:10:55 -07:00
Zi Lin
4702aab061 A simple client package for redoctober
- Generalize core.status to core.responseData
- Export core request types so the client can marshal/unmarshal
requests/responses
- Tested with a test script against a local redoctober server
2015-04-21 15:55:03 -07:00
Nick Sullivan
5deefb26c5 Let encrypt and decrypt be called by non-admins. 2015-04-13 12:51:02 -07:00
Nick Sullivan
8e910c2035 Changes to delegation model
- decryption can happen by non-admins
- encrypted files can be given labels
- delegation can limit decryption to specific users and labels
2015-04-09 17:15:44 -07:00
Nick Sullivan
8c21db7ba4 Add support for left/right groups
LeftOwners and RightOwners can now be used as either disjoint
or overlapping sets of users for encrypting a message. Default
behavior is to set them to Owners given a non-empty Owners set.

One member from each group are required to decrypt the message.
2015-02-09 18:51:33 -08:00
Kyle Isom
91cd67f267 Decrypt returns the list of users used for delegation
When decrypting a chunk of data, red october will now report the users
whose keys were used in the decryption.
2014-09-14 19:13:37 -07:00
Nick Sullivan
f5789348de Add basic checking to username and password. 2013-11-25 11:10:51 -08:00
Albert Strasheim
9c5d08f665 Make repository work with go get 2013-11-21 12:01:25 -08:00