Enabling vTPM in Victoria on CentOS 8 causes SELinux denials
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tripleo |
Fix Released
|
High
|
Cédric Jeanneret |
Bug Description
Description
===========
I recently worked through enabling vTPM on a TripleO based Victoria deployment on CentOS 8. After modifying the openstack-
Steps to reproduce
==================
Enabled vTPM for Nova on my TripleO deployment. Steps documented at:
https:/
Expected result
===============
Instance launched using a flavor or image with the vTPM metadata properties will complete successfully and the tpm device will be available in the instance.
Actual result
=============
Instance errors out on spawning with SELinux denials on the compute host.
Environment
===========
1. OpenStack Victoria (RDO TripleO)
2. Ceph Nautilus
3. Neutron OVN
Logs & Configs
==============
sealert output:
found 4 alerts in /var/log/
-------
SELinux is preventing swtpm from write access on the directory swtpm.
***** Plugin qemu_file_image (98.8 confidence) suggests *******************
If swtpm is a virtualization target
Then you need to change the label on swtpm'
Do
# semanage fcontext -a -t virt_image_t 'swtpm'
# restorecon -v 'swtpm'
***** Plugin catchall (2.13 confidence) suggests *******
If you believe that swtpm should be allowed write access on the swtpm directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'swtpm' --raw | audit2allow -M my-swtpm
# semodule -X 300 -i my-swtpm.pp
Additional Information:
Source Context system_
Target Context system_
Target Objects swtpm [ dir ]
Source swtpm
Source Path swtpm
Port <Unknown>
Host <Unknown>
Source RPM Packages
Target RPM Packages
Policy RPM selinux-
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name overcloud-
Platform Linux overcloud-
Alert Count 1
First Seen 2020-11-01 06:25:41 EST
Last Seen 2020-11-01 06:25:41 EST
Local ID b088198d-
Raw Audit Messages
type=AVC msg=audit(
type=AVC msg=audit(
type=AVC msg=audit(
Hash: swtpm,svirt_
-------
SELinux is preventing swtpm from setattr access on the sock_file 1-instance-
***** Plugin catchall (100. confidence) suggests *******
If you believe that swtpm should be allowed setattr access on the 1-instance-
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'swtpm' --raw | audit2allow -M my-swtpm
# semodule -X 300 -i my-swtpm.pp
Additional Information:
Source Context system_
Target Context system_
Target Objects 1-instance-
Source swtpm
Source Path swtpm
Port <Unknown>
Host <Unknown>
Source RPM Packages
Target RPM Packages
Policy RPM selinux-
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name overcloud-
Platform Linux overcloud-
Alert Count 1
First Seen 2020-11-01 06:25:41 EST
Last Seen 2020-11-01 06:25:41 EST
Local ID 6ea3df16-
Raw Audit Messages
type=AVC msg=audit(
Hash: swtpm,svirt_
-------
SELinux is preventing swtpm from append access on the file instance-
***** Plugin qemu_file_image (98.8 confidence) suggests *******************
If instance-
Then you need to change the label on instance-
Do
# semanage fcontext -a -t virt_image_t 'instance-
# restorecon -v 'instance-
***** Plugin catchall (2.13 confidence) suggests *******
If you believe that swtpm should be allowed append access on the instance-
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'swtpm' --raw | audit2allow -M my-swtpm
# semodule -X 300 -i my-swtpm.pp
Additional Information:
Source Context system_
Target Context system_
Target Objects instance-
Source swtpm
Source Path swtpm
Port <Unknown>
Host <Unknown>
Source RPM Packages
Target RPM Packages
Policy RPM selinux-
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name overcloud-
Platform Linux overcloud-
Alert Count 1
First Seen 2020-11-01 06:25:41 EST
Last Seen 2020-11-01 06:25:41 EST
Local ID 0bbe7b10-
Raw Audit Messages
type=AVC msg=audit(
Hash: swtpm,svirt_
-------
SELinux is preventing swtpm from create access on the file 1-instance-
***** Plugin catchall (100. confidence) suggests *******
If you believe that swtpm should be allowed create access on the 1-instance-
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'swtpm' --raw | audit2allow -M my-swtpm
# semodule -X 300 -i my-swtpm.pp
Additional Information:
Source Context system_
Target Context system_
Target Objects 1-instance-
Source swtpm
Source Path swtpm
Port <Unknown>
Host <Unknown>
Source RPM Packages
Target RPM Packages
Policy RPM selinux-
Selinux Enabled True
Policy Type targeted
Enforcing Mode Permissive
Host Name overcloud-
Platform Linux overcloud-
Alert Count 1
First Seen 2020-11-01 06:25:41 EST
Last Seen 2020-11-01 06:25:41 EST
Local ID e43e45e0-
Raw Audit Messages
type=AVC msg=audit(
type=AVC msg=audit(
Hash: swtpm,svirt_
Changed in tripleo: | |
importance: | Undecided → High |
assignee: | nobody → Cédric Jeanneret (cjeanner) |
status: | New → Triaged |
milestone: | none → xena-rc1 |
tags: | added: victoria-backport-potential wallaby-backport-potential |
Related fix proposed to branch: master /review. opendev. org/c/openstack /puppet- tripleo/ +/811103
Review: https:/