-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Serf encryption #1615
Serf encryption #1615
Conversation
0.4.1 release
@@ -212,6 +213,13 @@ func (c *Command) readConfig() *Config { | |||
} | |||
} | |||
|
|||
if config.Server.Enabled && config.Server.EncryptKey != "" { | |||
if _, err := config.EncryptBytes(); err != nil { |
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.
Should this go in setupKeyring?
This branch does not build properly |
It built fine for me. |
So it seems to be working for me. I'm going to try running a job but status commands and the like are working. Also IIUC this only encrypts serf traffic? Do you have plans for HTTP and RPC encryption in this PR or will that be coming at a different time? |
@kevincox yes, this PR only adds Serf traffic encryption. I am also working on the PR for RPC traffic encryption, probably will publish it this week. |
@kevincox The tests don't build, I should have clarified |
@dadgar Can you please take another look at the PR? |
) | ||
|
||
// KeygenCommand is a Command implementation that generates an encryption | ||
// key for use in `consul agent`. |
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.
nomad
Added some more comments. Before this can be merged we will have to also document the new config fields and flags and new commands in the |
@@ -195,6 +196,9 @@ type ServerConfig struct { | |||
// DataDir is the directory to store our state in | |||
DataDir string `mapstructure:"data_dir"` | |||
|
|||
// Encryption key to use for the Serf communication | |||
EncryptKey string `mapstructure:"encrypt" json:"-"` |
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.
json:"-"
?
Hey Aleksandr, Appreciate the work you have done so far. Within the next couple days we will have some bandwidth to take this PR over. I think it is pretty core feature and think it is best if we complete the rest of the work. Please just leave this PR open and we will branch from it. Thanks, |
Closing in favor of #1791 @Gerrrr Thanks for your hard work on this. Please review the new PR I have opened, and let us know what you think. We implemented a few things differently than how Consul has implemented this feature especially our API around key management is http based instead of Consul's RPC based interface. |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Following the discussion at #469, this is the first PR which enables serf encryption.
Most of the code is taken from Consul codebase.
User-visible changes:
nomad agent
--encrypt
encrypt
nomad keygen
which generates new encryption keysExample configuration:
server.hcl
server01.hcl
server02.hcl
server03.hcl