Skip to content

Secret Manager validation fails when using versions/latest #689

@celia-vytrac

Description

@celia-vytrac

Description

The secret() function in cmd/tesseract/gcp/secret_manager.go incorrectly validates Secret Manager responses when using versions/latest.

What I Observed

When requesting a secret using versions/latest (e.g., projects/123/secrets/my-secret/versions/latest), the Secret Manager API returns the resolved version path in resp.Name (e.g., projects/123/secrets/my-secret/versions/4).

The comparison fails because these strings don't match:

if resp.Name != secretName {
    return nil, errors.New("request corrupted in-transit")
}

This causes a misleading "request corrupted in-transit" error even though the request completed successfully.

How to reproduce

  1. Deploy tesseract GCP binary with signer keys using versions/latest:
    --signer_public_key_secret_name=projects/{project}/secrets/{secret}/versions/latest
    

Environment

  • tesseract version: v0.1.1
  • Image: ghcr.io/transparency-dev/tesseract/gcp:v0.1.1

Expected behavior

Ideally, if this is intended behavior and latest is deliberately not supported, a different error should report that to the user.

If latest support is desirable:

  1. Remove the name comparison (the CRC32C checksum validation already ensures data integrity)
  2. Normalize the comparison by accepting latest

Workaround

Use explicit version numbers instead of latest. (Which requires manual updates when rotating secrets)

The flag documentation says Format: projects/{projectId}/secrets/{secretName}/versions/{secretVersion} which implies latest is valid, but the terragrunt examples all use explicit version numbers like versions/1.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions