-
Notifications
You must be signed in to change notification settings - Fork 39
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
Added an optional feature to compare the local time with a set of trusted ntp servers #143
Conversation
ntp servers. If the local time is diffing more than a configured threshold, the service shuts down itself. Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Codecov Report
@@ Coverage Diff @@
## main #143 +/- ##
==========================================
- Coverage 53.79% 49.64% -4.15%
==========================================
Files 15 18 +3
Lines 712 846 +134
==========================================
+ Hits 383 420 +37
- Misses 285 382 +97
Partials 44 44
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
The motivation behind this PR is that for a TSA it's extremely important that we are using a time source that's accurate. Just relying on the host's time can be dangerous, as NTP may not be enabled, or the configured NTP server is not correct. Having the process itself verifying its time with external thirdparty servers is defence in depth, and following the "trust but verify" philosophy. |
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing we discussed in #133 was using NTP servers that provided NTS. I'm not sure if there are enough, but something to consider, it would be great if we could secure the NTP connections
// RandomChoice returns a random selection of n items from the slic s. | ||
// The choice is made using a PSEUDO RANDOM selection. | ||
// If n is greater than len(s), an empty slice is returned. | ||
func RandomChoice[T any](s []T, n int) []T { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooooo how fancy, using generics :) I love it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, yeah it's the first generics code I wrote, and actually felt natural to make this function like this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the first generics code I've seen in sigstore repos!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailblazer 😏
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great, just a few nits!
Signed-off-by: Fredrik Skogman <kommendorkapten@github.com>
If the local time is diffing more than a configured threshold, the service shuts down itself.
Signed-off-by: Fredrik Skogman kommendorkapten@github.com
Release Note