Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-12165: merge key rotation feature work #5126

Merged
merged 83 commits into from
Nov 22, 2023

Conversation

dickon
Copy link
Contributor

@dickon dickon commented Nov 17, 2023

Take new API update with additional Avro, kafka and config for crypto key rotation.

Add new RestResource called KeyRotationRestResource which is automatically injected into the REST procesosr and allows crypto unmanaged wrapping key rotation to be started.

Implement unmanaged key rotation, for now in a relatively simple way where we take work requests on Kafka then process them to completion. This won't necessarily be the best way for the database at scale, and we have a design for spreading the work out over a nested Kafka topic, but let's get something in that is simple and works first.

Add alias to WrappingKeyInfo. It's not clear why this wasn't here before. WrappingKeyInfo is a data transfer object (DTO) and it seems reasonable for it to hide DB implementation detals such as the synthetic primary ID field. Alias is also part of a compound key with generation, and both alias and generation are user-visible features of wrapping keys; for instance a user could specify wrapping key alias when creating a signing key pair.

Making WrappingKeyEntity key_material updatable since that's what happens during key rotation.

Add state manager arguments to the crypto worker, so that later the crypto worker can use the state manager for status notifications.

anien and others added 30 commits November 6, 2023 11:13
* bump API reference

* go to debug levecl

* change REST path to 5.2

* drop simulate, timeToLive and limit parameters

* remove limit and simulate flag

* remove typo

* use new API

* use new field name agreed in API change

* bump API version
* bump API reference

* go to debug levecl

* remove limit and simulate flag

* remove typo

* restore nested topic

* prevent duplicated rotation of cluster wrapping keys

* simplify stream/sequence handling
add test case

* remove wildcard import

* remove test duplication

* fix formatting

* update for API changes

* fix rebase error

* fix formatting
@dickon
Copy link
Contributor Author

dickon commented Nov 21, 2023

Matching PR for API change is corda/corda-api#1348

mag1c-48
mag1c-48 previously approved these changes Nov 21, 2023
Copy link
Contributor

@mag1c-48 mag1c-48 left a comment

Choose a reason for hiding this comment

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

LGTM - Build files only

charlieR3
charlieR3 previously approved these changes Nov 21, 2023
Copy link
Contributor

@charlieR3 charlieR3 left a comment

Choose a reason for hiding this comment

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

LGTM - network team files

@anien anien dismissed stale reviews from charlieR3 and mag1c-48 via 07be472 November 21, 2023 11:00
anien and others added 3 commits November 21, 2023 15:23
…esource (#5143)

* Remove initialise function from the rest resource interface.

* Update swagger baseline test with new rest resource.

* Add package files for OSGi export.
…artitions (#5146)

* User random key for kafka topic to spread the work between partitions

* Use random key for kafka topic to spread the work between partitions on producer side too
… feature branch on the API (#5151)

* CORE-18072 CORE-18263 fix resolveStateRef logic and call (#5071)


- findSignedLedgerTransaction explicitly called the resolveStateRefs function which resulted in opening two DB connections at the same time. This has been modified to a direct call to the repository instead.
- The resolveStateRefs function in the state query service uses a cache but we always fetch all of the state refs instead of just the non-cached ones.

* CORE-17972: implementation of send & receive tx (#5042)

implemented logic for sending and receiving a transaction and verification for the transaction received.

* CORE-17961: Allow Time & Multiple Metadata Filters (#5139)

- Allow filtering states by last updated timestamp and multiple
  metadata filters (both conjunctive and disjunctive operations).
- Update 'ScheduledTaskProcessor' to use the new feature instead of
  manually filtering states.

* CORE-17821 Removed Kafka implementation from CryptoProcessorImpl (#5135)

This PR removes any deprecated or duplicated code, particularly Kafka-based implementations, in the CryptoProcessor which was created during the migration from Kafka to RPC external event communications.

* CORE-18413: Increase timeout for vNode operations for E2E tests (#5144)

* tidy up merge

* Return a list from findKeysWrappedByAlias to avoid using the Stream after it is closed

* use new API version

* remove old imports

* fix merge

* fix

* fix tests

* fix detekt

* Revert "CORE-12165: Use UUID as key to spread the work evenly between Kafka partitions (#5146)"

This reverts commit 3490b40

* fix revert and tests

* CORE-12459: Configure Corda dedicated vNode admin fix (#5123)

Allows a user that is not the cluster user to sync the vNode on an external DB

* CORE-18152/CORE-17601: Remove Kryo Pool Upper Limit (#5145)

* CORE-18352 Fix app-simulator optional database parameters (#5105)

The app-simulator’s database parameters are optional when running in SENDER mode. This change fixes an issue where the Sender fails to start if these are not provided.

* fix test

* use final 5.2.0.5 API version

---------

Co-authored-by: nkovacsx <[email protected]>
Co-authored-by: Jenny Yang <[email protected]>
Co-authored-by: Juan José Ramos <[email protected]>
Co-authored-by: Ben Millar <[email protected]>
Co-authored-by: Viktor Kolomeyko <[email protected]>
Co-authored-by: Ben Yip <[email protected]>
Co-authored-by: Yash Nabar <[email protected]>
@dickon dickon requested review from a team as code owners November 22, 2023 13:55
…-12165-zero-merge

# Conflicts:
#	gradle.properties
#	processors/crypto-processor/src/main/kotlin/net/corda/processors/crypto/internal/CryptoProcessorImpl.kt
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vkolomeyko vkolomeyko self-requested a review November 22, 2023 14:37
Copy link
Contributor

@vkolomeyko vkolomeyko left a comment

Choose a reason for hiding this comment

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

LGTM (on behalf of @corda/rest)

Copy link
Contributor

@emilybowe emilybowe left a comment

Choose a reason for hiding this comment

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

LGTM (flow changes only)

Copy link
Contributor

@driessamyn driessamyn left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@lankydan lankydan left a comment

Choose a reason for hiding this comment

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

Approved on the basis that no ledger code seems to have changed.

Copy link
Contributor

@mag1c-48 mag1c-48 left a comment

Choose a reason for hiding this comment

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

LGTM - build

Copy link
Contributor

@wzur-r3 wzur-r3 left a comment

Choose a reason for hiding this comment

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

LGTM for settings.gradle owned by BLT

@wzur-r3 wzur-r3 requested a review from charlieR3 November 22, 2023 15:51
Copy link
Contributor

@charlieR3 charlieR3 left a comment

Choose a reason for hiding this comment

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

LGTM - network team files

@dickon dickon merged commit 32a5ed9 into release/os/5.2 Nov 22, 2023
3 checks passed
@dickon dickon deleted the feature/CORE-12165/key-rotation branch November 22, 2023 15:54
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.

9 participants