Slashdot Mirror


OpenBSD Releases a Portable Version of OpenNTPD

Noryungi (70322) writes Theo De Raadt roundly criticized NTP due to its recent security advisories, and pointed out that OpenBSD OpenNTPD was not vulnerable. However, it also had not been made portable to other OS in a long time. Brent Cook, also known for his work on the portable version of LibreSSL (OpenBSD cleanup and refactoring of OpenSSL) decided to take the matter in his own hands and released a new portable version of OpenNTPD. Everyone rejoice, compile and report issues!

13 of 79 comments (clear)

  1. Mathematics by ledow · · Score: 4, Interesting

    I'm led to believe that the reason we're using ntpd and not any of the other is that, although they are fine for getting your home machine to approximately the right second, they are damn-near useless for anything that you want real time-keeping for.

    So if you want to interact with stratum-1's or be a stratum-2, then you'll be using ntpd. And, en-masse, NTP is not something as simple as just clock-skewing. That throws lots of things out of kilter. Granted, you may think you don't care, but these things can come back to bite you if you make a hasty decision now.

    When someone like the NTP pool project (that I run a couple of serverse on) come to me and tell me that ntpd isn't secure enough, and that OpenNTP is good enough , then maybe I'll go over to them. Fact is, I haven't heard anything along those lines.

    There's a lot of maths behind getting your clocks in sync quickly without going backwards in time, or slowing to a crawl, or messing up timestamps a lot. It's not as simple as "let's just drag the users clock closer to the reference one constantly". ntpd does a LOT that other NTP servers don't, and a lot of that is important for anything that you want to rely on a timeserver for.

    Sorry, but this is just blatant "Look at us, we run an NTP project that's secure" when actually it does less than 10% of what ntpd does. And to make it do what ntpd does, presumably will take years of work to secure.

    There are various "rewrite" projects at the moment, but all known holes with ntpd are closed. Until there's a compelling reason to move, don't. And by the time there is, you'll find properly-written, full-featured NTP projects being offered.

    Nobody's talking about sub-millisecond accuracy here either. We're just talking not cocking up the one thing you plug in an NTP server to get right - the time.

    1. Re:Mathematics by QuietLagoon · · Score: 2
      It's a matter of numbers.

      .
      I have ten servers for which the 100 millisecond accuracy of OpenNTPD is perfectly fine. I have one server where I may need more accuracy than that.

      So I'd rather run the risk of having only one server with the bloated mess of ntp, and having a valid alternative for my other ten servers.

      ...Sorry, but this is just blatant "Look at us, we run an NTP project that's secure" when actually it does less than 10% of what ntpd does.

      ... Sorry, but your comment is just a blatant, "Look at us, the ntp project provides more accuracy, so just ignore everything else that is wrong with it."

      To my eyes, it looks like the ntp project is the arrogance of the openssl project all over again.

      ...Until there's a compelling reason to move, don't....

      There have been two compelling reasons to move recently.

    2. Re:Mathematics by Terje+Mathisen · · Score: 4, Informative

      [Full Disclosure: I have been a member of the NTP Hackers team for ~15 years, so you could claim that I'm partly to blame for the recent security problems even if I have not personally worked on the crypto or monitoring code.]

      NTPD is definitely more complicated that what you need for a leaf (client-only) machine, like all the server functions and the code that support locally attached reference clocks, this is the main reason PHK is working on a dedicated NTP client.

      We have known for many years that the monitoring functions, in particular the "mode 6" UDP packets were a potential DDoS amplification vector, which is why we replaced them.

      For the crypto stuff we did what pretty much every other project did, i.e. we imported the functions we needed from openssl, and like pretty much every other project we messed up a few buffer handling issues.

      The important point here is that anyone running a public server with a recommended configuration (no crypto, no remote monitoring) would not have had any security problems, even if they insisted on using 10+ year old versions!

      With any version from withing the last 3-5 years you would also have been secure against the DDoS vector even if you did allow remote status monitoring.

      How many system-level sw packages are you using where this would have bee true?

      Terje
      PS. OpenNTP should properly be called OpenSNTP, since it implements the Simple NTP subset instead of the full NTP protocol stack which includes system clock time/frequency tuning.

      --
      "almost all programming can be viewed as an exercise in caching"
    3. Re:Mathematics by Shakrai · · Score: 2

      Thank you for your work on behalf of NTP and the ntpd team. :)

      I have a long standing interest (obsession) in time, going back to my childhood days where I would synchronize all of the clocks in the house. ntpd is easily one of my favorite pieces of software and I've kept at least one server in the NTP Pool since 2006. I sold the first server to my boss as a means to monitor the stability of our connection while giving something back to the internet community, then got a static IP on my home connection so I could run one there, then deployed a few servers to other locations as time and money allowed. Right now I'm down to one, my personal server, but it's on a 50mbit/s connection and serves around 500-600k requests per hour.

      Out of all of the software that I run that's internet facing ntpd is the daemon that I worry about the least. It has a solid security track record and anyone who bothered to read the Wikipedia article about it (never mind research the history of the software the old fashioned way) would know this....

      --
      I want peace on earth and goodwill toward man.
      We are the United States Government! We don't do that sort of thing.
    4. Re:Mathematics by plcurechax · · Score: 2

      Chrony is a complete working implementation of the NTP protocol.

      You mean complete except for broadcast/multicast mode, or authentication based on public-key cryptography. Some basically it's a good client and a unauthenticated / inefficient (network) server.

      It also makes some pretty misleading claims; Chrony can usually synchronise the system clock faster and with better time accuracy except it never explains how it can possibly achieve better time accuracy than NTPd.

      Chrony does handle a number of client usage scenarios better than NTPD (namely non-permanent network connection, and laptop-like environments) as far as I know, but it does not achieve better accuracy for the usage scenarios NTPD was primarily designed for (e.g. network connected servers).

      NTPD gets its knickers in a twist at the slightest excuse and sometimes ends up stepping the time even though it has perfectly good Internet connectivity and a reasonably good internal clock.

      Yet chrony can't detect rouge or fix broken time servers. Beyond possibly having better handling for clients of dynamic clock frequencies (i.e. SpeedStep, and various other power saving features that modify one or more of the several frequency oscillators in a computer.). I say possibly because I am not certain of the state of affairs in the current NTPD code base, I know it was lacking when dynamic clock frequencies originally appeared in systems, but I am not sure that it still is naive about that.

      Chrony keeps steady time even if Internet access is intermittent. It never gets confused and picks a falseticker pretending to be stratum one instead of a stratum 3 with correct time, unlike NTPD.

      While it does appear Chrony has improved greatly from a simple SNTP client for intermittent network connectivity it was when I first heard about it, that is still its forté, and likely the best client for many end-users' cases. Still it is not a robust general purpose replacement of NTPD.

      It even has interfaces to GPS clocks or other hardware clocks, so you can run your stratum 1 server on Chrony if you want.

      And YouTube is full of people doing stupid, reckless, and/or unwise things too. That's perhaps too harsh, but that's those "features" are quite incomplete.

      Having PPS (Pulse Per Second) optional support is a good start, it is not a comprehensive solution to running a quality stratum 1 server. I expect a stratum 1 server to have improved or at least quantified oscillator ("clock") parameters, such as ideally TCXO (Temperature-Compensated crystal Oscillators) or OCXO (Oven-Controlled crystal Oscillator) for the stratum 1 system's time-keeping. For commercial systems I would suggest looking at a professional NTP server network appliance, there are several vendors including Spectracom, Symmetricom, Meinberg, and others.

    5. Re:Mathematics by lowen · · Score: 2

      Define 'accurate.'

      I need submillisecond time here (where here is a radio astronomy observatory), with no discontinuities like an SNTP client will insert (stepping time is not 'accurate'). That's why I have three stratum 1 local NTP servers that use Agilent Z3816A GPS-disciplined clocks.

      SNTP != NTP and is totally unsuited for any use that cares about real continuous, accurate, time. Read the 'time-nuts' mailing list at febo to see what real accuracy is.

  2. There are other alternatives already by loonycyborg · · Score: 4, Interesting

    Like chrony.

    I wouldn't recommend openntpd because it isn't an implementation of ntp

    1. Re:There are other alternatives already by amorsen · · Score: 2

      SystemD does not have an NTP client. It has an SNTP client. Just like OpenNTPD.

      --
      Finally! A year of moderation! Ready for 2019?
  3. Re:Why can't anyone write secure software? by mrchaotica · · Score: 4, Funny

    Hey, speak for yourself! I wrote a secure "hello world" once....

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  4. Very very different... by Junta · · Score: 3, Informative

    ntp is surprisingly complex to deal with a surprisingly complex thing. If tlsdate was a decent enough utility, then we'd still be using the time protocol of rdate as the go-to time sync strategy. Precision and quality is much lower.

    There's also a couple of tricky things. One is that it could be dropped in TLS 1.3. Another is that it doesn't play with the concept of TLS certificate expiry.

    Basically, this is a potentially handy utility to take the place of rdate, not something that begins to touch ntp.

    --
    XML is like violence. If it doesn't solve the problem, use more.
  5. Re:Why can't anyone write secure software? by Shakrai · · Score: 3, Funny

    I wrote a super secure interactive hello world once, so the user could see "hello world" in any language of their choice:

    int main (int argc, char **argv) {
    char hello[256];

    gets(hello);
    printf("%s\n", hello);
    return 0;
    }

    Works best when run with root permissions. :)

    --
    I want peace on earth and goodwill toward man.
    We are the United States Government! We don't do that sort of thing.
  6. Learn Something About NTPD Before You Rant..... by Shakrai · · Score: 3, Informative

    imo, when you go for that last nanosecond of accuracy as the highest priority

    That's kind of the whole point of a timeserver. If you're just running a typical client that doesn't need precision there are a multitude of SNTP implementations that you can use, including the one built into Windows. If you're running something that demands precision or wish to share your time with others (random plug: NTP Pool) you're going to need a little bit more accuracy than that.

    and lower the priority of writing secure software to the point where it is no longer a priority, then you have ntp.

    ntpd has been around since the 80s. Contrast it against other system daemons that have been around that long (sendmail) and you'll see that it has a solid security record. The recent "exploits" only impacted a small subset of servers that were using the cryptographic functionality of ntpd, which is primarily used for remote management and peering relationships and was a non-issue for the lion's share of configurations. Configurations to work around the issues were released immediately and a patch to solve them entirely was available within days. What more do you want? This was all discussed on the NTP Pool mailing lists and the consensus was "meh." I'm not aware of any NTP server that has been compromised because of these exploits.

    The biggest issue that's hit ntpd in the last year was the ease with which you could use the 'monlist' command for amplification attacks. This too was easily solved with a configuration change and in any event did not compromise the integrity of the servers running ntpd. It's symbolic of a larger problem that has hit other protocols (DNS) and which will never go entirely away until network operators get off their lazy asses and implement the recommendations of BCP38.

    --
    I want peace on earth and goodwill toward man.
    We are the United States Government! We don't do that sort of thing.
    1. Re:Learn Something About NTPD Before You Rant..... by Shakrai · · Score: 4, Interesting

      Good for you. My ntpd server served over 100,000 unique clients in the last hour and has been running without any issues whatsoever fully exposed to the internet since 2006. And that's a "young" server by the standards of the ntp community.

      Your welcome to use whatever software you wish but there's no reason whatever to put down the efforts of another FOSS team of volunteers other than to be a smug superior asshole.

      --
      I want peace on earth and goodwill toward man.
      We are the United States Government! We don't do that sort of thing.