Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCan't enforce SELinux in qubes template VM. #2466
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rtiangha
Nov 29, 2016
You're (probably) missing a step.
You also need to pass along kernel options that activates selinux.
First, view the options that your app vm already has:
qvm-prefs -l <app-vm> kernelopts
(it'll probably say something like 'nopat', unless it's a netvm or usbvm in which case it'll have additional options)
Then you need to set it to use selinux by adding the security=selinux and selinux=1 kernel options:
qvm-prefs -s <app-vm> kernelopts "nopat security=selinux selinux=1"
And then boot up the VM.
That should do it (at least, it does on a Fedora template).
If you wanted to use Apparmor instead, you'd need to replace the selinux options with security=apparmor and apparmor=1
rtiangha
commented
Nov 29, 2016
•
|
You're (probably) missing a step. You also need to pass along kernel options that activates selinux. First, view the options that your app vm already has:
(it'll probably say something like 'nopat', unless it's a netvm or usbvm in which case it'll have additional options) Then you need to set it to use selinux by adding the
And then boot up the VM. That should do it (at least, it does on a Fedora template). If you wanted to use Apparmor instead, you'd need to replace the selinux options with |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kaizsv
Nov 29, 2016
Thank you for your respond. I make a stupid mistake so have to reinstall my template VM.
I'll try it later. Thanks for you information!
kaizsv
commented
Nov 29, 2016
|
Thank you for your respond. I make a stupid mistake so have to reinstall my template VM. |
andrewdavidwong
added
the
C: Debian
label
Nov 29, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
adrelanos
Nov 29, 2016
Member
|
rtiangha:
You also need to pass along kernel options that activates selinux.
Right. In dom0. Not inside VMs.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rtiangha
Nov 29, 2016
adrelanos:
Right. In dom0. Not inside VMs.
Really? That's not been my experience. The only way I've been able to activate those security features in VMs has been through kernel options; nothing I've ever done inside the VM was enough. And I think that's intentional? Because if you mess up your internal configuration, then you risk having a VM not booting, which means you can't easily fix it afterwards (because it doesn't boot).
As for dom0, unless you're good at writing selinux rules, you'll probably not want to do that as the machine won't boot due to permission issues with the default policies.
And as an aside for anyone keeping score, I've found that the default targeted policy works well on Fedora 23 and 24 templates using both the 4.4 and 4.8 (found in the unstable repository) kernels. Using the 4.8 kernel won't boot those Fedora VMs using the default MLS policy (xenstore permission error). And neither policy at its defaults seems to work with a upconverted 24 template to Fedora 25 using the qubes packages in the current-testing repository. I don't know what effect those kernel and policy combinations would have on a Debian template.
rtiangha
commented
Nov 29, 2016
•
|
adrelanos:
Really? That's not been my experience. The only way I've been able to activate those security features in VMs has been through kernel options; nothing I've ever done inside the VM was enough. And I think that's intentional? Because if you mess up your internal configuration, then you risk having a VM not booting, which means you can't easily fix it afterwards (because it doesn't boot). As for dom0, unless you're good at writing selinux rules, you'll probably not want to do that as the machine won't boot due to permission issues with the default policies. And as an aside for anyone keeping score, I've found that the default targeted policy works well on Fedora 23 and 24 templates using both the 4.4 and 4.8 (found in the unstable repository) kernels. Using the 4.8 kernel won't boot those Fedora VMs using the default MLS policy (xenstore permission error). And neither policy at its defaults seems to work with a upconverted 24 template to Fedora 25 using the qubes packages in the current-testing repository. I don't know what effect those kernel and policy combinations would have on a Debian template. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unman
Nov 29, 2016
Member
Right. In dom0. Not inside VMs.Really? That's not been my experience. The only way I've been able to activate those security features in VMs has been through kernel options; nothing I've ever done inside the VM was enough. And I think that's intentional? Because if you mess up your internal configuration, then you risk having a VM not booting, which means you can't easily fix it afterwards (because it doesn't boot).
I think that's what adrelanos was saying - that you pass the options to the qube from dom0. Which was implicit in your post.
I think that's what adrelanos was saying - that you pass the options to the qube from dom0. Which was implicit in your post. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rtiangha
commented
Nov 29, 2016
|
Ah, got it. Sorry; obviously need more coffee this morning. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kaizsv
Nov 30, 2016
Thanks a lot!
I still have problem in debian-8 and jessie.
But it work fine in my fedora-23, I'll keep focus on fedora rather than debian.
Thanks!
kaizsv
commented
Nov 30, 2016
|
Thanks a lot! |
kaizsv commentedNov 29, 2016
Qubes OS version (e.g.,
R3.1):R3.2Affected TemplateVMs (e.g.,
fedora-23, if applicable):jessieExpected behavior:
$ getenforce
Enforcing
Actual behavior:
$ getenforce
Disabled
Steps to reproduce the behavior:
I successfully installed a "jessie" template VM in qubes OS from qubes-builder following steps in Archlinux Template. And want to enable SELinux in the template VM
After rebooted the jessie using
getenforcewhile it was not working.I google several selinux and debian guides, like
https://wiki.debian.org/SELinux/Setup
https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=16738,
still not work. I'm not sure that is there any way to enable SELinux in template VM?