Fix bug dropping CEL in launcher attestations #438
Merged
+162
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We inadvertently dropped the launcher's canonical event log when refactoring in #419. This fix adds back the launcher CEL and adds a unit test that checks for CEL measurements in the MachineState.
Failing Unit Test Before Fix:
2024/04/12 18:01:17 Refreshed container image signature cache: [0xc00030e260 0xc00030e280]
2024/04/12 18:01:17 Found container image signatures: [0xc00030e260 0xc00030e280]
--- FAIL: TestAttest (0.00s)
--- FAIL: TestAttest/all_experiment_flags_disabled (0.17s)
/Users/wuale/Projects/go-tpm-tools/launcher/agent/agent_test.go:389: got image ref , want image ref gcr.io/fakeRepo/fakeTestImage:latest
/Users/wuale/Projects/go-tpm-tools/launcher/agent/agent_test.go:392: got image digest , want image digest sha256:adb591795f9e9047f9117163b83c2ebcd5edc4503644d59a98cf911aef0367f8
/Users/wuale/Projects/go-tpm-tools/launcher/agent/agent_test.go:398: got args [], want length 1
--- FAIL: TestAttest/enable_signed_container (0.40s)
/Users/wuale/Projects/go-tpm-tools/launcher/agent/agent_test.go:389: got image ref , want image ref gcr.io/fakeRepo/fakeTestImage:latest
/Users/wuale/Projects/go-tpm-tools/launcher/agent/agent_test.go:392: got image digest , want image digest sha256:adb591795f9e9047f9117163b83c2ebcd5edc4503644d59a98cf911aef0367f8
/Users/wuale/Projects/go-tpm-tools/launcher/agent/agent_test.go:398: got args [], want length 1
FAIL
FAIL github.com/google/go-tpm-tools/launcher/agent 0.926s
FAIL