New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: change encryption keys #199
Merged
Merged
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
33e1aa7
Initial work using memberlist keyring
ryanuber 5668a34
Added basic ability to use a -keyring-file
ryanuber 9f5db93
agent: added keyring writer, might need to move it into Serf since th…
ryanuber b47e22b
agent: fixed call to base64 encode (doesn't return errors)
ryanuber 1cddd50
serf: implement WriteKeyringFile in Serf so that we can persist recei…
ryanuber 0078582
command: added use-key skeleton
ryanuber a870ba4
command: use-key is now a functional command, and works with -keyring…
ryanuber abf711b
serf: only write keyring file if it is configured
ryanuber 9e9929f
serf: implement remove-key, consolidate like code
ryanuber 8f4f206
Return failed nodes when performing key operations
ryanuber 7c4b3d3
serf: log a message when receiving key modify events
ryanuber e834f26
command: implement keyring subcommand with multiple commands beneath it
ryanuber c70a6a9
command: Consolidate all key functionality into a single command with…
ryanuber 7b74972
command: better description of keys command and ordered arguments in …
ryanuber 9cdabc9
Return all node errors and display them during key queries
ryanuber a4b3a3e
command: exit before connecting to rpc in key command
ryanuber cd968f4
command: better output during key command failures
ryanuber 288940a
command: fixed key command name in metadata and help
ryanuber 35e73bb
command: add note to key command that changes are broadcasted/applied…
ryanuber 05e78ef
command: fancy up the key command output with a prefixed ui
ryanuber 050ee26
Moved key functions and added types in serf/key.go
ryanuber 6e3cb2c
website: first pass at docs for keyring functionality
ryanuber 4557521
Make rigid encryption key option handling more verbose in error scena…
ryanuber 3419766
agent: remove duplicate condition
ryanuber ca95c70
serf: trim down KeyResponse object and adjust key command
ryanuber 486ae03
serf: first pass at tests for keyring
ryanuber 06d1df0
serf: added tests for use-key and remove-key. need negative testing.
ryanuber 5687e35
serf: test trying to use a non-existent primary key
ryanuber 46c8081
Removed unhelpful tests
ryanuber c920d5f
command: better keyring file loading routine
ryanuber ed5a9f4
agent: add tests for loading keyring files
ryanuber 36c990d
serf: split out all operations for key in internal_query.go
ryanuber 3bd6cb4
serf: remove unused resp object
ryanuber 1771c1b
Added key -list option to ask cluster for a collective list of keys
ryanuber adc65ed
Added comments, fixed log message, and changed query log messages to …
ryanuber b0c1c02
Better documentation for the key command
ryanuber c37462f
command: minor doc adjustments for key command
ryanuber afaf2f6
serf: added test for key list api
ryanuber 8c6d5c3
Added return's in key.go to make sure we execute just 1 operation per…
ryanuber 5ff7886
serf: added comments on undocumented functions
ryanuber 175533d
Move key manipulation functionality into a KeyManager object to avoid…
ryanuber afdf549
Relay number of nodes with a given encryption key installed
ryanuber 6007c80
Squashed identical response types into one type, removed unneeded req…
ryanuber bdca549
Commented types in keymanager
ryanuber af82446
Added r/w mutex to keyManager
ryanuber 311dc97
serf: store a pointer to a keyring manager so the RWLock works
ryanuber d892201
command: rename 'serf key' to 'serf keys' for uniformity with other c…
ryanuber 8f59d4e
serf: writeKeyringFile is private now, and takes no arguments
ryanuber ce47deb
serf: implement key broadcast and response handling in reusable funct…
ryanuber fc45d23
serf: mark query logs as INFO rather than DEBUG
ryanuber aa54599
website: added RPC documentation for key operations
ryanuber d5c15b6
command: use newer columnize api
ryanuber 17e8fb1
command: protect against passing ambiguous arguments to keys command
ryanuber db060d5
serf: return early when all nodes respond before query timeout
ryanuber d756172
serf: remove unused message types
ryanuber 9b7528c
Added keyring file format documentation
ryanuber c1205a3
serf: use encoded struct as query payload for key operations
ryanuber c741506
serf: handle responding to key-related queries using a common function
ryanuber ad6a008
serf: use a goto inside of the channel loop to handle failure cases
ryanuber 5a006da
Improve documentation and help output for keys command -list option
ryanuber 0d3767b
serf: make RWMutex private in keymanager
ryanuber ab5d959
Always return allocated response object to avoid nil pointer dereference
ryanuber 85a7528
agent: first pass at rpc tests
ryanuber f575528
command: added tests for keys command
ryanuber 94ec6dd
serf: added keyring file writer tests
ryanuber File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not just set the encrypt key as the primary key in the key ring? I imagine that generally -encrypt is provided with the primary key, and the -keyring-file is used only as a temp store while keys are being swapped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could definitely do this, but my thinking here was that providing a
-encrypt
might become brittle if the keys are updated at any point. As an example, if I have a script that starts serf withserf agent -keyring-file /tmp/ring.json -encrypt xxxxxxxxxx
, then each time that Serf starts, the primary key will again be set toxxxxxxxxxx
, even if a newer key had been set/broadcasted from a member at some other point and saved into the-keyring-file
.The
-keyring-file
in its current form is intended to work almost exactly like the-tags-file
.