Commit Graph
53 Commits
Author SHA1 Message Date
Keir Fraser 8950f5c6ba Extend 'xm dumppolicy' to support Xen-API
I am extending 'xm dumppolicy' to be used via the Xen-API. For this
there are two new functions in the ACM policy class:
 - get the currently enforced policy including statistical data from
   the hypervisor
- get the ACM 'ssidref' of a Domain. Since this may be a ACM-specific
  variable or type (int) I put it into the ACM class.

I extended the Xen-API documentation with the two new functions.

Signed-off-by: Stefan Berger <Stefanb@us.ibm.com>
2007-10-03 14:04:51 +01:00
kfraser@localhost.localdomain 787dcb588b Check for libxml2 if security tools are to be built, and adapt the
python setup.py command line parameters to also work under SuSE.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-09-07 09:48:35 +01:00
kfraser@localhost.localdomain 61c6564d34 Cleanups after XSM checkin.
Signed-off-by: Keir Fraser <keir@xensource.com>

--HG--
rename : xen/include/public/acm.h => xen/include/public/xsm/acm.h
rename : xen/include/public/acm_ops.h => xen/include/public/xsm/acm_ops.h
rename : xen/include/acm/acm_core.h => xen/include/xsm/acm/acm_core.h
rename : xen/include/acm/acm_endian.h => xen/include/xsm/acm/acm_endian.h
rename : xen/include/acm/acm_hooks.h => xen/include/xsm/acm/acm_hooks.h
2007-08-31 12:05:07 +01:00
kfraser@localhost.localdomain e080ffba8d Fix/cleanup destroyDevice code path in xend.
When calling destroyDevice code path (e.g. xm block-detach dom devid),
allow specifying an integer device id or a device name such as xvdN or
/dev/xvdN.  Allowing the /dev/xvdN form is useful when detaching
devices from dom0.  Bootloaders may do this to unmount a disk
previously mounted in dom0.

Move examination of device ID format into the DevController,
permitting device controllers to determine a valid device ID instead
of higher level code.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-08-06 10:12:34 +01:00
kfraser@localhost.localdomain 883ff61657 [ACM] Support for removing / replacing a policy
Add support for removing/replacing a policy from the running
system. This operation is only successful if currently running VMs
would also be allowed to run under the new policy. Removing the
current policy means that the default policy is installed, which then
only has support for a single VM label and STE type (SystemManagement)
and is the same policy that the system starts up with when no policy
is chosen.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 10:11:25 +01:00
kfraser@localhost.localdomain b163ba1607 [ACM] Support for running unlabeled domains alongside labeled ones
Add support for running unlabeled domains alongside labeled ones, if
the policy contains a VM label with name '__UNLABELED__' and an STE
type with the same name. The ezpolicy tool has been modified to
automatically suggest a policy under which unlabeled domains can
run. The user may delete this, if this is not desired.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-08-06 10:10:34 +01:00
kfraser@localhost.localdomain 2b0134dd5a [ACM-security] Some fixes to tools.
- Allow multiple ChineseWallTypes in a VM labels
- check for surfacing exceptions in the python code
- check for array sizes in the XML DOM in python
- properly display the labels when doing 'xm list --label' in xm's
non-Xen-API mode
- rely on the security checking hooks in xend to check access to the
block interface rather than doing this in xm.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-12 16:07:28 +01:00
kfraser@localhost.localdomain 184e1b098b [Xen-API] Extension of the Xen-API for managing Xen Security Policies
This patch implements extensions for managing security policies in
xend. The XSPolicy and ACMPolicy classes provide the interface for the
Xen-API and implement functionality for setting, updating and
activating of a Xen security policy as well as labeling of virtual
machines and resources such as block devices. Labeling of network
devices will follow.

The acmpolicy class implements a compiler for translating an XML
policy into their binary format and provides functionality for
comparing a current policy against a new one when changing/updating a
policy.

The xspolicyadmin class administers the policy of the system.

