-
Notifications
You must be signed in to change notification settings - Fork 315
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
Add encrypted file upload to gossip ring #452
Conversation
By analyzing the blame information on this pull request, we identified @fnichol, @adamhjk, @reset and @juliandunn to be potential reviewers |
c4f5f94
to
1d25263
Compare
@habitat-sh/habitat-core-maintainers this is ready for review |
@metadave it's worth squashing these three commits down into one, since the feature all goes together. |
.iter() | ||
.any(|(&(ref sg, _), ref cf)| sg == &self.my_service_group && cf.written == false) | ||
} | ||
/// Write the files out to disk. We currently are a bit badly factored here - we have both the |
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.
Need a little whitespace here.
I'll squash and rebase against master ping @davidwrede |
☔ The latest upstream changes (presumably c86dfab) made this pull request unmergeable. Please resolve the merge conflicts. |
f4756f7
to
202ff03
Compare
- ServiceGroup now has an organization component, and it's from_str can parse strings in "foo.bar" and "foo.bar@baz" format - ConfigFile renamed to GossipFile - ConfigFileList renamed to GossipFileList - remove dead key tests in sup - add retry + exponential backoff for decrypt file writes - add FileWriteRetries to /gossip sidecar Signed-off-by: Dave Parfitt <[email protected]>
202ff03
to
b9676d9
Compare
📌 Commit b9676d9 has been approved by |
- ServiceGroup now has an organization component, and it's from_str can parse strings in "foo.bar" and "foo.bar@baz" format - ConfigFile renamed to GossipFile - ConfigFileList renamed to GossipFileList - remove dead key tests in sup - add retry + exponential backoff for decrypt file writes - add FileWriteRetries to /gossip sidecar Signed-off-by: Dave Parfitt <[email protected]> Pull request: #452 Approved by: metadave
☀️ Test successful - travis |
- ServiceGroup now has an organization component, and it's from_str can parse strings in "foo.bar" and "foo.bar@baz" format - ConfigFile renamed to GossipFile - ConfigFileList renamed to GossipFileList - remove dead key tests in sup - add retry + exponential backoff for decrypt file writes - add FileWriteRetries to /gossip sidecar Signed-off-by: Dave Parfitt <[email protected]> Pull request: #452 Approved by: metadave
- ServiceGroup now has an organization component, and it's from_str can parse strings in "foo.bar" and "foo.bar@baz" format - ConfigFile renamed to GossipFile - ConfigFileList renamed to GossipFileList - remove dead key tests in sup - add retry + exponential backoff for decrypt file writes - add FileWriteRetries to /gossip sidecar Signed-off-by: Dave Parfitt <[email protected]> Pull request: #452 Approved by: metadave
- ServiceGroup now has an organization component, and it's from_str can parse strings in "foo.bar" and "foo.bar@baz" format - ConfigFile renamed to GossipFile - ConfigFileList renamed to GossipFileList - remove dead key tests in sup - add retry + exponential backoff for decrypt file writes - add FileWriteRetries to /gossip sidecar Signed-off-by: Dave Parfitt <[email protected]> Pull request: #452 Approved by: metadave
This PR adds the
hab file upload
subcommand. In order for this command to work, you need a user key and a service key.To encrypt,
hab upload
needs to be able to find the service public key and the user secret key in/hab/cache/keys
(or override withHAB_CACHE_KEY_PATH
). To decrypt a message, the supervisor needs a service secret key and a user public key.If the supervisor receives the encrypted file via gossip, but is not the intended recipient, the file remains encrypted in memory. If the supervisor is the recipient and has service secret key + user public key, then the decrypted file will be written out to disk in the running service directory (ex:
/hab/svc/redis/files/foo
). If a service is the recipient but does not have the appropriate keys to decrypt, theGossipFileList
will retry the write with exponential backoff.Gossip file write failures are available in the sidecar:
HAB_ORG
is honored if you don't specify--org
ServiceGroup
now has an organization component, and it'sfrom_str
can parse strings in "foo.bar" and "foo.bar@baz" formatConfigFile
renamed toGossipFile
ConfigFileList
renamed toGossipFileList
To play around with this feature:
you can make this fail on the sup side by setting
HAB_CACHE_KEY_PATH
to a directory without keys:and then uploading a new file. Check for failures with:
and resolve the error by resetting:
TODO:
fs:svc_path*