7 ms·
“Openntpd is not vulnerable.”
- joshbaptiste 12y agoAround 10 years ago it was written by Henning, at my request because the ntpd source code scared the hell out of us And this is what I like about the OpenBSD community.
- rtpg 12y agoAnother bit I find interesting >At the time communications with the ntp team showed they had little interest in removing unused functionality from the ntp.org code, or any help with our form of source code audit. Am I the only one who enjoys removing unused code? My favorite commits are the ones with negative net lines. This might be a liberal usage of the word "unused" though...
- ChuckMcM 12y agoWhen I evaluate programmers I give effectively three times as much credit for removing a line of code than adding one. Sort of .5 for adding a line, 1.0 for changing a line, and 1.5 for reducing by a line. The principle being that well understood code should converge on the simplest correct solution over time.
- hiphopyo 12y agoNice take on the whole "perfection is achieved, not when there's nothing left to add, but when there's nothing left to take away" thing!
- SixSigma 12y agoOne of my most productive days was throwing away 1000 lines of code - Ken Thompson Deleted code is debugged code. — Jeff Sickel
- gweinberg 12y agoI wouldn't say I enjoy removing unused code, but I definitely feel like I've accomplished something when I do.
- craftkiller 12y agoFor those interested about the srand comment I believe he was referring to arc4random https://www.youtube.com/watch?v=aWmLWx8ut20 https://www.youtube.com/watch?v=aWmLWx8ut20
- detrino 12y agoIt's probably the fact that using time() for seeding a PRNG is a really poor choice.
- pdw 12y agoEspecially if your clock is synced with every other clock in the world.
- aidenn0 12y agoHere's what happens when you do that: http://alt.org/nethack/player-all.php?player=WowDeath http://alt.org/nethack/player-all.php?player=WowDeath Full article here: http://taeb-nethack.blogspot.com/2009/03/predicting-and-controlling-nethacks.html http://taeb-nethack.blogspot.com/2009/03/predicting-and-cont...
- deleted 12y ago[deleted]
- kevin_thibedeau 12y agoIt isn't a problem if all you need is a deterministic sequence of numbers that are pseudo-random like what rand() provides. Not every use of a PRNG involves cryptographic security or potentially dangerous exposures of internal state.
- detrino 12y agoThere are concerns with using time() as a seed other than security. Besides, consider what you are typically trying to express: initialize my PRNG with a random seed. Almost never are you trying to express: initialize my PRNG so that all runs in the same second will behave identically.
- jgwest 12y agoDudes... I don't really care... I just want a way to synchronize my VPS clock with that of other, established, secure clocks... because DigitalOcean (okay, go ahead and downvote me) is not quite synched, and neither is Linode, and my server!!! Oh good Lord my server don't know the time at all! Dudes... just agree on something that I can install SIMPLY... 'cuz the infighting between ntp and openntp ain't nothing that I care to be involved with... JUST MAKE IT EASY!!!!
- atmosx 12y agoWhat are you whining about? What DO, Linode, etc. Have to do with anything???? OpenNTPd is extremely easy to configure. The problem is that it's not the default choice while, apparently, it should be. Same goes with almost all OBSD-derivates (OpenSMTPd, OpenSSHd, OpenNTPd, etc.). Here is the first guide at google: https://wiki.archlinux.org/index.php/OpenNTPD https://wiki.archlinux.org/index.php/OpenNTPD Feel free to ask, if you feel that there's something exotic that needs to be done before getting OpenNTPd to work.
- geofft 12y ago> What are you whining about? What DO, Linode, etc. Have to do with anything???? Well, there's a good argument to be made that your VPS provider should be running an accurate time daemon (whatever that might be), and you should just have paravirtualized access to the current time, instead of every VM being expected to run some form of ntpd on its own, and the hypervisor track scores of virtual clocks. There's even a good argument to be made that running the NTP algorithm in a VM doesn't work: https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Broomhead.pdf https://www.usenix.org/legacy/event/osdi10/tech/full_papers/...
- stefantalpalaru 12y ago"The portable version is outdated and in need of a maintainer." - http://www.openntpd.org/ http://www.openntpd.org/ The most recent version for OpenBSD is 4.6 while the "portable" one is 3.9 .
- protomyth 12y agoThe OpenBSD 5.6 release notes http://www.openbsd.org/plus56.html http://www.openbsd.org/plus56.html show changes, so the non-portable version is being updated. You will see changes in previous releases.
- finid 12y ago> The OpenBSD 5.6 release notes http://www.openbsd.org/plus56.html http://www.openbsd.org/plus56.html show changes I don't see anything about openntpd on that page. Are you makign stuff up?
- dwc 12y agoChecking CVS[1] I see there are a few changes recently (4 weeks, 6 weeks, 2 months, ...) so it is being maintained. 1. http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/ntpd/ http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/ntpd/
- protomyth 12y ago> I don't see anything about openntpd on that page. Are you makign stuff up? The ntpd they mention is OpenNTPD see http://www.openbsd.org/faq/faq6.html#OpenNTPD http://www.openbsd.org/faq/faq6.html#OpenNTPD So, no, I am not "makign stuff up".
- deleted 12y ago[deleted]
- gonzo 12y agoToo bad openntpd isn't standards compliant. Fortunately, phk is already fixing ntpd. http://phk.freebsd.dk/time/index.html http://phk.freebsd.dk/time/index.html
- djmdjm 12y ago"isn't standards compliant" how?
- dalke 12y agoI believe gonzo meant "isn't portable", as OpenNTPD uses OpenBSD-only APIs. See this cousin thread: https://news.ycombinator.com/item?id=8778577 https://news.ycombinator.com/item?id=8778577 .
- gonzo 12y agoYes, this non-portability is part of the openbsd playbook and strategy. There is a "non-portable" version of libressl, too.
- djmdjm 12y agoThere's a non-portable version of OpenSSH too. This strategy produces high-quality software while making developers' lives easier. (All in my highly-biased opinion)
- finid 12y agoI thought Linux distributions stopped using ntpd a couple of years ago. On Fedora, which powers the computer I'm writing this from, Chrony is in use, not ntpd, so I guess my PC is immune from whatever is floating out there.
- microcolonel 12y agoYou can also use timedated, an optional daemon packaged with systemd. Works really well for me, I just turned it on and it hasn't complained since. The command you'll want to run is: # timedatectl set-ntp true And it'll have you within a deep fraction of a second from a decent timeserver in about ten seconds, and keep you there indefinitely. NOTE: For the person who downvoted this because they don't like systemd, seriously, you need to find a better hobby.
- mst 12y agoAlso downvoted it because you'd be insane to trust systemd for this. timedated isn't an improvement, it's just a new attempt at the code. In five years, you can recommend it. For the moment, let's leave systems code to the people who understand it.
- microcolonel 12y agoBlah, blah, blah. You shouldn't discount everyone but the OpenBSD guys just because ntp.org's ntp is a 200kloc overgrown, underengineered mess. It offers a good out for people who would otherwise use ntp.org's ntp, and at least it's about 200x less complex(1056 lines of C). Stasticially speaking, it's unlikely to be as faulty. Timedated is an improvement even if just for the fact that it's incredibly simple to operate. You press a button and you're synchronized; very little to mess up. I use OpenNTPD on my OpenBSD boxes, but that doesn't make me immune to alternatives.
- gonzo 12y agoUnfortunately, the OpenBSD "community" is all over HN.
- agwa 12y agoYou're being downvoted because this article is about the security of NTP implementations, yet your basis for recommending systemd-timesyncd is that it "works really well" for you. Well, ntpd worked well for me too but that didn't make it secure. You offer no basis for thinking systemd-timesyncd is secure, and yet there are many indications that it might be insecure: 1.) it's new, 2.) it wasn't designed with security in mind (unlike openntpd), and 3.) systemd's other reimplementation of a complex, hard-to-secure, UDP-based protocol (DNS) was discovered to lack even the most basic security protections[1]. Even someone who likes systemd's init system functionality should think really hard before using systemd's DNS and NTP appendages. This kind of stuff needs the attention of security experts. It can't just be reimplemented as an afterthought and be secure. [1] http://seclists.org/oss-sec/2014/q4/592 http://seclists.org/oss-sec/2014/q4/592
- peterwwillis 12y agoTheo de Raadt is proof that it doesn't matter what community you come from, you can still be a huge douche as long as you write code well.
- comex 12y agoBecause it was a rewrite, the major benefit in openntpd is that it priviledge seperated. If problems like these were found, they would not be realistically exploitable. Furthermore openntpd is a modern piece of code <5000 lines long written using best known practices of the time, And it very probably has zero memory safety bugs (pretty easy in 4,000 lines of code, as measured in a tarball I just downloaded), and privsep provides further defense at the cost of adding a lot of complication to the code... but I'm getting bored of this approach to security. For new code - I know openntpd is not new code, but I don't think this approach is popular in general yet - why not switch to Go or (when it's stable) Rust, or even JavaScript or Lua, and end up with essentially zero chance of such bugs being possible, regardless of how carefully or not the code was written, without the need for any privilege separation code? For something like NTP or SSH or most of the other daemons written in C people have sitting around, with the possible exception of high performance HTTP servers, the CPU overhead of any those languages is very unlikely to be noticeable (and privsep has overhead anyway). (Admittedly, this would not help with non-memory-safety attacks such as NTP amplification...) In particular, I'm going to make a bold claim: for OpenBSD to continue to release new daemons written in C, as it does, is irresponsible for a security-focused distribution. As much as they like the language - I do too -, as much as the whole expertise and design of the project is based on C, such that there is a naturally huge disincentive to switch languages, and as much as OpenBSD is able to minimize (but not eliminate) security advisories of this type, memory corruption is so dangerous that building a truly secure system requires making as much code as possible immune to the possibility of it. (Hmm, I guess running AddressSanitizer in production would be nearly as good.)
- toyg 12y agoI agree but I also see the counterpoint: a further abstraction layer (or VM) between language and iron can make it more difficult to identify abuses / edge cases, which is where security holes naturally hide. C compilers are very well-understood at this point, they are "the devil you know" so to speak.
- easuter 12y agoIndeed, not to mention the fact the there are lots of folks who need to use the OS on modest hardware (embedded devices for example) and having additional runtimes for a language like Go or Javascript (god save us) is kind of out of the question. Rust seems to be a saner alternative, but isn't production ready.
- w8rbt 12y agoCode has bugs. The less code you write, the less bugs you have. It's pretty simple really. OpenBSD has always done this well and taken a lot of criticism for it.
- fubarred 12y agoExcerpt from our several year old netbsd build scripts with annotations: install_openntpd() { install_from_source net/openntpd ### via pkgsrc cp /usr/pkg/share/examples/rc.d/openntpd /etc/rc.d/ replace_service 'ntpd' 'openntpd' ### idempotently edits rc.conf to ensure ntpd=NO and openntpd=YES } The openntpd default pool.ntp.org is a sane default that also doesn't leak host OS information as do most NTPd-based default confs.