Tame() – bad kitty, no socket for you
openbsd.org
openbsd.org
"Optional security is irrelevant (in the long term). Mitigation technologies which can be disabled -> fade into history"
This this this this this. As much as I like having control over my system and the ability to disable things, I've seen enough examples of users and corporate sysadmins taking years to fix basic security issues because there exists a quick and dirty workaround.
I really like it when tools do the work of preventing me from doing dumb stuff. Security, in particular, is such a difficult task with so much knowledge required (particularly in a language like C) that it's almost surprising that software has as few vulnerabilities as it does.
I'm unlikely to ever start a new project in C again, but if I do find myself in a networked C project maintenance or patching situation, I certainly would consider pulling this in.
I wonder what this would look like in other languages? It would be interesting to try this out in another language.
But, then again, a lot of the kinds of security bugs tame() is addressing really are already unlikely in Go or Rust. But, now that I think about it, I would like to see examples of priv-sep in Go or Rust. It's a challenging problem in C, and one that I never implemented (I was moving away from working on any C projects within a couple of years of priv-sep being introduced into OpenSSH), and one of the things that is neat about tame() is that is seems to abstract some of those difficult aspects. So, seeing best practices for priv-sep in a modern language would be really cool...I wouldn't even know where to start to figure it out, since I'm so new to both Rust and Go.
Where are Vernor Vinge's Focused programmers when you really need to outsource something?
I would love to "break glass" (I.e. temporarily gain privileged access) to a remote system's namepace and dtrace/systemtap running processeses without ever leaving my desktop.
There are also a couple of projects re-implementing the standard UNIX utilities in Rust and Go. I suspect that, like Linux couldn't have exploded in popularity without an existing and excellent suite of utility programs, it's unlikely a new OS could take off without the same existing for it. Though, implementing a UNIX-like/POSIX-compatible kernel might be a reasonable starting point. So far, however, the folks working on operating systems in Rust and Go are wanting to implement actually new operating systems, not merely reimplement UNIX in those languages. Which is to say, maybe an impossible goal, I dunno. No other kind of "make a better OS" project has actually succeeded without massive financial backing, and there have been many.
Both seccomp and separation of privileged processes seem fairly straightforward under Rust. (The former would require some knowledge of the syscalls Rust wants to use internally; the latter just involves fork and setuid/setgid.)
I have a crate for this, the use of which should be landed in Servo any day now: https://github.com/pcwalton/gaol
The exact same. It's a syscall to restrict available syscalls. It would probably be more fraught with issues in other languages as the runtime might issue somewhat unexpected syscalls in the course of its operation.
I don't know that it would be useless when wrapped and called from Python or Ruby, but it seems unlikely to have the same effect it has on C code (but, then again, C code needs a lot more help than Python or Ruby).
Are there other languages that have this feature? (wiki only mentions Ruby)
The right thing to do is to move away from plain string concatenation/interpolation: don't build dynamic SQL, don't hack together strings into JavaScript or HTML - use smart, format-aware templating tools (like golang's HTML templates) and parameterization.
I disagree with the 'false sense of security' as well - just like every other security feature from any system or technique you care to name, taint checking improves security but makes absolutely no claim that it magically makes your code completely secure.
I'd bet naked strings never get that far, because your business libraries all expect CustomerName or whatever.
Part of me appreciates that there is no magic javascript which mucks with the browser and makes the slideshow a real pain in the butt to navigate. However, this is going too far in the opposite direction. Each slide as its own page? Navigation is slow, all-but requires the mouse, and creates a N-length list of sites to go "back" through to return here.
Can we just come to a compromise: one page with each slide below the last? Allow us to take advantage of parallel fetching of assets, use native scrolling to progress, and you can even create anchors to link to a particular slide!
Even better, you could easily write some basic javascript and to turn such a page into the former version of a slideshow if you're so inclined.
And the link to magicpoint[2] is broken -- so where would one submit patches? The first one should probably be a new "generated by"-link that actually works...
http://member.wide.ad.jp/wg/mgp/
I've no idea how one would submit a patch though.
Looks like the html "template" is embedded in mgp.c, in the genhtml-function:
496 static void
497 genhtml(start_page)
498 int start_page;
499 {
There's apparently only one reference to "next page" (page +1): 596 if (page < maxpage) {
597 fprintf(html,
598 "<A HREF=mgp%05d.html>[next>]</A> "
599 "<A HREF=mgp%05d.html>[last>>]</A>\n",
600 page + 1, maxpage);
I guess: 596 if (page < maxpage) {
597 fprintf(html,
598 "<A HREF=mgp%05d.html REL='NEXT'>[next>]</A> "
599 "<A HREF=mgp%05d.html>[last>>]</A>\n",
600 page + 1, maxpage);
might do the trick?Then one could either add a js-shim to navigate based on rel=next, or use a client with support for that. Or, use a more modern package for generating slides. That'd be my first choice. Something like pandoc with S5:
http://pandoc.org/demo/example9/producing-slide-shows-with-p...
http://meyerweb.com/eric/tools/s5/s5-intro.html
Or (I don't use Emacs, so no idea if this really works) org-s5:
https://github.com/sigma/org-s5
Then again, I suppose there are no perfect tools...
And it would degrade nicely, too.
Any server today should be able to saturate it's network connection serving static content.
It doesn't matter how many requests for same images. Any server should be to fill network link serving static content. Even slow Apache could saturate 100Mbps 15! years ago. https://www.devside.net/articles/apache-performance-tuning
Those 200 images all fit into memory. All the server is doing is answering requests and copying those to the network interface. No disk IO, no computation, maybe not even the copy if server/nic can do zero-copy.
Adding JS to only prefetch, say, 10 slides forward, might be a good progressive enhancement, but not a requirement. And, along the lines of what someone else said, if your server is excessively burdened by a malicious client, or even one that doesn't execute your JS, that's a server problem.
Now, suppose browsers perform X concurrent requests (because of built-in behavior of the browser). Suddenly, you can not serve N users anymore, but only approximately N/X users.
Even the OpenBSD project is talking about "disruptive innovation"! The tech industry has really collectively jumped the shark.
In addition to this, the OP suggests ways in which it doesn't work well. Just because something 'works', doesn't mean it can't be significantly improved.
With the exception of the slides from Henning Brauer, who pick horrible red images for the background, most of the OpenBSD slide decks are very easy to read. Do anyone really care that they're using Comic Sans?
Yet in practice, tame(2) makes privilege dropping such a trivial activity that it will quite likely influence far more programmers than a more capable but also more grueling and complex mechanism like seccomp-bpf.
Speaking of which, here's a tame(2)-like wrapper over libseccomp: https://github.com/dimkr/libwaive
>> No matter how good the interface is, it’s almost certain this will never hit Linux in the next 5-10 years. It’s not because the interface is bad, but because the glibc-devs and other people are scared of simple and straight-forward interfaces, rather not doing anything than implementing an interface which handles the general case rather than trying to cover the 0.5% of edge cases, being complex and bloated.
> This is such a tough lesson to learn and to apply. I still fail at it most of the time in my own code, thinking up the weirdest edge cases possible that I need to handle rather than making the 99% case nice and simple.
I'm a CS grad student, I've worked in the industry before, and I am 100% guilty of sometimes dismissing a nice and simple solution because the perfectionist in me is annoyed that an edge case takes O(n^2) or that the algorithm won't give the optimal answer in some pretty rare circumstances.
[0] https://lobste.rs/s/4jlaod/tame_-_bad_kitty_no_socket_for_yo...
http://docs.oracle.com/cd/E23824_01/html/821-1456/prbac-2.ht...
https://blogs.oracle.com/casper/entry/solaris_privileges
http://www.oracle.com/technetwork/systems/hands-on-labs/s11-...
Sixteen years later, the concept has been completely co-opted by (often VC-backed) tech companies as a means of promoting their products and extracting unpaid labor from developers.
See https://en.wikipedia.org/wiki/Hackathon. The unsourced claim on Sun is explained in more detail on https://en.wikipedia.org/wiki/JavaOne
What does tame() itself DO?
Whitelist syscalls. Any non-whitelisted syscall being invoked causes the process to be terminated with SIGKILL (or a non-blockable SIGABRT if `abort` it set). Further tame(2) calls can only further restrict the whitelist. The whitelisting can get down to just _exit(2).
A request value of "" restricts the process to the _exit(2)
system call. This can be used for pure computation
operating on memory shared with another process.Edit: I see they originally use a bit mask and then changed to the space-separated string.
As OpenBSD's userland and libc is used extensively in Android, I wonder what the chances are of Google embracing tame() in future versions of Android.
Move your mouse button, and keep clicking. Not really the biggest deal. If not having a JS-based presentation kept you from reading all the way through, you're probably the person who will never use tame() anyways, so... it is what it is. :P
This issue has come up multiple times. At this point they're only trolling their own users.
Covering it with artifacts makes anything painful to read.