Skip to content

fix: measure storage-first grant lifetime from now - #59

Merged
mellowcroc merged 3 commits into
mainfrom
fix/storage-first-grant-remaining-time
Sep 18, 2026
Merged

mellowcroc merged 3 commits into
mainfrom
fix/storage-first-grant-remaining-time

Conversation

@mellowcroc

Copy link
Copy Markdown
Collaborator

Summary

Storage-first upload grants cap remaining lifetime at accept (expires_at vs now), not expires_at − issued_at.

AWS STS Expiration is one hour from AssumeRole completion. Relay used to stamp issued_at before that call, so an honest 1h session failed the signed span check by a few seconds (storage-first upload credentials may last at most 1h0m0s).

issued_at stays an independent stamp. It is not computed from AWS expiry. A 2-minute provider-clock allowance covers round-trip skew; it is not extra requested duration. Guided flow still requests --credential-ttl 1h.

This lives in the online image, so existing cc812 ceremonies keep the old check until they use a new image.

Test plan

  • go test ./internal/access/ including AWS 1h overshoot vs 12h remaining
  • go test ./cmd/relay/
  • Live AWS 1h storage-first grant from a local image built from this commit
  • Does not claim to unstick in-progress cc812 containers

AWS STS Expiration is 1h from AssumeRole completion, while issued_at was
stamped before the call. Honest 1h sessions then failed the signed span
check by a few seconds.

Cap remaining validity at accept instead of expires_at minus issued_at.
Keep issued_at as an independent stamp. Do not derive it from Expiration.
@mellowcroc
mellowcroc force-pushed the fix/storage-first-grant-remaining-time branch from fbaf84e to bcb35f4 Compare September 18, 2026 08:43
CI still expected Validate() to reject a 1h+1s AWS overshoot. Accept that
span at remaining-time checks and reject 12h remaining instead. Record the
change in release notes.
@mellowcroc
mellowcroc merged commit 8a72064 into main Sep 18, 2026
7 checks passed
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.

1 participant