s3: add server side encryption support #127
Merged
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:kms
method. In theoryaws:kms:dsse
should 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:kms
or an empty string, which is the default.The kms-key() should be:
alias/
prefixFor example:
To be able to use the
aws:kms
encryption 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:kms
without 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.