Skip to content

NIFI-2652 [WIP] Handle encrypted config key migration#1186

Closed
alopresto wants to merge 1 commit intoapache:masterfrom
alopresto:NIFI-2652
Closed

NIFI-2652 [WIP] Handle encrypted config key migration#1186
alopresto wants to merge 1 commit intoapache:masterfrom
alopresto:NIFI-2652

Conversation

@alopresto
Copy link
Contributor

@alopresto alopresto commented Nov 5, 2016

Submitting a WIP PR because other features depend on this work. There is an unrelated test failure that I got locally after rebasing against master, so I will investigate that, but the module where I did all of this work is fine.

I will also update the Admin Guide with instructions for key migration and squash these commits.


Thank you for submitting a contribution to Apache NiFi.

In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:

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?

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.

@YolandaMDavis
Copy link
Contributor

@alopresto happy to review (understanding this is WIP)

@YolandaMDavis
Copy link
Contributor

@alopresto I also received problems running unit test but confirmed that I could migrate keys using several scenarios:

raw key -> raw key
password -> password
password -> raw key
raw key -> password

Also tried negative conditions including incorrect old password/rawkey and received expected exception.

Once unit test issue is resolved I can reevaluate for merge. Thanks @alopresto!

@YolandaMDavis
Copy link
Contributor

@alopresto just to add clarity on unit test failures, I am specifically receiving a problem when running the ConfigEncryptionToolTest. Several tests are failing for me and the failure appears to be due to a generated key that looks truncated.

@alopresto
Copy link
Contributor Author

@YolandaMDavis made a good catch; the tests are ambivalent in regards to JCE jurisdiction policy, but some of the test resources I generated relied on 256-bit keys and so were not compatible with an environment that did not have the policies installed. I am provided resources with 128-bit keys to allow them to run on any environment.

@alopresto
Copy link
Contributor Author

@YolandaMDavis I believe I have resolved the issue you were encountering, and the unrelated test failure was due to DNS settings on my machine which I have now fixed. Please perform the review. Thank you.

@YolandaMDavis
Copy link
Contributor

@alopresto re-ran the unit tests and scenarios looks good

+1

Added test resources with 128-bit encryption for environments without unlimited strength cryptographic jurisdiction policies installed. All tests pass in both 128- and 256-bit environments. (+8 squashed commits)
Squashed commits:
[55f127c] NIFI-2652 Updated Admin Guide with instructions for encrypted config key migration.
[05abf0e] NIFI-2652 Added unit tests for negative cases for migration argument parsing.
Cleaned up TODOs and comments.
[9b73b22] NIFI-2652 Removed SCrypt mock from one unit test that didn't need it. Test pollution is removed and all tests pass.
[d17ea77] NIFI-2652 Removed SCrypt mock from one redundant unit test. One offender remains ignored.
[0924ce0] NIFI-2652 Removed SCrypt mock from one unit test that did not need it. Two offenders remain ignored.
[cb5f850] NIFI-2652 Expanded unit test for combinations into individual tests due to System.exit() only be capturable once per test.
Three tests which mock Scrypt for speed are temporarily ignored to perform test pollution identification.
[c9cc5dc] NIFI-2652 Added logic and unit test for all combinations of original key/password and new key/password.
[19713ec] NIFI-2652 Implemented first pass of key migration logic and provided single comprehensive unit test.
@asfgit asfgit closed this in 89eb2ce Nov 8, 2016
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