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

dev/core#2258 Port new Encryption Services to 5.33 #19392

Merged
merged 17 commits into from
Jan 22, 2021

Conversation

seamuslee001
Copy link
Contributor

Overview

This ports the following PRs to 5.33 #19236 #19251 #19349

Before

Crypto Service only in 5.34

After

Crypto Service in 5.33

I left out porting the change to the SMTP password because I figure that is better done in 5.34 but can be ported for the ESR releases as needed

ping @eileenmcnaughton @totten

totten added 17 commits January 15, 2021 17:07
…aintext

Example: You have a basic site that has not enabled encrypted fields, but the
integration with settings/APIs causes one to use CryptoToken::decrypt()
… being used

This moves the factory function from `Container.php` (which is loaded on all
page-views on all configurations) to `CryptoRegistry.php` (which is only
loaded if the site actually used encrypted fields).
…CRM_SITE_KEY.

This was included under the expectation it might make a nicer upgrade. But
I don't think it buys a whole lot:

1. You run the upgrader. The SMTP password is converted from
   rj256-ecb-sitekey to aes-cbc-sitekey.  All other credentials are left
   unencrypted.  Afterward, you set CIVICRM_CRED_KEY and run the rekey.

2. You run upgrader. The SMTP password is decrypted. All other credentials
   are left unencrypted. Afterward, you set CIVICRM_CRED_KEY and run the rekey.

Additionally, I think there's a question of risk-management when we get to
encrypting more things in the Setting and API layers.  If we go with path 2,
then we can ramp-up adoption progressively, e.g.

* Release 1: Add support as non-default option
* Release 2: Enable by default on new builds
* Release 3: Display alert to existing sites that don't have encryption keys
This is pre-merge change to the notation in the token. Two things:

* Use only one control character instead of multiple.
* Use URL-style key-value notation. It should be easier to skim and to tweak.
This allows the plaintext entries to do have different prioritizations among
different keys.
There are multiple installers distributed across different git repos, and it
make take a bit before they're all updated.  The convoluted ternary
expression ensures that CIVICRM_CRED_KEYS is well-formed regardless
of whether the particular installer knows how to set %%credKeys%%.
This updates the the civicrm-setup API to generate CIVICRM_CRED_KEYS (%%credKeys%%) on
t new installations (based on web-installer or cv installer).
@civibot
Copy link

civibot bot commented Jan 15, 2021

(Standard links)

@civibot civibot bot added the 5.33 label Jan 15, 2021
@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@totten totten merged commit 28102c5 into civicrm:5.33 Jan 22, 2021
@eileenmcnaughton eileenmcnaughton deleted the dev_core_2258 branch January 22, 2021 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants