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

Datastore: System clocks do step back #603

Open
ecpullen opened this issue Apr 4, 2023 · 4 comments
Open

Datastore: System clocks do step back #603

ecpullen opened this issue Apr 4, 2023 · 4 comments

Comments

@ecpullen
Copy link
Contributor

ecpullen commented Apr 4, 2023

The system_time function in the data store is designed to prevent a clock from stepping back while reading targets; however, some systems do step back. Should there be a tolerance for the stepped back time?

@webern
Copy link
Contributor

webern commented Apr 5, 2023

Or... should the system clock step back check exist at all?

@jpculp
Copy link
Contributor

jpculp commented Apr 6, 2023

I think the step back check has a valid purpose, but it should allow for a short window of variance (1s? 3s?).

@webern
Copy link
Contributor

webern commented Apr 6, 2023

has a valid purpose

Maybe, but it only protects against an attack vector where the system clock steps back during the metadata validation process. I don't think there's anything stopping an attacker from setting the system clock back before the whole process starts, which seems easier to do in the first place.

I don't have a total grasp over the attack vector and the mitigation that system_time affords. If we understand it then we should probably start by deeply documenting it. Right now all it says is:

/// Ensures that system time has not stepped backward since it was last sampled

What's missing is why. What are we mitigating exactly.

1s? 3s?

This kind of illustrates the problem. What is a valid fudge factor for bad clocks? Who knows?

@webern
Copy link
Contributor

webern commented Apr 6, 2023

Put differently, is there a critical point in the metadata validation algorithm in which stepping the clock back would be more beneficial to an attacker than having done that before the start of the algorithm?

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

No branches or pull requests

3 participants