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 cloud log flag: add records to cloud logging when fetching token from attestation verifier #417

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

Ruide
Copy link
Collaborator

@Ruide Ruide commented Feb 27, 2024

No description provided.

@Ruide Ruide requested a review from alexmwu February 27, 2024 02:10
@Ruide
Copy link
Collaborator Author

Ruide commented Feb 27, 2024

/gcbrun

cmd/flags.go Outdated Show resolved Hide resolved
cmd/token.go Outdated Show resolved Hide resolved
cmd/token.go Outdated Show resolved Hide resolved
cmd/token.go Show resolved Hide resolved
launcher/agent/agent.go Show resolved Hide resolved
@Ruide
Copy link
Collaborator Author

Ruide commented Feb 27, 2024

/gcbrun

@Ruide Ruide enabled auto-merge February 27, 2024 15:47
cmd/flags.go Show resolved Hide resolved
cmd/token.go Show resolved Hide resolved
cmd/flags.go Outdated Show resolved Hide resolved
@Ruide Ruide force-pushed the cloud-logging branch 3 times, most recently from 5c46471 to 51895c1 Compare February 27, 2024 18:03
@Ruide
Copy link
Collaborator Author

Ruide commented Feb 27, 2024

/gcbrun

@Ruide
Copy link
Collaborator Author

Ruide commented Feb 27, 2024

/gcbrun

@Ruide
Copy link
Collaborator Author

Ruide commented Feb 28, 2024

/gcbrun

Copy link
Contributor

@alexmwu alexmwu left a comment

Choose a reason for hiding this comment

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

What about testing?

Also, please address the documentation comments on #375. Either here or another PR is fine.

cmd/flags.go Outdated Show resolved Hide resolved
cmd/flags.go Outdated Show resolved Hide resolved
cmd/flags.go Outdated Show resolved Hide resolved
cmd/token.go Outdated Show resolved Hide resolved
cmd/token.go Outdated Show resolved Hide resolved
@Ruide
Copy link
Collaborator Author

Ruide commented Feb 28, 2024

/gcbrun

@Ruide Ruide force-pushed the cloud-logging branch 2 times, most recently from 4f37af4 to 2fa358c Compare February 29, 2024 00:24
@Ruide
Copy link
Collaborator Author

Ruide commented Feb 29, 2024

/gcbrun

cmd/flags.go Outdated Show resolved Hide resolved
cmd/token.go Show resolved Hide resolved
cmd/token_test.go Outdated Show resolved Hide resolved
cmd/token_test.go Outdated Show resolved Hide resolved
@Ruide
Copy link
Collaborator Author

Ruide commented Mar 4, 2024

/gcbrun

@Ruide
Copy link
Collaborator Author

Ruide commented Mar 4, 2024

/gcbrun

var cloudLogger *logging.Logger
if cloudLog {
if audience == "" {
return errors.New("cloud logging requires the --audience flag")
Copy link
Contributor

Choose a reason for hiding this comment

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

capitalize Cloud Logging, as it's a proper noun

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

go-staticcheck would give "error strings should not be capitalized (ST1005)"

@@ -72,7 +72,12 @@ func TestTokenWithGCEAK(t *testing.T) {
}
defer mockAttestationServer.Stop()

RootCmd.SetArgs([]string{"token", "--algo", op.algo, "--output", secretFile1, "--asAddr", mockAttestationServer.server.URL})
mockCloudLoggingServerAddress, err = newMockCloudLoggingServer()
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have expected you to check the loggingHandler.logs output matches up.

Copy link
Collaborator Author

@Ruide Ruide Mar 6, 2024

Choose a reason for hiding this comment

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

The attestation would give different ak_cert since we are using tpm simulator. Do you have a reference or recommendation on a deterministic TPM simulator output?

Copy link
Collaborator Author

@Ruide Ruide Mar 6, 2024

Choose a reason for hiding this comment

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

I create a new PR with the loggingHandler.logs output matches up. I use a simple field comparison for attestation. Please let me know if there is a better way!

@Ruide Ruide merged commit b658847 into google:main Mar 6, 2024
11 checks passed
alexmwu added a commit to alexmwu/go-tpm-tools that referenced this pull request Mar 29, 2024
Breaking Changes:
[launcher/cmd] Refactor verifier for issue google#419
* Unexport `cmd.Instance`, `cmd.MetadataServer`,
  `cmd.NewMetadataServer`.
* Move package `verifier` from launcher to go-tpm-tools.
  * `verifier.Client`, `verifier.Challenge`, etc.
* Move package `fake` from launcher to go-tpm-tools.
  * `fake.Claims`, `fake.NewClient`, etc.
* Move package `rest` from launcher to go-tpm-tools.
  * `rest.NewClient`, `rest.BadRegionError`, etc.

New Features:
[cmd] Add new command token in the CLI tool google#375
[cmd] add records to cloud logging when fetching token from attestation verifier google#417

Bug Fixes:
Statically link binaries built by goreleaser google#425

Other Changes:
Update readme to include the instruction to use the prebuilt gotpm tool. google#424

New Contributors:
@Ruide in google#375
@qinkunbao in google#424
@alexmwu alexmwu mentioned this pull request Mar 29, 2024
alexmwu added a commit to alexmwu/go-tpm-tools that referenced this pull request Mar 29, 2024
Breaking Changes:
[launcher/cmd] Refactor verifier for issue google#419
* Unexport `cmd.Instance`, `cmd.MetadataServer`,
  `cmd.NewMetadataServer`.
* Move package `verifier` from launcher to go-tpm-tools.
  * `verifier.Client`, `verifier.Challenge`, etc.
* Move package `fake` from launcher to go-tpm-tools.
  * `fake.Claims`, `fake.NewClient`, etc.
* Move package `rest` from launcher to go-tpm-tools.
  * `rest.NewClient`, `rest.BadRegionError`, etc.

New Features:
[cmd] Add new command token in the CLI tool google#375
[cmd] add records to cloud logging when fetching token from attestation verifier google#417

Bug Fixes:
Statically link binaries built by goreleaser google#425

Other Changes:
Update readme to gotpm CLi instructions. google#424, google#426

New Contributors:
@Ruide in google#375
@qinkunbao in google#424
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