-
Notifications
You must be signed in to change notification settings - Fork 364
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
RFC: Fapi preview fw and ima logging cel #2170
RFC: Fapi preview fw and ima logging cel #2170
Conversation
This pull request introduces 2 alerts when merging e77b7f9 into 5902fba - view on LGTM.com new alerts:
|
e77b7f9
to
9e13b2f
Compare
This pull request introduces 2 alerts when merging 9e13b2f into 5902fba - view on LGTM.com new alerts:
|
9e13b2f
to
9ef82b6
Compare
This pull request introduces 2 alerts when merging 9ef82b6 into 5902fba - view on LGTM.com new alerts:
|
9ef82b6
to
ddb1768
Compare
This pull request introduces 2 alerts when merging ddb1768 into 5902fba - view on LGTM.com new alerts:
|
ddb1768
to
476bd6e
Compare
This pull request introduces 2 alerts when merging 476bd6e into 5902fba - view on LGTM.com new alerts:
|
476bd6e
to
dc12cb6
Compare
This pull request introduces 2 alerts when merging dc12cb6 into 5902fba - view on LGTM.com new alerts:
|
dc12cb6
to
1bb8dec
Compare
This pull request introduces 2 alerts when merging 1bb8dec into 5902fba - view on LGTM.com new alerts:
|
1bb8dec
to
2fa0d3f
Compare
This pull request introduces 2 alerts when merging 2fa0d3f into 5902fba - view on LGTM.com new alerts:
|
2fa0d3f
to
81fe356
Compare
This pull request introduces 2 alerts when merging 81fe356 into 5902fba - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging ba755a8 into 5902fba - view on LGTM.com new alerts:
|
ba755a8
to
62d0a28
Compare
e4fcee5
to
dc4d1a6
Compare
d2a9657
to
61cc8cd
Compare
61cc8cd
to
0d72974
Compare
0d72974
to
7cb07d8
Compare
@williamcroberts @JuergenReppSIT Let's have the discussion here: |
@williamcroberts @AndreasFuchsTPM I think the new CEL format can be part of 3.3 because the old format was beta without IMA and without system events. An old log file could be converted to the new format with a simple sed script if really needed. |
bfe6f4b
to
f550fb0
Compare
Yeah this was what @JuergenReppSIT and I discussed before and we landed on this approach. If we can prevent a major release I am for it. |
f550fb0
to
02840dc
Compare
@williamcroberts @AndreasFuchsTPM AFL fuzzing has now been running for more than 5 days on 20 CPUs without finding more errors. So could the PR now be merged for 3.3? |
02840dc
to
7b6c203
Compare
7b6c203
to
aeccd71
Compare
Then I think we can merge this, right? |
The desearialization of bios events need packed structures. Therefore this warning has to be allowed. Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
The initial value is changed from 1 to 0. Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
aeccd71
to
ca9f13b
Compare
I have added a new commit to the PR which adds the SPDX identifier to all files without one or a wrong identifier.
Is this really necessary? The tpm-tools also store binaries under test/integration/fixtures
|
We should never be stuffing binary files into git. If we have to frequently update the files it can/may consume a lot of space in the .git db. I guess in this scenario it's unlikely, but I think its best to avoid any issue. We can then just have the Makefile-test.am include them as a dependency and build them using b64decode. |
OK I will add it. |
Thanks, I know it's a pain. |
I think next Friday will be the day of pain for me ;-) |
f7ffc3c
to
7382004
Compare
Add serialization and deserialization for firmware events: * Serialization and deserialization of firmware events specified in the TCG PC Client Platform Firmware Profile was added. * Also for the firmare legacy format (sha1) the serialization and deserialization was added. Add serialization and deserialization for IMA events: * Serialization of IMA events as described on: https://sourceforge.net/p/linux-ima/wiki/Home/ was added. The templates ima, img-sig, ima-ng, and ima-sig are supported. * Tests in fapi-jons.c were adapted. Integrate firmware and IMA eventlog: has to be explicitly activated with a configure switch. * The IMA event logging was integrated. * The PC-Client firmware logging was integrated. CEL Events: * The cel_version event was added as first event for the event log of PCR 0. * The firmware_end event was added behind the last firmware event. * Serialization and deserialization of CEL events was added. Event logging: * For invalid digests an error will only produced for quote verification. In other cases only a warning will be displayed. * rename "type" to "content_type". * rename "sub_event" to "content". Tests for event logging for firmware and IMA events: * An Unit test for several binary examples was added. * Tests in fapi-jons.c were adapted. * Copied functions were removed from unit test fapi-json.c * An Integration test for The PC-Client firmware logging was added. * An Integration test for The PC-Client firmware logging in the legacy format was added. Parameters for configure were added with the following defaults: * --with-imameasuerments=/sys/kernel/security/ima/binary_runtime_measurements * --with-sysmeasurements=/sys/kernel/security/tpm0/binary_bios_measurement Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen_repp@web.de>
If systemd is available a systemd oneshot service to change the group of the IMA and the TPM system logging files /sys/kernel/security/ima/binary_runtime_measurements /sys/kernel/security/tpm0/binary_bios_measurements from root to tss will be enabled and started. Signed-off-by: Juergen Repp <juergen_repp@web.de>
7382004
to
8eac55f
Compare
@williamcroberts I have added a commit where the fapi binary test files are created from base64 encoded files. |
Codecov Report
@@ Coverage Diff @@
## master #2170 +/- ##
==========================================
- Coverage 83.62% 83.11% -0.52%
==========================================
Files 351 355 +4
Lines 37959 39643 +1684
==========================================
+ Hits 31745 32949 +1204
- Misses 6214 6694 +480
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
* To avoid storing binary data in git the binary test files are stored bas64 encoded. Rules to decode the files if needed were added. * The tests had to be adapted to use test data which has now been generated in the build directory. Signed-off-by: Juergen Repp <juergen_repp@web.de>
* Two unit tests which can be used for fuzzing were added. * Scripts to start AFL fuzzin were added: afl-fuzzing/fuzz-system.sh afl-fuzzing/fuzz-ima.sh * The tests can be started if afl++ is installed. * The tests are not integrated into the CI because of the long run time * If crashes are detected the unit tests can be used for debugging with the crash file in findings-system/crashes or finding-ima/crashes: ./test/unit/fapi-{ima,sysem}-fuzzing <crash-file> Signed-off-by: Juergen Repp <juergen_repp@web.de>
* The licence identifier war added to file without one. * BSD-2 was replaced by BSD-2-Clause. Signed-off-by: Juergen Repp <juergen_repp@web.de>
88bcdbe
to
b9041aa
Compare
FAPI: Add event logging for firmware and IMA events.
Add serialization and deserialization for firmware events:
TCG PC Client Platform Firmware Profile was added.
was added.
Add serialization and deserialization for IMA events:
was added. The templates ima, img-sig, ima-ng, and ima-sig are supported.
Integrate firmware and IMA eventlog:
CEL Events:
Event logging:
In other cases only a warning will be displayed.
Tests for event logging for firmware and IMA events:
legacy format was added.
Signed-off-by: Juergen Repp juergen.repp@sit.fraunhofer.de