News for hackers. Stuff that matters.
Re:QEMU Advent Calendar: A surprise disk image each day unti... by jai_ on Monday December 03, 2018 @08:41AM (#18588640)
Is there significant risk in booting untrusted OS images within Qemu?
Re:QEMU Advent Calendar: A surprise disk image each day unti... by rwmj on Monday December 03, 2018 @09:19AM (#18588899)
You need to take steps to harden qemu - I wouldn't do it with qemu out of the box using the command line. In RHEL (eg for Red Hat's OpenStack) we do:

* Aggressively compile out unused features/devices.

* Confine each VM with separate SELinux contexts (sVirt).

* Run qemu as a special non-root user.

* Use seccomp to confine the system calls.

* Pass in pre-opened file descriptors to qemu, so qemu doesn't need to open files (helps with writing tightly confined SELinux policy).

* Run qemu in a cgroup.

* Run qemu-img with resource limits.

* Compile qemu with all hardening features enabled like RELRO, PIE, etc.

* Audit the code manually and with Coverity.

* Take security reports seriously and have a fast patching mechanism (you can effectively "live patch" qemu by migrating a VM off the old qemu and on to the new qemu).

Probably more that I've forgotten about ...

Re:QEMU Advent Calendar: A surprise disk image each day unti... by nerpderp82 on Monday December 03, 2018 @02:38PM (#18592151)
Please make a gist or blog post!
Re:QEMU Advent Calendar: A surprise disk image each day unti... by rbanffy on Monday December 03, 2018 @01:41PM (#18591567)
This sounds like a lot of fun. What are you doing with those VMs?
Re:QEMU Advent Calendar: A surprise disk image each day unti... by rwmj on Monday December 03, 2018 @03:33PM (#18592640)
I work for Red Hat and this is how VMs are configured by default if you buy RHV, RHOSP, KubeVirt or similar on-prem or public virtualization or cloud products from us. You can turn some of these mitigations off if you want, although I wouldn't personally recommend it - at some time of another there has been a security critical bug which has been mitigated by each one of these changes.

Some of our customers are running untrusted VMs in their public clouds using this configuration. Others will be running on-premises virtualization set ups with VMs from across their companies which can be equally risky.

SELinux is probably the most important mitigation in the list, and while it has a bad reputation that's mostly from people who haven't used it for over a decade. I have SELinux enforcing on every machine I use, and it rarely causes an issue.

Re:QEMU Advent Calendar: A surprise disk image each day unti... by syn0byte on Monday December 03, 2018 @10:30AM (#18589464)
Short Answer: Yes.

Historic(2015) VM escape example https://venom.crowdstrike.com/

I doubt anyone is wasting a good zero-day on disposable qemu netboot images. Someone may try a venom(like) image for 'fun'.

Re:QEMU Advent Calendar: A surprise disk image each day unti... by AnthonBerg on Monday December 03, 2018 @08:47AM (#18588676)
It is unknown. It might be unknowable.
Re:QEMU Advent Calendar: A surprise disk image each day unti... by AnthonBerg on Tuesday December 04, 2018 @05:32PM (#18604170)
Due to a couple downvotes I want to explain by way of a question: Can it to your knowledge be proven that QEMU is fully secure?

Given that bugs which have been found in it previously have been fixed, can we know from now on that it’s 100% safe?

As far as I know there does not exist a way of rigorously proving that.

fwiw my interest in theoretical computers and formal verification based on this fundamental aspect.