1
0
mirror of https://git.code.sf.net/p/linux-ima/ima-evm-utils synced 2025-04-28 06:33:36 +02:00

20 Commits

Author SHA1 Message Date
Petr Vorel
83e7925cbe Remove install-tpm2-tss.sh
tpm2-software is being packaged in major distros nowadays.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Bruno Meneguele <bmeneg@redhat.com>(Fedora,CentOS 8(RHEL actually))
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-08-18 17:21:15 -04:00
Petr Vorel
60e1535438 install-swtpm.sh: Update ibmtpm to version 1637
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Bruno Meneguele <bmeneg@redhat.com>(Fedora,CentOS 8(RHEL actually))
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-08-18 17:21:00 -04:00
Petr Vorel
5b764057f3 install-swtpm.sh: Ignore certificate for download
Some distros in Travis CI (e.g. Debian and Ubuntu) have problems with
downloading from sourceforge.net due unknown certificate issuer:

--2020-08-11 14:47:51--  https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm1332.tar.gz/download
Resolving sourceforge.net (sourceforge.net)... 216.105.38.13
Connecting to sourceforge.net (sourceforge.net)|216.105.38.13|:443... connected.
ERROR: The certificate of 'sourceforge.net' is not trusted.
ERROR: The certificate of 'sourceforge.net' doesn't have a known issuer.

This is a preparation for future commit (moving to docker based Travis CI).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Bruno Meneguele <bmeneg@redhat.com>(Fedora,CentOS 8(RHEL actually))
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-08-18 17:20:48 -04:00
Mimi Zohar
3ff5d99edc travis: support tpm2-tss
Running the "boot_aggregate" test without a physical TPM, requires
installing and initializing a software TPM.  For now, use the same
method of initializing the TPM, based on the IBM tss, for both the
IBM and Intel's tss.

Build both the IBM and INTEL's tss.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-08-04 13:53:07 -04:00
Mimi Zohar
f2fe592907 travis: dependency on TSS for initializing software TPM
Verifying the "boot_aggregate" requires reading the TPM PCRs for each of
the TPM banks.  In test environments without a physical TPM, a software
TPM may be used, but requires initializing the TPM PCRs.  By walking and
replaying the TPM event log, a software TPM may be properly initialized.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-08-04 13:53:07 -04:00
Mimi Zohar
9cd7edf1e0 travis: download, compile, and install a swTPM
Verifying the "boot_aggregate" requires reading the TPM PCRs for each of
the TPM banks.  In test environments without a physical TPM, a software
TPM may be used.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-08-04 13:53:07 -04:00
Bruno Meneguele
c9e99f0a21 ima-evm-utils: skip test for discrete TPM 1.2 and exec'd as normal user
boot_aggregate test make use of a software TPM 2.0 in case it doesn't find
any /dev/tpm0 in the system or if the test is ran as a normal user. However,
when the system has a discrete TPM 1.2 and the user runs the test with a
non-root user evmctl fails to return the software TPM 2.0 boot aggregate
value because it tries to access TPM 1.2 the sysfs PCRs file and,
consequently, the test fails. Thus TPM 2.0 log test is not supported on
systems with a discrete TPM 1.2

Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-06-24 20:37:50 -04:00
Mimi Zohar
89eee0f883 ima-evm-utils: tests: fix finding the "boot_aggregate" value
Searching for the last "boot_aggregate" record in the measurement list
could inadvertently match a filename containing the string
"boot_aggregate".  Prevent this from happening.

Reviewed-by: Bruno Meneguele <bmeneg@redhat.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-06-24 20:37:09 -04:00
Maurizio Drocco
48cb564567 ima_evm_utils: tests: boot_aggregate.test spans PCRs 0-9
display_pcrs() should include PCRS 8 - 9 as they are non-zeros on some
systems. boot_aggregate may span PCRs 0 - 9 so check()'s info message
should be fixed accordingly.

Signed-off-by: Maurizio Drocco <maurizio.drocco@ibm.com>
2020-06-24 20:36:25 -04:00
Mimi Zohar
39f1dbeaa4 ima_evm_utils: tests: color boot_aggregate.test tty output
Use the "functions.sh" tty color scheme, which defines SKIP as CYAN.

FAILURE: RED (31)
SUCCESS: GREEN (32)
SKIP: CYAN (36)

Should VERBOSE or informational messages be color coded?

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-06-23 21:45:17 -04:00
Mimi Zohar
5404aa8397 ima-evm-utils: tests: verify the last "boot_aggregate" record
For each kexec, an additional "boot_aggregate" will appear in the
measurement list, assuming the previous measurement list is carried
across kexec.

Verify that the last "boot_aggregate" record in the IMA measurement list
matches.  The "boot_aggregate" is either the last field (e.g. "ima-ng")
or the second to last field (e.g. "ima-sig") in the measurement list
record.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-06-23 21:45:17 -04:00
Mimi Zohar
c5732b6d95 ima-evm-utils: tests: verify boot_aggregate
Calculate the boot_aggregate for each TPM bank and verify that the
boot_aggregate in the IMA measurement list matches one of them.

A software TPM may be used to verify the boot_aggregate.  If a
software TPM is not already running on the system, this test
starts one and initializes the TPM PCR banks by walking the sample
binary_bios_measurements event log, included in this directory, and
extending the TPM PCRs.  The associated ascii_runtime_measurements
for verifying the calculated boot_aggregate is included in this
directory as well.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-06-23 21:45:17 -04:00
Vitaly Chikunov
d3faeb19ad ima-evm-utils: Add sign/verify tests for evmctl
This commit adds (evm) sign, (evm) verify, ima_sign, and
ima_verify tests for different algos.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-05-19 17:30:00 -04:00
Vitaly Chikunov
b6ff60e4fa ima-evm-utils: Add some tests for evmctl
Run `make check' to execute the tests.
This commit only adds ima_hash test.

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-05-19 17:29:59 -04:00
Dmitry Kasatkin
a58cd9f4af Remove test scripts
Test scripts are not used at all.
All needed information is in README.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
2012-09-10 15:17:42 +03:00
Dmitry Kasatkin
bcaadb1205 Use libexec for programs and scripts
Newer automake does not like to put programs and scripts
to lib directory. Use libexec instead.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
2012-09-06 14:08:53 +03:00
Dmitry Kasatkin
8e68cd0135 Scripts for searching not only root owned files
-uid 0 removed.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
2011-12-02 14:15:19 +02:00
Dmitry Kasatkin
b60f927609 directory hash calculation
Directory integrity verification requires directory hash value
to be set to security.ima.
This patch provides directory hash calculation.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
2011-12-02 14:12:57 +02:00
Dmitry Kasatkin
874c0fd45c EVM hmac calculation
For debugging purpose it is nice to have evm hmac calculation for
labeling filesystem using hmac.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
2011-12-01 12:17:29 +02:00
Dmitry Kasatkin
273701a5b2 evmctl - IMA/EVM control tool
evmctl provides signing support for IMA/EVM.
Functionality includes signing of file content (IMA), file metadata (EVM),
importing public keys into kernel keyring.

Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com>
2011-11-24 17:03:43 +02:00