Encrypted Channel Configurations#1218
Draft
TomasLongo wants to merge 1 commit intoopensearch-project:mainfrom
Draft
Encrypted Channel Configurations#1218TomasLongo wants to merge 1 commit intoopensearch-project:mainfrom
TomasLongo wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
07c2c02 to
9d63dd0
Compare
Signed-off-by: Tomas Longo <tlongo@sternad.de>
9d63dd0 to
d1b43f9
Compare
5 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Encrypted Channel Configurations
Currently, Webhook-Urls (and headers) like Chime, Slack, Teams, etc. are stored in plain text in OpenSearch. This PR addresses this limitation by introducing symmetrically encrypted webhook urls at rest.
URLs are opaque in the index and user facing APIs while beeing transparent at runtime.
Keys are provisioned manually via the
opensearch-keystoretool and read inside the plugin using theSecureSettingpattern.Architecture
Two new Classes are introduced:
FieldEncryptionService (notifications/util/FieldEncryptionService.kt)
ConfigEncryptionTransformer (notifications/util/ConfigEncryptionTransformer.kt)
Changes in common-utils are necessary
Channel objects (like Slack, Chime, ...) perform a strict url validation when beeing constructed. Handling ciphertexts makes this not feasible anymore. Validation of urls should be, and is already covered by the ui.
NOTE: Tests will fail, as long as
common-utilsis not updatedPoint of Encryption
URLs are encrypted when creating or updating channel configurations. Encryption when updating also enables a lazy migration path.
Pass Through Mode
For backward compatibility, tbe process checks if the url is an encrypted value during decryption, by checking if the url is prefixed with
enc:v1. Unencryped values are simply passed on as is and lazily encryped, when the channel configuration is updated.Limitations
enc:v1prefix of the cipher text lays the groundwork)Migration Paths
Lazy, by updating channel configs (currently working)
Passthrough-Mode enables lazy migration. Unencrypted channel configs are read with their legacy plain-text data and encrypted upon beeing updated.
Bulk, via admin endpoint (open for discussion)
An admin-only endpoint could be implemented that encrypts legacy channel configs in one pass.
Security Considerations
Lifespan of the decrypted config
The channel config is decrypted right before sending a message. Destroying the now plain-text fields of the config is at the mercy of the GC, since the backing field for the sensitive information is of type
Stringwhich we can not destroy manually.A possible approach would introduce dedicated data objects that read sensitive channel information into a
ByteArray/char[]in order to zero it after a message has been sent. (Alternatively, the data objects incommon-utilare modified to support destruction of sensitive data)Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.