Question: standardized development environment for TPM2 testing, regressions, etc.
matthew at giassa.net
Good day,
Are there any "standardized" setups for TPM2 development, automated regression testing, etc.? I ask because I've replicated an existing setup where a QEMU-based VM exposes a virtualized TPM2 device that's actually just offloading to an SWTPM simulator (i.e. https://www.qemu.org/docs/master/specs/tpm.html). I created a top-level Docker-in-Docker (aka "DIND") setup where a top-level container instantiates the QEMU VM (plus some customizations, custom kernel, etc.) in one sub-container, and the simulator in another sub-container, then "wires" the two together. All 3x containers expose an SSH server instance, so it's pretty easy to access them all directly, run automated regression tests against them, etc.; without requiring a real physical TPM2 device. It's mainly intended for use as an easy-to-recreate tool for training and automated regression tests.
I'm wondering if other people have created such setups, and if there's any merit in releasing the Dockerfile + build scripts for this setup (once I've resolved an issue with sysfs in another post: https://lists.01.org/hyperkitty/list/tpm2(a)lists.01.org/thread/FMBZO6V6QO55BER4YGIGUAYFWEB7ATAM/). Also, I'm trying to determine where it would be be stored (i.e. which repo) if there's perceived value to it.
Cheers!
matthew at giassa.net
I guess I should be more specific: I'm writing some test utilities that directly communicate with the TPM2 module, and some other OS-supplied pieces (i.e. sysfs), so this would be relevant for "end-to-end" testing s/w apps that operate similarly. It isn't meant to be any sort of replacement for the existing test suite and/or unit tests.
Roberts
We have a bunch of docker images that we use for our testing, but they don't use the In-kernel RM like a QEMU virtualized TPM can do or any kernel provided interfaces like sysfs.
Some projects use the SWTPM simulator, others still use the IBM TPM simulator.
It would be nice to add a test to the CI that used the in-kernel RM and sysfs interfaces to add some more test coverage against externally provided pieces.
Quoted 16 lines
-----Original Message-----
From: matthew(a)giassa.net <matthew(a)giassa.net>
Sent: Friday, October 16, 2020 5:30 PM
To: tpm2(a)lists.01.org
Subject: [tpm2] Re: Question: standardized development environment for TPM2 testing, regressions, etc.I guess I should be more specific: I'm writing some test utilities that directly communicate with the TPM2 module, and some other OS-supplied pieces (i.e. sysfs), so this would be relevant for "end-to-end" testing s/w apps that operate similarly. It isn't meant to be any sort of replacement for the existing test suite and/or unit tests.
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
Matthew Giassa
One particular test I was thinking of was injecting bogus messages into the TPM2 event log, and then using tpm2-tools to parse it (i.e. binary ==> ASCII) and then validate (i.e. TPM_GENERATED) against each entry. Also, throwing in an OSCP responder container into the mix and doing some remote attestation tests (including failing cases where we deliberate revoke certs in the responder).
Roberts
Quoted 9 lines
-----Original Message-----
From: Matthew Giassa <matthew(a)giassa.net>
Sent: Monday, October 19, 2020 11:20 AM
To: tpm2(a)lists.01.org
Subject: [tpm2] Re: Question: standardized development environment for TPM2 testing, regressions, etc.
Quoted 5 lines
One particular test I was thinking of was injecting bogus messages into the TPM2 event log, and then using tpm2-tools to parse it (i.e. binary ==> ASCII) and then validate (i.e.
TPM_GENERATED) against each entry. Also, throwing in an OSCP responder container into the mix and doing some remote attestation tests (including failing cases where we deliberate revoke certs in the responder).
You could actually add a libfuzzer test, we do it pkcs11 and tss for examples. We add them as unit tests, they run fast.
Quoted 4 lines
_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s