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

Ensure that unencrypted fields during a encryption key rotation are not modified #3215

Merged

Conversation

johha
Copy link
Contributor

@johha johha commented Mar 7, 2023

During a ccdb encryption key rotation unencrypted fields incl. field updated_at should not be modified.
We've seen cases where updated_at & syslog_drain_url have been modified during rotation. See #3196
These changes ensure that only modified fields are updated during a rotation.

While writing the tests we noticed that the droplet table contains the columns encrypted_environment_variables and salt which are no longer referenced in the droplet model. Thus, it should be save to remove those columns.
References:

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@johha johha force-pushed the #3196-db-key-rotation-updated-at branch 2 times, most recently from 33761a7 to 21390dd Compare March 7, 2023 14:00
@philippthun philippthun linked an issue Mar 9, 2023 that may be closed by this pull request
@philippthun philippthun linked an issue Mar 9, 2023 that may be closed by this pull request
@johha johha force-pushed the #3196-db-key-rotation-updated-at branch from 21390dd to 46994e3 Compare March 9, 2023 13:12
johha and others added 3 commits March 9, 2023 14:16
This prevents that the `updated_at` timestamp is updated during a ccdb
encryption key rotation. It should be only updated if the metadata of
the resource changes
See cloudfoundry#3196

Co-authored-by: Philipp Thun <[email protected]>
Fields `encrypted_environment_variables` and `salt` of the
droplet model have been removed long time ago (see
commit d591e30)
However the columns still exists and can be safely removed by now
There have been cases where the field `syslog_drain_url` of
`ManagedServiceInstance` was changed from valid URL to nil during
a ccdb encryption key rotation.

This change ensures that only modified columns/rows will be saved during
a rotation.
Tests for all models with encrypted fields check that unencrypted fields
will not be modified.

Co-authored-by: Philipp Thun <[email protected]>
@johha johha force-pushed the #3196-db-key-rotation-updated-at branch from 46994e3 to 57a54c6 Compare March 9, 2023 13:16
@johha johha merged commit ac2d644 into cloudfoundry:main Mar 9, 2023
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.

updated_at field of apps is updated during encryption key rotation
3 participants