Creating luks volumes from images using rbd fails if roots umask is 027
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Cinder Charm |
Confirmed
|
High
|
Unassigned |
Bug Description
When the cinder rbd driver converts the image to luks format it calls image_utils.
The following error appears in the cinder-volume log:
cinder.
Full error log here: https:/
Reproduce:
openstack volume type create \
--encryptio
--encryptio
--encryptio
--encryptio
LuksEncrypt
openstack volume create \
--type LuksEncryptor-
test-
--size 5 \
--image cirros
This should work.
On cinder machine:
sed -i 's/^UMASK.*/UMASK 027/' /etc/login.defs
openstack volume create \
--type LuksEncryptor-
test-
--size 5 \
--image cirros
this will fail.
description: | updated |
information type: | Private Security → Public |
description: | updated |
description: | updated |
Changed in charm-cinder: | |
status: | New → Confirmed |
importance: | Undecided → High |
summary: |
- CIS hardening breaks luks volumes created from images + Creating luks volumes from images using rbd fails if roots umask it 027 |
description: | updated |
summary: |
- Creating luks volumes from images using rbd fails if roots umask it 027 + Creating luks volumes from images using rbd fails if roots umask is 027 |
The issue is the umask of the root user. With the CIS hardening that has been applied the file shown in the error message (/var/lib/ cinder/ conversion/ tmpy88g_ 2co) is created with permissions:
-rw-r----- 1 root root 119508992 Jan 30 19:36 tmpk16n731p
On the cinder unit the following will allow volumes to be created:
cp /etc/login.defs /etc/login.defs.cis
sed -i 's/^UMASK.*/UMASK 022/' /etc/login.defs