genecommerce / module-encryption-key-manager

Tooling to help generate and invalidate magento encryption keys
GNU Lesser General Public License v3.0
54 stars 14 forks source link

Harden the key invalidation process #23

Closed convenient closed 1 month ago

convenient commented 1 month ago

See https://github.com/genecommerce/module-encryption-key-manager/issues/22

While these invalidated keys should never be used, we need to ensure they're not predictable in case there are edge cases where some parts of the system still try and utilise them.

Anything trying to decrypt will fail, but possibly they're used for initialising other sensitive bits of the site like we had in SecretBasedJwksFactory so it makes senes to make them not predictable.

Before invalidation

    'crypt' => [
        'key' => '84c9d7c0b305adf9ea7e19a05478bf11
2951b41e2b7f4c26e60a8e7ee00ca17b'
    ],

After invalidation

    'crypt' => [
        'key' => 'invalidpwecbVeGpoL3Jxa4PXEOdn1ej
2951b41e2b7f4c26e60a8e7ee00ca17b',
        'invalidated_key' => '84c9d7c0b305adf9ea7e19a05478bf11'
    ],