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

Kvm test swtpm #2130

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Kvm test swtpm #2130

merged 3 commits into from
Jan 15, 2025

Conversation

dbungert
Copy link
Collaborator

Several fixes to swtpm integration allowing TPMFDE test automation, including having TPM state persist across VM boots, allowing multiple VMs with TPM to run in parallel, and an apparmor integration workaround.

Sample command line

./scripts/kvm-test.py -r24.04.1-desktop --install -o -b --boot --profile desktop --with-tpm2

Copy link
Member

@ogayot ogayot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Two suggestions. Otherwise, LGTM

scripts/kvm-test.py Outdated Show resolved Hide resolved
scripts/kvm-test.py Outdated Show resolved Hide resolved
Create a rundir variable for later configuration, defaulting to the
current /tmp/kvm-test spot.

Create a vmstate directory - most VM related content including disks,
swtpm state, and UEFI storage lives here.  Overwriting a VM does a
recursive removal of vmstate.
After analyzing /etc/apparmor.d/usr.bin.swtpm, I don't see a path
forward compliant with that config.  So fix swtpm by making this
invocation unconstrained.  Given that this appears to be attack surface
for VM escapes, a constrained implementation would be beneficial.
@dbungert dbungert merged commit 6165e7d into canonical:main Jan 15, 2025
10 checks passed
@dbungert dbungert deleted the kvm-test-swtpm branch January 15, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants