Merged
Conversation
Adding the server-side-encryption() and kms-key() options to the s3() destination. The server-side-encryption() supports only aws:kms at the moment. Fixes syslog-ng#4920. Signed-off-by: Arpad Kunszt <[email protected]>
With this the process should not fail if the JSON file was created with an earlier version and the `server-side-encryption` and the `kms-key` keys are missing. Signed-off-by: Arpad Kunszt <[email protected]>
As @alltilla pointed out using an old JSON and NOT setting the `kms-key` and/or `server-side-encryption` settings can cause an issue. Signed-off-by: Arpad Kunszt <[email protected]>
Signed-off-by: Attila Szakacs <[email protected]> Signed-off-by: Hofi <[email protected]>
b67e713 to
bca6f16
Compare
kovgeri01
approved these changes
Jun 17, 2024
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.
This PR enables to use the server side encryption on the s3() destination. It is a common pattern that data stored on the S3 bucket is encrypted at the rest.
S3 supports multiple server side encryption possibilities. This is only for the
aws:kmsmethod. In theoryaws:kms:dsseshould also work but as it uses the same arguments but I didn't test it so I disabled that intentionally.Check the s3api documentation for the details.
This means that the server-side-encryption() option accepts only
aws:kmsor an empty string, which is the default.The kms-key() should be:
For example:
To be able to use the
aws:kmsencryption the AWS Role or User has to have the following permissions on the given key:Check this page on why the kms:Decrypt is mandatory.
Setting server-side-encryption() to
aws:kmswithout setting kms-key() will terminate the syslog-ng process.Setting kms-key() without setting server-side-encryption() emits a warning and ignores the kms-key(). The server side encryption will be disabled in this case.
It also worth mentioning that kms-key() cannot be changed after the create_multipart_upload executed. I am not sure what will happen if someone modifies the key and then just reloads the syslog-ng configuration. A normal restart would work as syslog-ng finishes the multipart upload during the shutdown.
Signed-off-by: Arpad Kunszt [email protected]
Backport: #127