Some of the xend-internal code deals with transforming the labeling
information from the S-Expression format into the new Xen-API
format. This is similar to much of the other code that is already
there.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-09 14:51:44 +01:00
kfraser@localhost.localdomain 5a6a960005 [ACM] Support for initial unicode handling of strings in policies.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-07-06 14:43:51 +01:00
kfraser@localhost.localdomain fab51b46ae [ACM] Simpler interface to hypercalls
Implement a simpler interface for the hypercalls to ACM. I put the
parameters to all hypercalls into a union. On top of this I have
implemented a shim layer for enabling ACM hypercalls on PPC.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-05-24 10:18:55 +01:00
kfraser@localhost.localdomain 8c706ec28d acm: Changes to XML schema of the policy
This patch changes the XML schema of the ACM policy to require a
version and that every conflict set have a name. Every VM label must
have one Chinese Wall Type and every resource label one Simple Type
Enforcement Type. As a consequence of this some example policies
needed to be changed. Also not offering that many configuration
options for compiling xen anymore to make things simpler.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-04-25 09:31:52 +01:00
Keir Fraser 856a272f35 [security] When building the binary policy align its contents the same way as the
ACM module does when returning its contents.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-04-19 19:29:19 +01:00
kfraser@localhost.localdomain 7f6d8fe5c9 acm: Provide the possibility to choose the VM label of domain-0 in the
kernel line in grub.conf. The format is
ssidref=<ssidref>:sHype:<policy name>:<vm label>. The name of the
policy specified here must be the same name as the in the policy
provided as a module during boot, otherwise the policy will not be
accepted and the system then starts without a policy. The user tool
for 'xm dumppolicy' has been adapted to show which entry in the binary
policy is used by domain-0.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-03-29 19:26:13 +01:00
kfraser@localhost.localdomain a10e171a41 [ACM] Allow version information to be embedded in the XML representation of
the ACM policy. The translation tool has been adapted to parse the
version found in the XML representation and put it into the binary
policy. Xen has been adapted to remember the version information and
report it when asked for the current policy.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-03-28 14:00:56 +01:00
Ewan Mellor 1bf63f099d This patch replaces tab with 4 whitespaces in xensec_gen/main.py.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-03-26 14:10:19 +01:00
kfraser@localhost.localdomain 9de4f0c67d tools: Clean up use of 'install' command.
- convert raw "install" command to use $(INSTALL)
- convert some $(INSTALL) to $(INSTALL_DATA) as appropriate
- modify the specific $(INSTALL) definitions to use -p.

Original patch by Ben Thomas <ben@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-03-07 10:49:20 +00:00
Christian Limpach b4dd69c689 [tools] Use auxbin.py to determine libpath at build time.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2007-03-05 19:22:21 +00:00
kfraser@localhost.localdomain 5c4256ca47 [ACM] Update the xensec_ezpolicy ACM policy generation tool so
that it works with wxPython under Python 2.5.
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2007-02-15 14:20:05 +00:00
Ian Campbell 8e84e3f524 [TOOLS] Fix foreign header build breakage.
Having both the Xen tree and the tools tree recurse into the foreign
headers directory causes headaches in parallel builds and when
building 32-bit tools + 64 bit Xen in the same tree.

Therefore we cause mk-symlinks to symlink in the foreign headers build
bits and generate a local version of the headers and checker tool.

Only libxc needs to do this since the other tools were actually
picking up the libxc version of the headers anyway so the mk-symlinks
calls can be removed from these components.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
2007-01-31 10:25:12 +00:00
kfraser@localhost.localdomain 5ed80a6a52 [ACM] Documentation cleanup.
This patch eliminates redundant security tools information that was
integrated into the Xen user guide and the xm man page.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-10-20 10:48:34 +01:00
kfraser@localhost.localdomain 81ba8bb990 [ACM] Fix binary alignment in tools.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-10-18 17:29:08 +01:00
kfraser@localhost.localdomain 2f04c3f01e [ACM] Keep stream aligned.
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
2006-10-18 17:17:15 +01:00
kaf24@localhost.localdomain b643712258 [XEND] Move all of the various log files created by xen to
be under /var/log/xen instead of under /var/log directly.  This has
the advantage of cleaning things up a little and also can make it
easier to restrict the permissions needed by xend.

Signed-off-by: Jeremy Katz <katzj@redhat.com>
2006-08-28 13:05:00 +01:00
kfraser@localhost.localdomain 33ac7e69c8 [ACM] A wxPython GUI tool for sHype/ACM in Xen. It is used
and described in the user guide to demonstrate how to quickly create, 
enforce, and test workload protection policies in Xen. The tool is aimed 
to improve usability of sHype/ACM for Xen.It is included in a single 
file to make it easy to try it out on different platforms (it inherits 
the look and feel of the base platform). It is tested on Linux and 
Windows. Please read the new user guide section about how to start and 
use the tool (section 10.2).

Requirements: python (www.python.org), wxPython (www.wxpython.org or
try 'yum install wxPython').

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-07-31 18:12:53 +01:00
kaf24@firebug.cl.cam.ac.uk ffa0b25d43 [ACM] Complete the conversion of acm_ops using Xen handles instead
of void pointers. It also fixes a recently slipped in acm bug that hangs 
Xen when a domain is destroyed.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-06-17 08:38:35 +01:00
kaf24@firebug.cl.cam.ac.uk df70dfb525 [ACM] Provide the framework needed for resource labeling.
Subsequent patches will follow in the coming weeks that will enable 
Xen ACM to control assignment of resources (e.g., block devices and 
networking) to virtual machines based on resource labels and the 
active security policy.

