Skip to content

NIFI-4256 Adds AWS Encryption Controller Service#3574

Closed
natural wants to merge 2 commits intoapache:masterfrom
natural:nifi-4256-a
Closed

NIFI-4256 Adds AWS Encryption Controller Service#3574
natural wants to merge 2 commits intoapache:masterfrom
natural:nifi-4256-a

Conversation

@natural
Copy link
Contributor

@natural natural commented Jul 6, 2019

Description of PR

The code in this change-set adds an S3EncryptionService controller service to manage and apply encryption settings to various S3 processors. Specifically:

  • new class S3EncryptionService for encrypting and decrypting S3 operations
  • support for an ENCRYPTION_SERVICE property in the AbstractS3Processor class
  • inclusion of this property in the PutS3Object and FetchS3Object processors
  • support for all server-side and client-side AWS encryption operations: S3, SSE-KMS, SSE-CEK, CSE-KMS, CSE-CMK
  • unit tests and integration tests for the above
  • documentation for the above

For all changes:

  • Is there a JIRA ticket associated with this PR? Is it referenced
    in the commit message?

  • Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.

  • Has your PR been rebased against the latest commit within the target branch (typically master)?

  • Is your initial contribution a single, squashed commit? Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not squash or use --force when pushing to allow for clean monitoring of changes.

For code changes:

  • Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
  • Have you written or updated unit tests to verify your changes?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
  • If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
  • If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?

For documentation related changes:

  • Have you ensured that format looks appropriate for the output in which it is rendered?

Note:

Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

@alopresto
Copy link
Contributor

Reviewing...

Copy link
Contributor

@alopresto alopresto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the code and made minor comments. Ran a local smoke test where NiFi listed & fetched items from a plain bucket and then used client side CMK encryption and put them back in a new bucket. A different flow then listed & fetched from the encrypted bucket and printed the plaintext data locally.

Will build with checkstyle and run tests locally, but once changes are made, +1.

@Override
protected Collection<ValidationResult> customValidate(final ValidationContext validationContext) {
Collection<ValidationResult> validationResults = new ArrayList<>();
validationResults.add(encryptionStrategy.validateKey(validationContext.getProperty(ENCRYPTION_VALUE).getValue()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add dependent validation for key ID or material value depending on encryption strategy (i.e. if CMK, when the Base64-encoded key material is entered, decode it and verify it is 16, 24, 32 bytes).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is already done by the custom property validation.

}

@Override
public ValidationResult validateKey(String keyValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is repeated. I think it can be refactored.

@alopresto
Copy link
Contributor

Merged. Thanks for this contribution, Troy.

@asfgit asfgit closed this in e841f4d Aug 13, 2019
tpalfy pushed a commit to tpalfy/nifi that referenced this pull request Aug 21, 2019
NIFI-4256 Adds AWS S3 FlowFile encryption attributes, more javadocs,
better names.

This closes apache#3574.

Signed-off-by: Andy LoPresto <alopresto@apache.org>
szaboferee pushed a commit to szaboferee/nifi that referenced this pull request Oct 7, 2019
NIFI-4256 Adds AWS S3 FlowFile encryption attributes, more javadocs,
better names.

This closes apache#3574.

Signed-off-by: Andy LoPresto <alopresto@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants