News for hackers. Stuff that matters.
Re:Perl code that is syntactically correct only on Fridays by darkwater on Wednesday February 16, 2022 @11:47AM (#30362267)
A cronjob to sync the time instead of a proper NTP client doesn't sound that good either. I know that each place has its own weird things because historical reasons but NTP is quite ancient.
Re:Perl code that is syntactically correct only on Fridays by knodi123 on Wednesday February 16, 2022 @11:59AM (#30362433)
Our sysadmin was being paranoid about how many memory-resident programs we ran. he figured time syncing wasn't important enough to justify a daemon, so he just ran the ntpdate command on a daily schedule. It wasn't that bad - after all, how far can clocks drift in a single day!? ;-)
Re:Perl code that is syntactically correct only on Fridays by tristor on Wednesday February 16, 2022 @02:53PM (#30364851)
> he figured time syncing wasn't important enough to justify a daemon

Time synchronization is very arguable THE most important thing on a server (for numerous security related reasons).

How many moons ago was this incident? It's perhaps forgivable ignorance in the 90s... not so much today.

Re:Perl code that is syntactically correct only on Fridays by Dylan16807 on Wednesday February 16, 2022 @05:26PM (#30366667)
For security? Kerberos usually has a 5 minute tolerance. Are you saying that's wrong? Because if your hardware/firmware isn't literally broken you won't drift anywhere near that in a day.

NTP can't properly fix a clock like that either since it's often capped at adjusting the speed by one part per two thousand. At most, with a consistently wrong clock, that can handle about 30 seconds per day. Any worse than that and you won't see much advantage over ntpdate.

Re:Perl code that is syntactically correct only on Fridays by randomswede on Thursday February 17, 2022 @02:47AM (#30370526)
The bigger the clock skew, the harder it is to correlate events from logs. The harder it is to corelate, the more information needs to come from your machine-fueled winnowing stage, to the final inspection by eyeballs.

1-2 seconds is (probably) well within manageable. But, since you now know for SUER that you have clocks running at different speeds, you need to over-estimate the skew. And hope that the daily skewing is approximately constant over time.

So, yes, clock skew can have an impact on your security, because it makes event correlation (and followup on security incidents) harder.

Re:Perl code that is syntactically correct only on Fridays by Dylan16807 on Thursday February 17, 2022 @02:53AM (#30370549)
"It makes logs more annoying, and sometimes security needs logs" is a pretty weak connection, though. And it's a far cry from precise timing being "THE most important thing on a server". Is there anything more direct at all?
Re:Perl code that is syntactically correct only on Fridays by randomswede on Monday February 21, 2022 @10:14AM (#30416706)
It's basically a whole bunch of small "make it harder to correlate" issues. If you have a distributed system (which you probably do, if you care about time to the point of considering if daily ntpdate or continually running ntp-or-equivalent is better), you will probably end up with timestamps somewhere in a protocol.

This could be timestamps in a DB server, or similar.

You can then, if you have too-large skew, end up in the weird position that one of "things that have been commited in the DB is not yet showing up on the frontends" (if the time used as a cut-off for the frontend's query is lagging behind the DB server and the timestamp is set by the DB server) or "things that have been commited are not showing up when you query for SELECT timestamp <= NOW()" (if the DB server is lagging, and the timestamp is set by the client).

If that maters, well, that's really a business and data quality issue.

Some distributed systems will also try to figure out what skew you have across the whole system and then end up taking N times that skew, before it can consider data persisted (see for example Spanner ,and probably CockroachDB). If your distributed system relies on timestamps for consistency, and it doesn't self-discover the skew, you're basically not guaranteed whatever consistency guarantees that the distributed system claims to have.

Again, is this important? It really depends. Is it OK of your distributed data store drops some of your data on the floor and lets you clean up the mess? Sometimes, yes, totally. Is it OK if you get uniqueness guarantees violatedl because two thigs got the same unique ID? Again, sometimes, almost-unique is enough.

Fo most people, log correlation is probably the biggest point, though.

Re:Perl code that is syntactically correct only on Fridays by krick on Wednesday February 16, 2022 @12:32PM (#30362865)
Admin like that sound a lot worse than the intern. Unless maybe if it's an intern-admin...
Re:Perl code that is syntactically correct only on Fridays by xorcist on Wednesday February 16, 2022 @12:32PM (#30362881)
If you are to be paranoid about time, better be paranoid about stepping time. Time discontinuities can trigger bugs in the best of software.
Re:Perl code that is syntactically correct only on Fridays by shadowoflight on Wednesday February 16, 2022 @12:29PM (#30362825)
Guess it's time to change the `0` in that cronjob to a `*/12`.
Re:Perl code that is syntactically correct only on Fridays by tremon on Thursday February 17, 2022 @06:56AM (#30372149)
after all, how far can clocks drift in a single day!?

Well, having run a Linux kernel on OpenBSD's vmm: they can drift more than a single day in that time. I did have to resort to using an ntpdate cron job because ntpd just couldn't cope with the time dilation effect. The cron job was configured at * * * * * (i.e. every minute), which roughly translated to once every 180 wall-clock seconds (+/- 30s).

Re:Perl code that is syntactically correct only on Fridays by zaphirplane on Wednesday February 16, 2022 @09:01PM (#30368686)
It’s the size of the correction that can cause problems