Bug 1541550 - Enabling At-Rest Secret Encryption & Migrating Etcd V2 To V3 Data Leaves Unencrypted Secrets Behind.
Summary: Enabling At-Rest Secret Encryption & Migrating Etcd V2 To V3 Data Leaves Unen...
Keywords:
Status: CLOSED DUPLICATE of bug 1514487
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 3.6.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.1.0
Assignee: Scott Dodson
QA Contact: Weihua Meng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-02 20:47 UTC by Bernie Hoefer
Modified: 2019-03-12 14:01 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-08-23 20:43:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Bernie Hoefer 2018-02-02 20:47:16 UTC
Description of problem:
The etcd datastore migration playbook was run after upgrading from OCP 3.5 to 3.6.  The datastore was been updated to v3; existing secrets can be seen to be encrypted when using th3 v3 API to query etcd.  However, querying the etcd database using the v2 API shows the old, unencrypted (just base64 encoded) secret.

Description of problem:

Version-Release number of the following components:
rpm -q openshift-ansible
rpm -q ansible
ansible --version

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:
Please include the entire output from the last TASK line through the end of output if an error is generated

Expected results:

Additional info:
Please attach logs from ansible-playbook with the -vvv flag

Comment 1 Scott Dodson 2018-02-02 21:18:28 UTC
Ok, understanding this a bit more the process was upgrade from 3.5 to 3.6. Migrate from v2 to v3. Enable etcd encryption at rest per https://docs.openshift.com/container-platform/3.6/admin_guide/encrypting_data.html

Yes, the v2 keys are not removed during the etcd v2 to v3 migration.

They can be removed by running the following on your master:
etcdctl2 rm -r /kubernetes.io
etcdctl2 rm -r /openshift.io

Please note that etcd backups are also taken during the upgrade and migration processes. If you truly want to eliminate all traces of unencrypted data you'll also want to carefully remove /var/lib/etcd/openshift-backup* making sure not to touch /var/lib/etcd/member which is the live database.

Example directory listing

# ls -la /var/lib/etcd
total 4
drwxr-xr-x.  7 etcd etcd  218 Feb  2 14:48 .
drwxr-xr-x. 44 root root 4096 Feb  2 14:51 ..
drwx------.  4 etcd etcd   29 Feb  2 13:42 member
drwx------.  3 root root   20 Feb  2 14:36 openshift-backup-post-3.0-20180202143640
drwx------.  3 root root   20 Feb  2 14:48 openshift-backup-post-3.0-20180202144816
drwx------.  3 root root   20 Feb  2 14:36 openshift-backup-pre-upgrade-20180202143626
drwx------.  3 root root   20 Feb  2 14:48 openshift-backup-pre-upgrade-20180202144759

Comment 10 Scott Dodson 2018-08-23 20:43:51 UTC

*** This bug has been marked as a duplicate of bug 1514487 ***


Note You need to log in before you can comment on or make changes to this bug.