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

Leases #55

Merged
merged 38 commits into from
Oct 3, 2022
Merged

Leases #55

merged 38 commits into from
Oct 3, 2022

Conversation

jeffa5
Copy link
Collaborator

@jeffa5 jeffa5 commented Sep 27, 2022

Fixes #21

Except #68

src/app/app.cpp Show resolved Hide resolved
@jeffa5 jeffa5 marked this pull request as ready for review September 28, 2022 16:31
@jeffa5 jeffa5 mentioned this pull request Sep 28, 2022
21 tasks
src/app/kvstore.h Outdated Show resolved Hide resolved
@jeffa5 jeffa5 force-pushed the leases branch 2 times, most recently from bc77998 to 1abdda1 Compare September 29, 2022 08:29
src/app/leases.cpp Outdated Show resolved Hide resolved
src/app/leases.h Outdated Show resolved Hide resolved
This makes it more consistent and allows us to use
get_untrusted_host_time_v1. This function isn't static so we can't have
our handlers be static either.
src/app/leases.h Outdated Show resolved Hide resolved
Copy link
Contributor

@jumaffre jumaffre left a comment

Choose a reason for hiding this comment

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

Nice! I think the implications of using the time of the untrusted host (there's no secure time in the enclave) should be spelled out somewhere. This effectively means that a malicious operator could revoke a lease early or extend an existing one (i.e. there's an attack vector every time the app uses get_time_s). How bad is this? Should the API be extended for the client to pass in their current local time?

@jeffa5
Copy link
Collaborator Author

jeffa5 commented Oct 3, 2022

Nice! I think the implications of using the time of the untrusted host (there's no secure time in the enclave) should be spelled out somewhere. This effectively means that a malicious operator could revoke a lease early or extend an existing one (i.e. there's an attack vector every time the app uses get_time_s). How bad is this? Should the API be extended for the client to pass in their current local time?

Yep the lack of secure timing is a bit of a nuisance. Since leases might typically be used for some sort of leader election I'd imagine that it could be a bit troublesome (constantly flipping leaders). I'm not sure if the clients that use the lease would be trusted enough to provide times either since they could maliciously give a time that invalidates other leases.

Perhaps we could compromise, expose a way of clients also providing their current time in the request, and then comparing it to the local time from the OS. If they are not too different (within a configurable limit) then we know we can trust the timing somewhat. If they are too different just error out?

Something to bear in mind and discuss going forwards. I'll make an issue.

@jeffa5 jeffa5 mentioned this pull request Oct 3, 2022
@jeffa5 jeffa5 enabled auto-merge (squash) October 3, 2022 14:58
@jeffa5 jeffa5 disabled auto-merge October 3, 2022 14:58
CMakeLists.txt Outdated Show resolved Hide resolved
@jeffa5 jeffa5 merged commit 3647663 into main Oct 3, 2022
@jeffa5 jeffa5 deleted the leases branch October 3, 2022 15:43
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.

Implement leases
2 participants