Signed-off-by: Bryan D. Payne <bdpayne@us.ibm.com>
Signed-off-by: Reiner Sailer <sailer@us.ibm.com>
2006-06-13 15:38:58 +01:00
kaf24@firebug.cl.cam.ac.uk 630ad4e0ad [ACM] Replace the union structure parameter of the ACM hypercalls
with command-specific request structures. It aligns the ACM
hypercalls with the way parameters are passed in the event channel
hypercalls.

Advantages include backward-compatibility regarding old guests when
new calls are added and clarity of the code.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-05-21 19:05:31 +01:00
kaf24@firebug.cl.cam.ac.uk 1d7579804b This small patch fixes new make-dependencies of the secpol_tool
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-05-10 15:49:47 +01:00
kaf24@firebug.cl.cam.ac.uk 2d0922d515 Move Linux-specific privcmd code into private libxc implementations.
Make header path for kernel's privcmd/evtchn headers generic.
Remove pointless xi_*() interface that was using private libxc
interfaces.

Signed-off-by: John Levon <john.levon@sun.com>
2006-05-02 15:12:06 +01:00
smh22@firebug.cl.cam.ac.uk 2c04b08df9 Add new xml files for policy.
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 11:01:41 +01:00
smh22@firebug.cl.cam.ac.uk 655ead6573 This patch updates the documentation and extends the 'xm' man page with
the integrated access control management commands. The man page is a 
good place to start exploring these commands.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:59:57 +01:00
smh22@firebug.cl.cam.ac.uk e7f4f3a1de This patch adds new python access control management scripts, which
integrate into Xen Management and which support the new access control 
labels (labels replace the ssidref numbers at the management user 
interface).

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:58:25 +01:00
smh22@firebug.cl.cam.ac.uk 2d59e34fc2 This patch deletes the old shell-based security tools.
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:54:47 +01:00
smh22@firebug.cl.cam.ac.uk 1f11fdecb1 This patch adds support for managing and creating the simplified
policies to the policy generation tools.

Signed-off by: Thomas Lendacky <toml@us.ibm.com>
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:52:19 +01:00
smh22@firebug.cl.cam.ac.uk 30476c8dba This patch adds support in the hypervisor for the policy name attribute
introduced into security policies. It also fixes a minor problem related 
to handling unsupported boot policies.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:51:50 +01:00
smh22@firebug.cl.cam.ac.uk c462e5c2f0 This patch adds a policy name to the policy definition. This policy name
must be unique and must change if the content of the file changes. The 
policy name is used to ensure that the XM tools and the hypervisor work 
on the same policy, i.e., interpret the security information on domains 
consistently. This patch also simplifies the policy management by moving 
policy and labels into a single file.

Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2006-04-24 10:50:38 +01:00
emellor@leeni.uk.xensource.com 6b884f9876 This fixes a path problem with the current ACM scripts.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2006-04-19 22:52:34 +01:00
kaf24@firebug.cl.cam.ac.uk b5fa90ac8e build: Clean up use of .PHONY
* Move .PHONY directives next to targets,
  this makes them a lot harder to miss
* Add missing .PHONY directives
* Remove nonexistent .PHONY directives
* Hopefully I didn'T miss anything...

Signed-Off-By: Horms <horms@verge.net.au>
2006-04-10 17:02:49 +01:00
kaf24@firebug.cl.cam.ac.uk d27fbb0061 Move 'debug' build option into the outermost Config.mk file.
Signed-off-by: Keir Fraser <keir@xensource.com>
2006-03-09 22:31:45 +01:00
kaf24@firebug.cl.cam.ac.uk 326450f67e Clean up the usage of CFLAGS. This is nice for packagers, who would
like to control the base compilation flags from a central place.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
2006-03-09 21:17:45 +01:00
toml@tomlt2.austin.ibm.com 0e6f8cf5f7 Adding __init__.py file to remove build warning.
It turns out the hg export command does not include zero
size files in the generated diff and this was overlooked.
2006-01-24 17:59:54 +01:00
kaf24@firebug.cl.cam.ac.uk f0756c96a0 A new ACM security tool providing support to aid in the
creation/generation of the XML security policy files for the Xen ACM
security architecture.  It is a python- based, web-based tool named
xensec_gen that allows users to create or modify XML policy files
through a browser.  The resulting XML policy files can then be copied
or moved to the appropriate location in the /etc/xen/acm-security
directory structure in order to be translated into binary and used
within the Xen system.

