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

gRPC: reject request if clock skew is too large #7686

Merged
merged 5 commits into from
Aug 29, 2024
Merged

Conversation

aarongable
Copy link
Contributor

@aarongable aarongable commented Aug 27, 2024

Have our gRPC server interceptor check for excessive clock skew between its own clock and gRPC client clocks. Do this by taking advantage of the client request timestamp that most clients already supply for the purpose of measuring cross-service latency. If the included timestamp is more than 10 minutes from the gRPC server's local time, immediately error out.

To keep the integration tests -- which heavily rely on clock manipulation -- working, use build tags to disable this behavior during integration testing.

Fixes #7684

Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

A small error message tweak, otherwise looks good.

grpc/interceptors.go Outdated Show resolved Hide resolved
jsha
jsha previously approved these changes Aug 28, 2024
test/helpers.py Outdated Show resolved Hide resolved
@aarongable aarongable requested a review from jsha August 28, 2024 18:58
@aarongable aarongable merged commit e5731a4 into main Aug 29, 2024
19 checks passed
@aarongable aarongable deleted the gossip-time branch August 29, 2024 18:32
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.

Ensure service clocks stay in sync
3 participants