protecting xen startup
hi,
i notice that there's a management interface on port 8000.
i seek to protect this interface such that nothing but a trusted program (think selinux) may run, manage, start up or shut down xen oses.
so: where can i find out information about the structure of the xen management interface?
is the port 8000 stuff just providing a web server (/etc/init.d/xend) front-end to some extra system calls?
is the port 8000 stuff actually running in the xen boot-up stuff?
if it's some extra system calls that's very good because it will be possible to add selinux security hooks to protect each system call.
ta,
l.
Signature · 10 lines
-- <a href="http://lkcl.net">http://lkcl.net</a> -- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
Quoted 4 lines · Luke Kenneth Casson Leighton
hi,
i notice that there's a management interface on port 8000.
Quoted 8 lines
i seek to protect this interface such that nothing but a trusted program (think selinux) may run, manage, start up or shut down xen oses.
so: where can i find out information about the structure of the xen management interface?
is the port 8000 stuff just providing a web server (
/etc/init.d/xend) front-end to some extra system calls?
What lives behind port 8000 is xend. This is the management daemon for xen. It presents its interface over HTTP and implements it using low-level calls into the xen hypervisor via ioctls. There is no system call interface that corresponds to the xend api.
Quoted 2 lines
is the port 8000 stuff actually running in the xen boot-up stuff?
Xen boots the hypervisor, then domain-0.
Xend runs in domain-0 and is the normal way that all other domains get started.
Quoted 2 lines
if it's some extra system calls that's very good because it will be possible to add selinux security hooks to protect each system call.
You should be able to use selinux rules to specify what gets to talk to xend at port 8000. You'd need to enable LSM and selinux in the domain-0 kernel, but otherwise all you should need to do is configure selinux appropriately.
Quoted 4 lines
ta,
l.
Hope this helps,
Mike
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
Quoted 4 lines · Mike Wray
You should be able to use selinux rules to specify what gets to talk to xend at port 8000. You'd need to enable LSM and selinux in the domain-0 kernel, but
otherwise all you should need to do is configure selinux appropriately.
yes it does: i was however thinking along the lines of creating selinux security IDs, one for each type of xen command (create, list, shutdown, start, stop etc.)
and then writing an selinux policy granting xm the right to perform those commands.
... if the xm and xend programs cannot be merged for some reason, there isn't any point in taking that approach.
l.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Quoted 1 line
i notice that there's a management interface on port 8000.
There are currently two HTTP-based management interfaces. Once of them is the Xensv web interface, the other is the Xend HTTP-based API, which is used by both the command line xm tool and Xensv to issue commands to Xend.
Quoted 2 lines
i seek to protect this interface such that nothing but a trusted program (think selinux) may run, manage, start up or shut down xen oses.
Currently, anyone who can access Xend's port can issue management commands. Xend can optionally be configured to only accept connections from localhost, in which case only local users will be able to issue commands to it.
Quoted 2 lines
is the port 8000 stuff just providing a web server (
/etc/init.d/xend) front-end to some extra system calls?
Not exactly. At the Linux Level, there aren't any extra Xen system calls. Most commands are issued to Xen by performing ioctls on the /proc/xen/privcmd file. The commands which are issued through this file are largely transparent to XenLinux however, having meaning only when they are parsed by Xen.
Quoted 1 line
is the port 8000 stuff actually running in the xen boot-up stuff?
Xend starts its HTTP interface when it starts up and will do anything the HTTP interface tells it to do. If Xend isn't running then the HTTP interface is not accessible (but you can't do a lot without Xend).
HTH,
Mark
Quoted 11 lines
ta,
l.
--
--
<a href="http://lkcl.net">http://lkcl.net</a>
--
Quoted 10 lines
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xen-devel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
Quoted 6 lines · Mark Williamson
Quoted 1 line
i notice that there's a management interface on port 8000.
There are currently two HTTP-based management interfaces. Once of them is the Xensv web interface, the other is the Xend HTTP-based API, which is used by both the command line xm tool and Xensv to issue commands to Xend.
Quoted 7 lines
Quoted 2 lines
i seek to protect this interface such that nothing but a trusted program (think selinux) may run, manage, start up or shut down xen oses.
Currently, anyone who can access Xend's port can issue management commands. Xend can optionally be configured to only accept connections from localhost, in which case only local users will be able to issue commands to it.
okay.
is there anything preventing that interface from being removed, such that the client/server bit is munged into a single application?
Quoted 6 lines
Quoted 2 lines
is the port 8000 stuff just providing a web server (
/etc/init.d/xend) front-end to some extra system calls?Not exactly. At the Linux Level, there aren't any extra Xen system calls. Most commands are issued to Xen by performing ioctls on the
/proc/xen/privcmdfile.
GREAT.
that means that it will be possible to lock down at the very least the access to /proc/xen and later, should it prove worthwhile, to protect each ioctl with a new selinux security id per ioctl command.
Quoted 3 lines
The commands which are issued through this file
are largely transparent to XenLinux however, having meaning only when they are parsed by Xen.
... that kinda goes without saying :)
Quoted 5 lines
Quoted 1 line
is the port 8000 stuff actually running in the xen boot-up stuff?
Xend starts its HTTP interface when it starts up and will do anything the HTTP interface tells it to do. If Xend isn't running then the HTTP interface is not accessible (but you can't do a lot without Xend).
... but there's nothing to prevent the merging of the xend and the xm programs, bypassing the use of HTTP, right?
ta,
l.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
is the port 8000 stuff actually running in the xen boot-up stuff?
Xend starts its HTTP interface when it starts up and will do anything the HTTP interface tells it to do. If Xend isn't running then the HTTP interface is not accessible (but you can't do a lot without Xend).
... but there's nothing to prevent the merging of the xend and the xm programs, bypassing the use of HTTP, right?
You might want to think twice before doing that, or at least have some alternative story about how you'd do administration of a pool of VMs running over a cluster of nodes.
I guess you're probably thinking of multi-level secure VMs on a single host (e.g. a laptop), but the cluster side is important too.
I guess it might be possible to weld xm and xend directly to each other in the single machine case.
Ian
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Quoted 9 lines · Ian Pratt
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
is the port 8000 stuff actually running in the xen boot-up stuff?
Xend starts its HTTP interface when it starts up and will do anything the HTTP interface tells it to do. If Xend isn't running then the HTTP interface is not accessible (but you can't do a lot without Xend).
... but there's nothing to prevent the merging of the xend and the xm programs, bypassing the use of HTTP, right?
Quoted 6 lines
You might want to think twice before doing that, or at least have some alternative story about how you'd do administration of a pool of VMs running over a cluster of nodes.
I guess you're probably thinking of multi-level secure VMs on a single host (e.g. a laptop),
yes (see below for details).
Quoted 2 lines
but the cluster side is important
too.
ah, so.
even inside a guest OS is it possible to access the HTTP interface?
Quoted 2 lines
I guess it might be possible to weld xm and xend directly to each other in the single machine case.
perhaps i should explain: i am looking to use xen to implement a new level of paranoid security.
i aim to run single applications, such as firefox and openoffice, in their own dedicated virtual machines, a localised file server in one (or more if i can get GFS or OCFS2 to work) virtual machine(s), and for the applications to each connect to the xen master running an x-server [nomachine isn't quite suitable, i may have to write my own ssh-based x-proxy].
allowing a compromised guest OS to fire up another virtual machine, connect to the x-server and spoof "please enter your password" dialog boxes is therefore to be avoided!!!
i am so pleased and relieved that xm is written in python. i grok python.
l.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Quoted 10 lines · Luke Kenneth Casson Leighton
perhaps i should explain: i am looking to use xen to implement a new level of paranoid security.
i aim to run single applications, such as firefox and openoffice, in their own dedicated virtual machines, a localised file server in one (or more if i can get GFS or OCFS2 to work) virtual machine(s), and for the applications to each connect to the xen master running an x-server [nomachine isn't quite suitable, i may have to write my own ssh-based x-proxy].
Do you mean running xserver in domain0? You should better setup separate domain for it.
But are you sure that such a setup will be usable and fast enough? I'm definitely interested in results, anyway.
Quoted 3 lines
allowing a compromised guest OS to fire up another virtual machine, connect to the x-server and spoof "please enter your password" dialog boxes is therefore to be avoided!!!
If I'm not mistaken, you can start up new VMs only from domain0 or through HTTP interface, So you can easily firewall all traffic inside domain0 to local port 8000 (except for 127.0.0.1/32).
j.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
Quoted 5 lines · Jan Kundr?t
Quoted 4 lines · Luke Kenneth Casson Leighton
perhaps i should explain: i am looking to use xen to implement a new level of paranoid security.
Quoted 8 lines
Quoted 6 lines
i aim to run single applications, such as firefox and openoffice, in their own dedicated virtual machines, a localised file server in one (or more if i can get GFS or OCFS2 to work) virtual machine(s), and for the applications to each connect to the xen master running an x-server [nomachine isn't quite suitable, i may have to write my own ssh-based x-proxy].
Do you mean running xserver in domain0?
um, yes.
Quoted 2 lines
You should better setup separate
domain for it.
really? is that possible?
can i run an xserver in a separate guest OS and still allow the guest OS direct access to the screen?
how is that done - via a framebuffer drive?
tellmetellme!!!!
Quoted 1 line
But are you sure that such a setup will be usable and fast enough?
i gonna find out :)
Quoted 7 lines
Quoted 3 lines
allowing a compromised guest OS to fire up another virtual machine, connect to the x-server and spoof "please enter your password" dialog boxes is therefore to be avoided!!!
If I'm not mistaken, you can start up new VMs only from domain0 or through HTTP interface, So you can easily firewall all traffic inside domain0 to local port 8000 (except for 127.0.0.1/32).
yeh, *grumble*, and you can also, in selinux, ban applications from accessing a port.
Quoted 2 lines
j.
Signature · 10 lines
-- <a href="http://lkcl.net">http://lkcl.net</a> -- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
Quoted 6 lines
can i run an xserver in a separate guest OS and still allow the guest OS direct access to the screen?
how is that done - via a framebuffer drive?
tellmetellme!!!!
There was a very brave chap who had a second PCI graphics card and a second PCI USB controller, which he had given a domain (!=dom0) privileges to access and was trying to persuade X to run. I'm not sure how far he's got now but it's not straightforward.
Quoted 6 lines
Quoted 3 lines
If I'm not mistaken, you can start up new VMs only from domain0 or through HTTP interface, So you can easily firewall all traffic inside domain0 to local port 8000 (except for 127.0.0.1/32).
yeh, *grumble*, and you can also, in selinux, ban applications from accessing a port.
Well by setting Xend to only receive connections from localhost and then applying SELinux, you can at least restrict access to the control interface to root...
Cheers,
Mark
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
Quoted 11 lines · Mark Williamson
Quoted 6 lines
can i run an xserver in a separate guest OS and still allow the guest OS direct access to the screen?
how is that done - via a framebuffer drive?
tellmetellme!!!!
There was a very brave chap who had a second PCI graphics card and a second PCI USB controller, which he had given a domain (!=dom0) privileges to access and was trying to persuade X to run. I'm not sure how far he's got now but it's not straightforward.
that's what i kinda figured: that the solution would open up a larger can of worms than the alternative.
not that i'm happy with it but it appears to be the simplest solution.
_another_ alternative which i don't believe offers _that_ much benefit is to run nomachine:
/etc/apt/sources.list -> deb http://debian.tu-bs.de/knoppix/nx/slh-debian/ ./
then it'd be possible to turn the xen master domain into a thin client and have kde / gnome / fvwm / whatever running in a guest domain.
... but nomachine is quirky to set up, even with the packages being available at the above location.
l.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
Quoted 2 lines
is there anything preventing that interface from being removed, such that the client/server bit is munged into a single application?
In older releases, there wasn't a Xend. Instead we had a set of management scripts that called various operations directly. You could in principle munge xm and xend together into a big megatool but it wouldn't be pretty.
Xend makes concurrency control much easier, provides a central point of contact regarding machine state and demuxes the virtual consoles of the domain. You'd have to address these problems in addition to combining the tools, which would take a fair bit of hacking to do properly.
Quoted 9 lines
Quoted 3 lines
Not exactly. At the Linux Level, there aren't any extra Xen system calls. Most commands are issued to Xen by performing ioctls on the
/proc/xen/privcmdfile.GREAT.
that means that it will be possible to lock down at the very least the access to
/proc/xenand later, should it prove worthwhile, to protect each ioctl with a new selinux security id per ioctl command.
Right now, only root (actually, probably users with the CAP_SYSADMIN capability or similar) can do operations on /proc/xen. Also, many Xen operations are mapped onto one ioctl call so as it is you can't do very fine grained protection based on ioctl number. What you describe would be technically possible if a separate ioctl was allocated for each operation, though.
Cheers,
Mark
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
Quoted 7 lines · Mark Williamson
Quoted 2 lines
is there anything preventing that interface from being removed, such that the client/server bit is munged into a single application?
In older releases, there wasn't a Xend. Instead we had a set of management scripts that called various operations directly. You could in principle munge xm and xend together into a big megatool but it wouldn't be pretty.
i'll take that as a challenge, then :)
Quoted 4 lines
Xend makes concurrency control much easier, provides a central point of contact regarding machine state and demuxes the virtual consoles of the domain. You'd have to address these problems in addition to combining the tools, which would take a fair bit of hacking to do properly.
okay.
assuming that 1) i don't want a central point of contact i only want _one_ point of contact and 2) i can live without virtual consoles until i understand the code enough and can get away with using ssh logins instead:
would this be a simple enough task for someone not entirely familiar with xen's code [but who has developed a number of 20k+ line python projects over the past four years]?
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Not exactly. At the Linux Level, there aren't any extra Xen system calls. Most commands are issued to Xen by performing ioctls on the
/proc/xen/privcmdfile.
Quoted 8 lines
Quoted 5 lines
GREAT.
that means that it will be possible to lock down at the very least the access to
/proc/xenand later, should it prove worthwhile, to protect each ioctl with a new selinux security id per ioctl command.Right now, only root (actually, probably users with the
CAP_SYSADMINcapability or similar) can do operations on/proc/xen.
[which, please excuse me for saying so, doesn't exactly help if that root-only interface is then exposed via an open high port number!! :) ]
Quoted 3 lines
Also, many Xen
operations are mapped onto one ioctl call so as it is you can't do very fine grained protection based on ioctl number.
i was thinking of adding in an LSM hook function that received the ioctl number as one of its arguments, translated that in a case statement into the corresponding selinux SIDs, and from there checked an selinux permission - in a similar way that security/selinux/hooks.c's selinux_file_ioctl() or the selinux_file_fcntl() function operates.
i.e. not using file_has_perm() but task_has_perm() instead.
then the first thing that the xen ioctl function does is call that LSM hook function.
it would therefore also be possible for someone else to write a corresponding LSM linux capabilities function call, too. should someone so wish.
l.
Signature · 8 lines
-- <a href="http://lkcl.net">http://lkcl.net</a> -- -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines
Quoted 4 lines
Xend makes concurrency control much easier, provides a central point of contact regarding machine state and demuxes the virtual consoles of the domain. You'd have to address these problems in addition to combining the tools, which would take a fair bit of hacking to do properly.
okay.
Quoted 8 lines
assuming that 1) i don't want a central point of contact i only want _one_ point of contact and 2) i can live without virtual consoles until i understand the code enough and can get away with using ssh logins instead:
would this be a simple enough task for someone not entirely familiar with xen's code [but who has developed a number of 20k+ line python projects over the past four years]?
You'd need to be fairly familiar with Xen, particularly the virtual device channels. There's a general purpose transport for control messages between domain0 and other domains. Multiple messages are sent to and from Xend in order to set up every virtual device. You can't do without these, so you'd have to find some way of doing this.
As Rolf said, you do still need a central point of contact in the system for some operations, in order to ensure safety. The main reason for this (imo) is to prevent concurrent accesses to domain0's control interface. You could have a daemon to take care of this or write a Linux device driver to access the control interface for you.
HTH,
Mark
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/