Signed-off-by: Tom Lendacky <toml@us.ibm.com>
2005-12-13 17:12:59 +01:00
emellor@leeni.uk.xensource.com 548733e866 The attached patch makes a couple of changes to the ACM security tools
and installation. Particularly it does the following:
- the Makefile installs the ACM security-related tools
into /etc/xen/acm-security
- improves and cleans up some of the tools
- updates the documentation

Signed-off-by: Tom Lendacky <toml@us.ibm.com>
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-12-08 18:21:05 +00:00
cl349@firebug.cl.cam.ac.uk 016ef02e87 Move mk-symlinks target into tools/Rules.mk.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
2005-11-28 18:07:22 +01:00
kaf24@firebug.cl.cam.ac.uk ac5d4d868f Enable the Xen hypervisor ACM security policy to be determined at boot
time (instead of at compile time). Allows a single xen.gz binary to
run under different security policy types, which simplifies
distributions considerably. To this end, we replace the current single
compile switch in Config.mk with the following two:

1. ACM_SECURITY (y/n) if "n", then the ACM is not compiled and no security 
policies can be configured at boot time. If "y", then the ACM is compiled 
and can be configured into any of the available policy types (null, 
chwall, ste, chwall_ste) by specifying a valid boot policy .bin file in 
the grub boot configuration.

2. ACM_DEFAULT_SECURITY_POLICY (null / chwall / ste / chwall_ste) 
specifies the policy into which Xen defaults in the case that security is 
enabled but no boot policy file is specified, or the specified policy file 
is invalid (wrong version, magic, corrupted, ...)

While the type of the enabled policy (null, ste, ...) is decided once 
during boot for the whole boot cycle, the policy instantiation can be 
changed during operation as usual with the security tools.

Signed-off by: Tomas Lendacky <toml@us.ibm.com>
Signed-off by: Reiner Sailer <sailer@us.ibm.com>
2005-11-19 10:35:38 +01:00
kaf24@firebug.cl.cam.ac.uk a7da7a4ecb The attached patch fixes 2 issues with the scripts written for the Xen
access control module and makes the tools more self-explanatory.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2005-10-27 17:27:04 +01:00
kaf24@firebug.cl.cam.ac.uk cc677c9d4e This patch to the Xen access control module (ACM) and tools:
1. adapts ACM hooks to the slightly changed event channel structure
  2. introduces an ACM_GETDECISION command, which enables authorized 
domains to retrieve policy decisions regarding the sharing of resources 
(STE policy) from the Xen hypervisor
  3. includes cleanup (warnings I found when applying  analysis tools such 
as beam or flawfinder to the ACM code)

 The get_decision function is useful to enforce:
   *  the security policy on network traffic  in the network backends in 
domain 0; currently there is no enforcement in Dom0 and all packets flow 
freely
   *  the security policy in block device backends to control which 
domains can access which vdisk resources

I have added a small test program that shows how to use the get_decision 
ACM interface call, it is in tools/security/get_decision.c and will be 
compiled together with the policy tools. As usual, the ACM is unconfigured 
until you switch on a security policy on in Config.mk.

Signed-off: Reiner Sailer <sailer@us.ibm.com>
2005-10-20 21:37:15 +01:00
kaf24@firebug.cl.cam.ac.uk d8263e8dba Fix Xen public interfaces and the tools to consistently
use stdint-format bitsize types (uint32_t and friends).

Signed-off-by: Keir Fraser <keir@xensource.com>
2005-10-12 11:07:37 +01:00
kaf24@firebug.cl.cam.ac.uk 4e84295e08 New scripts I missed from previous security patch. 2005-09-02 08:06:59 +00:00
kaf24@firebug.cl.cam.ac.uk 7e9596058b This patch:
* adds a get_ssid ACM command that allows privileged domains to retrieve 
types for either a given ssid reference or a given domain id (of a running 
domain); this command can be used to extend access control into device 
domains, e.g., to control network traffic currently moving through Domain 
0 uncontrolled by the ACM policy

* adds a script getlabel.sh that allows users inside Dom0 to retrieve the 
label for a given ssid reference or a given domain id (multiple labels 
might map onto a single ssid reference)

* cleans up label-related code in tools/security by merging common 
functions into labelfuncs.sh

* cleans up ACM code related to above changes (eventually approximating a 
common coding style)

Signed-off-by Reiner Sailer <sailer@us.ibm.com> 
Signed-off by Stefan Berger <stefanb@us.ibm.com>
2005-09-02 07:59:12 +00:00