tests: add fsverity measurement test
Mimi Zohar
maintainerRFC PATCH 1/1 tests: add fsverity measurement test
Test IMA support for including fs-verity enabled file measurements in the IMA measurement list based on the ima-ngv2 and ima-sigv2 records.
Signed-off-by Mimi Zohar <[email protected]>
---
Comment:
- The fsverity.test executes locally, but fails to loopback mount a file in ci/travis.
- Limit running the fsverity.test to Altlinux where it is installed and Fedora where it is compiled.
build.sh | 1 + ci/alpine.sh | 2 + ci/alt.sh | 4 +- ci/debian.sh | 2 + ci/fedora.sh | 8 +- ci/tumbleweed.sh | 2 + tests/Makefile.am | 2 +- tests/fsverity.test | 303 ++++++++++++++++++++++++++++++++++++++ tests/install-fsverity.sh | 7 + 9 files changed, 328 insertions(+), 3 deletions(-) create mode 100755 tests/fsverity.test create mode 100755 tests/install-fsverity.sh
build.sh +1 -0
@@ -98,6 +98,7 @@ if [ $ret -eq 0 ]; then grep "skipped" tests/sign_verify.log | wc -l fi tail -20 tests/boot_aggregate.log + tail -10 tests/fsverity.log exit 0 fi
ci/alpine.sh +2 -0
@@ -30,6 +30,7 @@ apk add \ diffutils \ docbook-xml \ docbook-xsl \ + e2fsprogs-extra \ keyutils-dev \ libtool \ libxslt \
@@ -41,6 +42,7 @@ apk add \ pkgconfig \ procps \ sudo \ + util-linux \ wget \ which \ xxd
ci/alt.sh +3 -1
@@ -11,7 +11,8 @@ apt-get install -y \ $TSS \ asciidoc \ attr \ - docbook-style-xsl \ + e2fsprogs \ + fsverity-utils-devel \ gnutls-utils \ libattr-devel \ libkeyutils-devel \
@@ -21,6 +22,7 @@ apt-get install -y \ openssl-gost-engine \ rpm-build \ softhsm \ + util-linux \ wget \ xsltproc \ xxd \
ci/debian.sh +2 -0
@@ -40,6 +40,7 @@ $apt \ debianutils \ docbook-xml \ docbook-xsl \ + e2fsprogs \ gzip \ libattr1-dev$ARCH \ libkeyutils-dev$ARCH \
@@ -50,6 +51,7 @@ $apt \ pkg-config \ procps \ sudo \ + util-linux \ wget \ xsltproc
ci/fedora.sh +7 -1
@@ -25,9 +25,12 @@ yum -y install \ automake \ diffutils \ docbook-xsl \ + e2fsprogs \ + git-core \ gnutls-utils \ gzip \ keyutils-libs-devel \ + kmod \ libattr-devel \ libtool \ libxslt \
@@ -38,6 +41,7 @@ yum -y install \ pkg-config \ procps \ sudo \ + util-linux \ vim-common \ wget \ which
@@ -49,4 +53,6 @@ yum -y install swtpm || true if [ -f /etc/centos-release ]; then yum -y install epel-release fi -yum -y install softhsm || true +yum -y install softhsm || true + +./tests/install-fsverity.sh
ci/tumbleweed.sh +2 -0
@@ -26,6 +26,7 @@ zypper --non-interactive install --force-resolution --no-recommends \ diffutils \ docbook_5 \ docbook5-xsl-stylesheets \ + e2fsprogs \ gzip \ ibmswtpm2 \ keyutils-devel \
@@ -37,6 +38,7 @@ zypper --non-interactive install --force-resolution --no-recommends \ pkg-config \ procps \ sudo \ + util-linux \ vim \ wget \ which \
tests/Makefile.am +1 -1
@@ -1,7 +1,7 @@ check_SCRIPTS = TESTS = $(check_SCRIPTS) -check_SCRIPTS += ima_hash.test sign_verify.test boot_aggregate.test +check_SCRIPTS += ima_hash.test sign_verify.test boot_aggregate.test fsverity.test clean-local: -rm -f *.txt *.out *.sig *.sig2
tests/fsverity.test new file +303 -0
303 lines not on this page · raw message
tests/install-fsverity.sh new file +7 -0
@@ -0,0 +1,7 @@ +#!/bin/sh + +git clone https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/fsverity-utils.git +cd fsverity-utils +CC=gcc make -j$(nproc) && sudo make install +cd .. +rm -rf fsverity-utils
Signature · 1 line
2.31.1