Skip to content
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

Send TPM logs and EFI variables to monitor app #4672

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rucoder
Copy link
Contributor

@rucoder rucoder commented Mar 12, 2025

  • EnableBigFrames is now set on socket. this is a breaking change, so rust app and eve muct be in sync.
  • update rust app to v0.2.1
  • Send TPM logs and EVI variables to rust app. Unfortunately, variables encoded into TPM logs on some platforms cannot be parsed reliably so we have to manually read them from /sys and send
  • update required rust version to 1.84.1 to be in sync with eve-monitor-rs repo

rucoder added 5 commits March 12, 2025 01:11
- eve-rust was updated to the latest stable 1.84.1

Signed-off-by: Mikhail Malyshev <[email protected]>
- TPM logs may be very big (>64k) so enable big frames for Framed codec
- Also handle errors while sending IPC messages

Signed-off-by: Mikhail Malyshev <[email protected]>
- We should not treat Nil UUID as valid. The data may be available but
  not yet initialized

Signed-off-by: Mikhail Malyshev <[email protected]>
- we need this function to send contents for EFI variable together with
  TPM log to monitor
- also add tests

Signed-off-by: Mikhail Malyshev <[email protected]>
- TPM event logs are sent together with values of EFI variables

Signed-off-by: Mikhail Malyshev <[email protected]>
@rucoder rucoder requested a review from eriknordmark as a code owner March 12, 2025 00:24
@rucoder rucoder requested review from rene and europaul March 12, 2025 00:25
rucoder added 3 commits March 12, 2025 01:34
- As soon as Vault is locked we send the notification and TPM logs for
analysis
- Add helper function to check Vault status

Signed-off-by: Mikhail Malyshev <[email protected]>
- do not send several gigabytes of binaries to docker context. It may
  happen if eve-monitor-rs sources are mounted to pkg/monitor using bind
  --mount instead of pulling from git

Signed-off-by: Mikhail Malyshev <[email protected]>
- setting EnableBigFrames is a breaking change so pkh/monitor and
  eve-monitor-rs must be in sync. v0.2.1 has necessary changes

Signed-off-by: Mikhail Malyshev <[email protected]>
@rucoder rucoder force-pushed the rucoder/monitor-tpm-log branch from 303491e to 269e566 Compare March 12, 2025 00:36
@rene
Copy link
Contributor

rene commented Mar 12, 2025

@rucoder, now that rust versions are in sync between pkg/installer and pkg/monitor, what do you think about revert the following commit: 6b8a09b ? Or do you think is not worth if versions can be out-of-sync in future again.....

@@ -0,0 +1,4 @@
eve-monitor-rs/target/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we need to have these on .gitignore as well?

ipcMessage := ipcMessage{Type: t, Message: json.RawMessage(data)}
if data, err = json.Marshal(ipcMessage); err == nil {
log.Noticef("Sending IPC message: %s", string(data))
if t == "TpmLogs" {
log.Noticef("Sending IPC message: %s", t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about use Sending IPC TPM log message: %s here so it becomes easier to find these in the logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants