12 ms·
Unikernels are secure
- dmitrygr 9y agoThe argument that something IS secure is somehow supported by a whole lot of hypotheticals of the form "we could do $X and that would be secure if someone also did $Y". So say it how it is: unikernels COULD be secure if all this work that needs to be done and we haven't done was done...maybe
- wmf 9y agoThat's par for the course. Unikernel people talk about VMs that use megabytes of RAM while cloud providers only provide gigabytes. Unikernel people talk about spawning VMs in tens of milliseconds while clouds take tens of seconds.
- PieSquared 9y agoIn addition to the blog post, there's an interesting discussion on Github that happened before the blog post was published: https://github.com/Unikernel-Systems/unikernel.org/pull/45 https://github.com/Unikernel-Systems/unikernel.org/pull/45
- Danihan 9y agoExcellent discussion. I'm not knowledgeable enough in Linux internals to know whether the ring0 versus ring3 criticism is warranted. Is it just a matter of if/when an attacker achieves escalated privileges they will have far more attack surface on ring0?
- tscs37 9y agoThere is quite a difference. Ring 3 is userspace, you can't interact with hardware or the operating system or anything not in Ring 3 directly. Ring 0 is everything. There are no restrictions and nothing stops you from writing "Ahahah You didn't say the magic word!" over your entire memory until the CPU crashes. Having root on a linux kernel is heavily restricted compared to this and still runs in Ring 3 like all other userspace code. As root, you still have to run the kernel. As Ring 0, you can replace the kernel. Or run your own OS.
- mato 9y agoAccess to ring 0 on a traditional OS is indeed usually "game over". In the case of a unikernel deployed on a hypervisor this is not the case, since there is not much else in ring 0 that you wouldn't already have access to from ring 3. Conceptually you can think of the hypervisor as "kernel space" and anything inside the unikernel as "userspace". There are advantages to running the unikernel solely in ring 3 (eg. immutable page tables) however this is not a requirement for security.
- tscs37 9y agoI still see it as worse than a normal application being compromised. When Ring 0 is compromised, there is no alert or anything to protect the app from compromise. If there is an exploit, it's game over. However, in Ring 3 and a normal kernel, you get various protections that allow the kernel to recognize some attacks and shutdown the application immediately or even shutdown the kernel. This prevents a compromised app from running to some extend. A unikernel cannot do this. If the app is compromised and I don't notice and don't restart it... Even worse, the attacker could use it as leverage to infect other unikernel based instances of the app to gain some permanence against restarts by simply reinfecting when an instance goes down. The unikernel is not userspace, not even conceptually. The hpyervisor will not shutdown the app unless it executes illegal instructions. The kernel will shutdown misbehaving programs more easily.
- mato 9y ago> A unikernel cannot do this. If the app is compromised and I don't notice and don't restart it... I disagree. There's no reason such mitigations (not sure what exactly you're referring to) can't be implemented by the monitor process (ukvm in the Solo5/ukvm model). I'd also argue that a normal kernel does not do any integrity checks on the code running in a user process, so the model is exactly the same. > Even worse, the attacker could use it as leverage to infect other unikernel based instances of the app to gain some permanence against restarts by simply reinfecting when an instance goes down. For that they'd need to break out of the virtual machine and into the hypervisor / monitor. Which is by no means impossible, but with careful design of unikernel-specific monitors can be much reduced. Of course, I'm by no means suggesting you should back your unikernels with a monitor along the lines of QEMU :-)
- rwmj 9y agoIt's secure if and only if there's a formal proof.
- adrianN 9y ago"Secure" sounds like a binary attribute but it's actually not. A formal proof doesn't save you from errors in the specification. At some point you need trust, the amount of trust needed is inversely proportional to the security.
- dreamdu5t 9y agoWithout a formal proof there is no measure of correctness at all.
- adrianN 9y agoLots of passing tests mean nothing to you?
- monocasa 9y agoWhen an exploit only needs one edge case not handled right? No, lots of unit tests means nothing. Maybe less than nothing due to the false sense of security they seem to give you.
- 45h34jh53k4j 9y agolets not go too far! tests can provide a security advantage over regressions or bugs introduced in the future. They are necessary but not sufficient to prove a particular security level.
- adrianN 9y agoSo you trust a software that has had zero testing equally to a software like sqlite that has extensive testing?
- 9y ago
- Cieplak 9y agoHypothetically, if there were a buffer overflow in a unikernel process, wouldn't it potentially give the exploit full-system access, whereas a normal operating system would detect the out-of-bounds memory access and kill the process? I'm sorry if this is an ignorant question.
- nkozyra 9y agoI'm not super familiar with this, but it seems like the question is what is "full-system" in this case if each application is sandboxed with its own embedded kernel? I mean there's no shell, ostensibly all other applications and system functions are bundled similarly, right?
- PeterisP 9y agoIt'd make exploits more difficult, but you'd still be able to upload your own code to do whatever you want. The trouble is that instead of uploading "/bin/sh" you'd have to upload the whole shell which you'd want to run; instead of making a syscall for something that a normal kernel would do but this one doesn't, you'd have to compile and upload appropriate code (including device drivers) to get that done. It'd be a "bring your own machine code" party.
- digi_owl 9y agoBest i can tell, unikernels are a reaction to the shift from VMs to containers in cloud services. This by pairing down the content of a VM to the bare minimum. Meaning that if you have a buffer overflow or similar, all you could access was what was in the VM (unless you also happen to pack a VM escape). That said, i can't help think "DOS in a can" whenever i read about unikernels.
- perbu 9y agoIf it wasn't for the negative connotations people have with DOS I'd say it a lot more. Implementing a unikernel chain loader and a simple shell would be quite simple. That would be quite DOS-like. IncludeOS actually came out of a research need to stress-test hypervisors and run 10000 VMs on a single host. Since it is a clean slate system it has some different characteristics and those can be exploited in certain use cases and so people have kept on working on it.
- nkozyra 9y agoThe intro video is somewhat confusing - it indicates that they're secure but if that they're "harder to attack" and says if they are compromised they can be restored. Also, he said "in the future, I believe unikernels will be more or less unbreakable" I think you could describe that as "more secure" or perhaps more generically "safer" rather than "secure."
- FungalRaincloud 9y agoI don't really like the argument that something is 'secure' because it is not vulnerable in the same ways that an alternative is. I think this is why I like talking about encryption so much. It's possible to mathematically prove the security of encryption algorithms, and all that's really left to pick apart is the implementation, politics and impact.
- vertex-four 9y agoEhh... you can often prove that X algorithm is not susceptible to A, B or C attacks, but you cannot usually prove that the algorithm is "secure" in a fundamental sense.
- jacksnipe 9y agohttps://en.wikipedia.org/wiki/Provable_security https://en.wikipedia.org/wiki/Provable_security You can prove that it's secure in that the algorithm itself does not leak information.
- taeric 9y agoYeah, but this is not what most people think of when they think secure, is it? That is, this proves that people have to actually break an algorithm to know what it is protecting. This does nothing to show that an algorithm is unbreakable. (As an example of my understanding, rot13 does nothing to randomize distribution of characters, so it "leaks" information about what it has modified. This sort of leakage can be proven as absent from your algorithm. Anything else is a bit tougher.)
- klodolph 9y agoWith some exceptions, those proofs make assumptions about their primitives like having block ciphers be "unpredictable permutations" or having hash functions be "random oracles". These proofs also make assumptions that information doesn't leak in other ways (like BEAST, heartbleed, timing attacks, poor entropy sources, etc). In other words, those proofs don't have as much real-world significance as you'd like.
- meson2k 9y ago> Good luck guessing that address. Our own unikernel, IncludeOS, randomizes addresses at each build, so even with access to source code you still don’t know the memory layout. "There is one mortal sin in computer security (or by the way, in any kind of security) that is feeling safe. It’s just a variation of pride to be true, but it’s very deadly. Blindly trusting a protection technology is an extreme error." Read up on DEP. Randomizing function addresses at each build is useless when it comes to attack mitigation. You need to randomize addresses at each execution.
- agumonkey 9y agois linux randomizing is per exec ? ps: BSD have started to randomize at boot time, fun times
- geofft 9y ago> is linux randomizing is per exec ? Not entirely sure what you're meaning to ask, but yes, Linux does KASLR and tries very hard not to leak pointer addresses from the running kernel to unprivileged userspace: https://lwn.net/Articles/569635/ https://lwn.net/Articles/569635/ It's been enabled by default since the upstream 4.12 kernel, and usually well before that in distros.
- _joel 9y agoKALSR's not the same as ASLR (although ideologically related). ALSR has been around for a good number of years in userspace via randomize_va_space sysctl (edit I presume that's what the poster above mentioned re: per exec)
- dreamdu5t 9y agoHard to take claims of security seriously for untyped languages which are not provably correct and lack a denotational semantics. Let's start by provably not compiling buffer overflows and memory overreads considering those are the vast majority of RCE and privilege escalation.
- perbu 9y agoC++ is strongly typed. I believe there are frameworks that will give you denotational semantics in C++. It shouldn't surprise anyone that feature X is available in C++. But I acknowledge there are tons of shotguns strewn around everywhere in C++ so you can blow your feet off.
- willtim 9y agoC++ is not "strongly typed" when compared to almost any other statically-typed language, e.g. Ada, OCaml, Haskell or Rust. This is a big part of why it is so insecure.
- geofft 9y ago> Unikernels have no shells. Most attacks I’ve seen invoke /bin/sh to modify the system they are attacking. Without a shell the attacker doesn’t have this opportunity. This forces the attacker to use machine code to subvert the system, decreasing the likelihood of succeeding with the attack. This argument is completely incoherent.
- tptacek 9y agoAnd, while this is a more minor rebuttal, it's still worth saying: it's totally incorrect. Modern exploits (for definitions of "modern" meaning "written after 1999") do not care if you have a shell on your system. The author has presumably confused the concept of a POC, which is an exploit reduced and simplified for the consumption and understanding of laypeople, with that of a real exploit.
- mato 9y agoAs one the early users[1] guilty of using the "there is no shell" argument for unikernel security, I agree with what you say. I would rephrase the argument as "there is no fork()/exec()", meaning that a unikernel cannot spawn a new process. A unikernel application which only executes native code[2], combined with a hypervisor / hardware that enforces immutable page tables and NX, AFAICT leaves ROP/JOP as the sole remaining attack vector for RCE. Further, each deployment of the application should be done via a new build (or at least re-link), which can employ the build-time ASLR Per mentions to mitigate ROP/JOP attacks. I'd be interested in your thoughts on what other relevant attack vectors I've not thought of that would allow for a persistent compromise of a unikernel. Feel free to discuss here or on the devel.unikernel.org forum thread[3]. [1] Page 4 in this whitepaper from 2015: https://wiki.xenproject.org/images/3/34/XenProject_Unikernel_Whitepaper_2015_FINAL.pdf https://wiki.xenproject.org/images/3/34/XenProject_Unikernel... [2] Does not contain a JIT or interpreter able to "eval()" new code. [3] https://devel.unikernel.org/t/unikernels-are-secure-here-is-why/258/2 https://devel.unikernel.org/t/unikernels-are-secure-here-is-...
- tptacek 9y agoWhat difference does it make if there's no fork/exec? Back in 1999 we had MOSDEF and CORE IMPACT, both of which used staged loaders to boot up a language runtime in a remote process after compromising it with a stack overflow. In a broader sense this is stuff that viruses had been doing for about 8 years prior to that. Only executing native code is no defense at all. You're not even stopping attackers from the '90s like that. ROP is only a hardship until exploit code can find a way to allocate executable memory or hook the program's own dynamic execution (note: this is not necessarily a "JIT" or "eval") capabilities. ASLR only matters when exploits can't find infoleaks. Really, what you're describing here is the browser security model. When staffed by the largest, best security teams in the world, the browser security model almost works.
- mtgx 9y ago> IncludeOS is a clean-slate unikernel written in C++ with performance and security in mind. One of those things doesn't belong there. Guess which?
- benmmurphy 9y agodon't unikernels run everything in ring0. if you run everything in ring0 you can't claim not having system calls is a security feature :/
- peterwwillis 9y ago"Unikernels have no shells. Most attacks I’ve seen invoke /bin/sh to modify the system they are attacking. Without a shell the attacker doesn’t have this opportunity. This forces the attacker to use machine code to subvert the system, decreasing the likelihood of succeeding with the attack." Timmy the software developer and his many years of forensic analysis have led him to believe that you need a shell to root something. Literally the entire page's takeaway about security is "It's hard to use, so it's secure!"
- nneonneo 9y agoSo, basically, we're going to run all your code at ring0, so a single bug is now either a total DoS (kernel shuts down) or an exploit vector straight to ring0. Although they talk hypothetically about a defense for that involving the MMU, this is not implemented in IncludeOS. The build should not be relied on to be secure either; certain classes of memory disclosure bugs could leak out enough memory to let you work out e.g. a ROP payload, which wouldn't require injecting any machine code necessarily. Plus, a long-lived machine, or a single instance deployed across many machines, would present insufficient diversity to protect against a determined attacker. The gist here appears to be the notion that their build diversity gives them most of their security, while they've eliminated most of the traditional defense layers (ASLR, DEP/NX, privilege separation, API isolation, etc.) If the attacker gets her machine code running in the unikernel environment, it's game over no matter what. The machine code can just directly implement a subset of needed functionality without having to call out to unikernel functions. In short - this post has a hell of a click bait title but really insufficient evidence to suggest that these are truly "secure".
- rrdharan 9y ago> In short - this post has a hell of a click bait title but really insufficient evidence to suggest that these are truly "secure". From the original pull request drafting this post: > While I agree that making hyperbolical claims isn't typically good I'm not sure if it is bad here. There seem to be a tradition in unikernel land with outlandish claims in various blogposts ("Unikernels will kill containers in five years", "Unikernels are unfit for production", etc) so I wrote it with that tone in mind. https://github.com/Unikernel-Systems/unikernel.org/pull/45 https://github.com/Unikernel-Systems/unikernel.org/pull/45
- eriknstr 9y agoIf the unikernel people keep up with the hyperbole the potential audience will learn to just ignore most posts about unikernels. Please don't use hyperbole.
- wmf 9y agoKeep in mind that it's ring 0 inside a VM that contains almost nothing. Really a unikernel is just a process that uses hypercalls instead of system calls. So exploiting a unikernel is no worse than exploiting a user process, and the article explains a few reasons it could be more secure. But they should definitely add ASLR.
- sethev 9y agoA unikernel is running a single process in a single address space. So yes, if you compromise the app you compromise the whole system but the whole system is the app.
- im_down_w_otp 9y agoThat's not entirely true in practice. I'm currently playing with rump kernels deployed on top of seL4's hypervisor to give my platform the security posture of a unikernel inside the security posture of seL4 VM isolation. You could potentially compromise the rump kernel, but you still wouldn't be able to break out of the VM's isolation context.
- tscs37 9y agoThe app is still compromised. On top of that, you didn't get to reap the benefits of any of the protections you get from a proper Kernel like Ring 3 execution, NX bits on pages, guard pages on the stack, etc.
- eriknstr 9y ago> What we need is this: > * packet interface for the network > * a block interface for some storage > * a serial port to output console data Some applications need additional devices, such as for example hardware RNG, atomic clocks and/or GPGPU.
- notacoward 9y ago"No system calls" Yeah, they're direct function calls now. How exactly is that more secure? The author's right that many traditional exploit paths are gone, but only because they've been replaced by even easier ones.
- wmf 9y agoThey assume that 99% of libc was stripped out at build time. The full network stack is probably there but there might not be much filesystem code.
- robotresearcher 9y agoBecause you don't know how to call the functions, as explained in the article. To call a function, you need to know its address among other things. And you don't, since the address was decided at random at build time (or even boot time in some systems).
- notacoward 9y agoThere are other ways to find functions besides knowing their addresses a priori.
- robotresearcher 9y agoHow is this done? I think kernels try not to leak the address of system calls at run time, and if they are scattered around in a 64bit address space they are tough to search for. Educate me!
- xorcist 9y agoI have no idea, but couldn't you use some part of the software you just compromised that makes syscalls?
- robotresearcher 9y agoThere are no syscalls as the fine article explains.
- api 9y agoSo now the hypervisor is ring0, the cloud provider is the OS, and the OS is the app. IP is the IPC and the Internet is the IPC bus. I suppose the hypervisor is more minimal and secure. Tenenbaum, thou art avenged.
- msla 9y agoUnikernels are not that new. CMS running on VM has existed since the 1960s, with CMS being the unikernel (actually, a unitasking OS about as complex as MS-DOS) and VM being what's now called a hypervisor: Something which multiplexes hardware, but provides no APIs, such that VM guests think they're running alone on bare hardware. (VM can even run VM as a guest, recursively, which is useful for developing the newer version of VM on a machine other people are using for other work.) Therefore, we can evaluate these claims by asking what we know about security breaches on VM/CMS systems.
- PhantomGremlin 9y agoSomething which multiplexes hardware, but provides no APIs, such that VM guests think they're running alone on bare hardware. There is what amounts to an "API". The virtualized software thinks it's talking directly to hardware, so the API is just an emulation of that hardware. Since controlling hardware is almost invariably messier than doing system calls, the API is actually more complex. Therefore, we can evaluate these claims by asking what we know about security breaches on VM/CMS systems. Here's an HN post I wrote a few years ago, about VM exploits: https://news.ycombinator.com/item?id=9241807 https://news.ycombinator.com/item?id=9241807 Plenty of exploits to be found, many of which were related to emulation of "I/O channel programs", which are, essentially, System/370 I/O "hardware".
- msla 9y ago> There is what amounts to an "API". The virtualized software thinks it's talking directly to hardware, so the API is just an emulation of that hardware. Since controlling hardware is almost invariably messier than doing system calls, the API is actually more complex. Nobody said a hypervisor was completely trivial, but just to be clear, a pure hypervisor wouldn't "emulate" any hardware except what was physically present on the system. The line between "virtual machine" and "hypervisor" and "emulator" are blurry enough as it is, and I'd like to be clear about what the subject of this little thread is. > Here's an HN post I wrote a few years ago, about VM exploits: https://news.ycombinator.com/item?id=9241807 https://news.ycombinator.com/item?id=9241807 > Plenty of exploits to be found, many of which were related to emulation of "I/O channel programs", which are, essentially, System/370 I/O "hardware". Very interesting. Thank you.
- jeshwanth 9y agoLooks to be unikernel is just a RTOS, why the name unikernel then ? Whats the difference with RTOS?
- im_down_w_otp 9y agoA RTOS means a specific thing regarding timing (and sometimes fairness) guarantees. A unikernel isn't that.
- numbsafari 9y agoA unikernel could be designed as an RTOS, but not all RTOS are unikernels (in fact, I'm not aware that any are). Indeed, QNX, a RTOS, is not implemented using a single address space, nor is your application linked against the kernel and supporting libraries into a unikernel. While it's certainly possible that you could implement an application/unikernel with real-time guarantees, I'm not aware of a specific unikernel implementation that targets that space specifically.
- jeshwanth 9y agoThanks or your kind reply, I use to find difficult to classify between RTOS and unikernels technically.
- wglb 9y agoI would hesitate to call something Secure unless some major pen test effort were engaged to try to break it. This is a corollary to "If it isn't tested it is broken". (Another corollary is "Even if it is tested, it may still be broken.") This is more so with security. Just looking at some of the assumptions, e.g., that the lack of a shell significantly increases the difficulty of an attack, leaves me with doubts about the claims.
- dvfjsdhgfv 9y agoMy thoughts exactly. If they wrote "more secure", this would make more sense. In the current form it's just boasting.
- perbu 9y agoHi author here. I agree wholeheartedly. I wasn't thinking in absolutes, but I absolutely can understand how it could read that way. I could have titled the post "Unikernels are resonably secure", but then nobody would have read it. I was doubtful about mentioning the lack of shell. Technically it doesn't really do much in terms of security, but it does make a compromise harder. And currently, where we stand, a lot of the security comes from things being really, really hard to compromise. Guessing adresses, not having a shell, potentially no filesystem, etc.
- wglb 9y agoWith "Unikernels are reasonably secure", but then nobody would have read it., you might also take into account whether the audience, having read it, are happy that they did. The title sounded pretty absolute. So you do have a noble goal. When I am asked to assess software, to gain a first order approximation, I often look at the culture of the organization that produced it. On the high end, that often translates to some sort of formal process involving un-fun letters like 'ISO' and 'SOC'. For smaller organizations, or OSS software, I try to get a feel for how the developers seem to be thinking about security. Some of the cultural things I see in your writeup are encouraging--Smaller Codebase, Removing hardware emulation, Cutting off access to ring 0--all bode well for how you are thinking about producing secure software. But there are some things that are missing from your description. What is your development process? In particular how and when do you attack your assumptions about how the code actually works? What flaws have you found in your testing? Zero findings could mean 1) it wasn't tested 2) it wasn't tested very hard 3) the testers were not very good at security testing. And as OpenBSD's history has illustrated, some things are totally secure until they aren't.
- RRRA 9y agoAnd if you run a Linux kernel with a C app as one, for example, it's probably possible to run a shellcode proxy in memory, even if you can't modify the app code, you could ROP if a big enough buffer overflow is possible on the stack, etc.?
- m3kw9 9y agoClaiming something is secure is more like claiming an over unity perpetual machine
- kmicklas 9y ago"Secure" and yet they aren't even using a memory safe language such as Rust.
- rdtsc 9y ago> There are two aspects of unikernel security. There are two aspects of unikernel security. One is the vector into the VM and the other is the vector from the VM into the hypervisor. The "vector into the VM" might not be as obvious. For example, in a network security contest in college I compromised the source repository of the server to give my team an advantage and won. That was before git it was just a folder on the server. Others argued it wasn't fair but the instructor sided with me since that's a plausible scenario in real life. There also tempest-like attacks for extracting private keys and such, so it's there at also at least the 3rd vector - from VM to the hardware as well. And forth from VM to the network (but I guess these can be subsumed in the "to the hypervisor" case).
- skywhopper 9y agoSo to summarize, unikernels stop a couple of attack vectors (syscalls and running other programs (notably shells) that are loadable from well-known paths). Address randomization is not unique to unikernels, and the other benefits are theoretical for the time being until hypervisors provide more unikernel support (though the mention of paravirtualization makes me think performance (particularly network) in this theroetical hyper-restricted mode will be poor). While I certainly sympathize with the idea that the typical kitchen-sink deployment of a full suite of administrative/troubleshooting/build tools on an application server is a security risk, it seems the actual improvements enumerated here are relatively small potatoes. Apologies for not knowing a lot about the state of the art here, but I'm curious about how these unikernels address VM-internal security (eg, network, filesystem, inter-process level stuff). Do you farm all of that out to the hypervisor? Design around the lack of it? _Is_ there even "inter-process stuff"?
- kasey_junk 9y agoI'm interested that they didn't list the "old" reason people thought unikernels could be more secure. That is that they could be small enough to be completely written in higher languages. With something like https://github.com/GaloisInc/HaLVM https://github.com/GaloisInc/HaLVM you could bring to bear formal methods in more straight forward ways. This of course left the host still needing to be secured using traditional approaches but that surface area was smaller. I'd buy that you can't list that in an article about why all unikernels are already secure, but that seemed to be the heart of the pitch to me when I first started hearing it.
- woodrowbarlow 9y agowell, you also have to keep in mind that this article is written by the CEO of a company producing a particular unikernel implementation -- one that isn't written in a higher language.
- futurix 9y agoGeneralisations are generalising.
- floobyhoob 9y agoThe real problem for unikernels is that they are effectively irrelevant until the major clouds provide millisecond boot times along with appropriate pricing models that charge for execution on a millisecond level basis. Developers love to write code, but unless unikernel developers start speaking up instead of writing code, the major clouds won't get on board and provide the needed fast boot times plus pricing, which makes all this unikernel code not a lot more than interesting personal / academic projects. Questions of unikernel security are certainly academic if the cloud infrastructure doesn't run them in the most effective manner.
- weberc2 9y agoWhy are millisecond bit times necessary? Linux doesn't boot in a millisecond...
- floobyhoob 9y agoBecause you can then build single function unikernels that do one thing very fast then disappear from RAM. The point being that docker is actually a really clunky thing that is reinventing the virtual server ecosystem within the OS which is pointless. Serverless systems are better implemented as unikernels than docker images. Unikernels make it possible to boot an entire OS in milliseconds, service an inbound web request, then disappear.
- corndoge 9y agoWhat's the use case for booting an entire OS to service a request?
- floobyhoob 9y agoServerless applications
- hderms 9y agowhen the OS is just some library functions statically compiled in and the entire binary is a few megabytes that you can load directly into memory, why not?
- munin 9y agoNone of the claims in this have anything to do with the essence of security, they all address the window-dressing of security. What does it mean for something to be secure? As I see it, for something to be secure, it means that every security invariant holds under all attacker models. Let's break this down. What's a security invariant, and what's an attacker model? A security invariant is a statement like "information may only be read by principals authorized to do so" or something similar. The blog post talks about "oh well every exploit I've seen pops a shell with /bin/sh and we don't have /bin/sh so you can't hack it." This attacks the symptom and not the disease. If the attacker is in a position to run /bin/sh you are already at a disadvantage, the attacker was previously going to break your security invariant by spawning a shell and then copying out your secrets. They could instead just use their code execution to read the secrets directly, ala heartbleed, if they are in the same address space. An attacker model describes the attacker, their motivations/goals, and capabilities. For example, what if the attacker wanted to take your unikernel enabled app and repurpose it into an e-mail spam bot? Well, there isn't a writeable FS and there isn't the ability to exec stuff, so the old model of "copy some files up and run them" won't work. However, is there executable memory in general? Can the application allocate existing executable memory? If the application is, or involves, for example a modern JavaScript interpreter, then it has to be able to do this in some capacity. So now the attacker modifies their methods so that their goal can be achieved in the constraints of this new system. There is an argument you can make about sandboxing and principle of least privilege, but that argument transcends unikernels really. Look at the sandboxing and separation strategies used by programs like chrome, vsftpd, and qmail. They (in conjunction with enforcement technologies like seccomp-bpf or selinux) can make the same guarantees about the lack of system calls and least privilege. I'm pretty sure that the title of this post really should be "unikernels are obscure" because that's the layer of protection you're really getting here.
- deleted 9y ago[deleted]
- bogomipz 9y agoThe article states: >"Unikernels on the other hand don’t have system calls. They only have function calls." If my program is compiled against glibc functions which wrap actual system calls how does my program work when there is no userland? Is there a compiler that compiles my program to a unikernel target? Can someone explain how this works?
- kensai 9y agoWhy am I reading this "Unicorns"? :D
- cyphar 9y agoOne thing that I never understand when I read articles like this (especially this article) is that the "security improvements" that are mentioned are entirely related to there being no userspace (you don't need a shell or syscalls if you don't have a userspace). But the whole point of userspace is to provide privilege separation between the kernel and userspace. In unikernels everything is in the kernel, and you can freely mutate in-kernel state without any segmentation violations. In other words, of course there are no syscalls when there is no separation between user code and the kernel ("no syscalls" is the description of a unikernel). So, what is the tangible security benefit? What I want to know is how do you protect against in-kernel ROP? Or hell, just plain old-fashioned stack overflows? The ASLR mentioned is not really useful because it's only on-recompile (Linux's ASLR is on-execution). The only experience I've had with writing shell code was messing around with https://microcorruption.com/ https://microcorruption.com/ for a few evenings, and even I know that putting everything into the same address space is just asking for trouble (of course you can mitigate it, but praising the premise as a feat of security seems to be missing the point to me). Maybe I'm just massively misinformed, but I simply don't see how someone can proclaim that "unikernels are secure" by just re-stating the premise as the justification for their security (and then following up with a bunch of hypotheticals).