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

add more logging to hardware runners #2013

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ee/secureenclaverunner/secureenclaverunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ func (ser *secureEnclaveRunner) currentConsoleUserKey(ctx context.Context) (*ecd

key, ok := ser.uidPubKeyMap[cu.Uid]
if ok {
ser.slogger.Log(ctx, slog.LevelDebug,
"found existing key for console user",
"uid", cu.Uid,
)
span.AddEvent("found_existing_key_for_console_user")
return key, nil
}
Expand All @@ -207,6 +211,10 @@ func (ser *secureEnclaveRunner) currentConsoleUserKey(ctx context.Context) (*ecd
return nil, fmt.Errorf("creating key: %w", err)
}

ser.slogger.Log(ctx, slog.LevelInfo,
"created new key for console user",
"uid", cu.Uid,
)
span.AddEvent("created_new_key_for_console_user")

ser.uidPubKeyMap[cu.Uid] = key
Expand Down
12 changes: 7 additions & 5 deletions ee/tpmrunner/tpmrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (tr *tpmRunner) Execute() error {
continue
case <-tr.interrupt:
tr.slogger.Log(context.TODO(), slog.LevelDebug,
"interrupt received, exiting secure enclave signer execute loop",
"interrupt received, exiting tpm signer execute loop",
)
return nil
}
Expand Down Expand Up @@ -208,10 +208,6 @@ func (tr *tpmRunner) loadOrCreateKeys(ctx context.Context) error {
}

if pubData == nil || priData == nil {
tr.slogger.Log(ctx, slog.LevelInfo,
"generating new tpm keys",
)

var err error
priData, pubData, err = tr.signerCreator.CreateKey()
if err != nil {
Expand All @@ -230,6 +226,9 @@ func (tr *tpmRunner) loadOrCreateKeys(ctx context.Context) error {
return thisErr
}

tr.slogger.Log(ctx, slog.LevelInfo,
"new tpm keys generated",
)
span.AddEvent("generated_new_tpm_keys")
}

Expand All @@ -242,6 +241,9 @@ func (tr *tpmRunner) loadOrCreateKeys(ctx context.Context) error {

tr.signer = k

tr.slogger.Log(ctx, slog.LevelDebug,
"tpm signer created",
)
span.AddEvent("created_tpm_signer")

return nil
Expand Down
Loading