]> xenbits.xensource.com Git - xen.git/commitdiff
flask/policy: Add boolean example
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Thu, 2 Feb 2012 15:25:23 +0000 (15:25 +0000)
committerDaniel De Graaf <dgdegra@tycho.nsa.gov>
Thu, 2 Feb 2012 15:25:23 +0000 (15:25 +0000)
This shows an example boolean (prot_doms_locked) which can be set at
runtime to prevent dom0 from mapping memory of domains of type
prot_domU_t.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
docs/misc/xsm-flask.txt
tools/flask/policy/policy/modules/xen/xen.te

index 285bb9ff53f1c55bfd5b101d38f806af09445d2b..5b4297da85c19e12cc2baffd9686dfaf85121f9e 100644 (file)
@@ -55,10 +55,11 @@ kernel; it is normally placed either just above the dom0 kernel or at the end.
 Once dom0 is running, the policy can be reloaded using "xl loadpolicy".
 
 The example policy included with Xen demonstrates most of the features of FLASK
-that can be used without dom0 disaggregation. It has two main types for domUs:
+that can be used without dom0 disaggregation. The main types for domUs are:
 
  - domU_t is a domain that can communicate with any other domU_t
  - isolated_domU_t can only communicate with dom0
+ - prot_domU_t is a domain type whose creation can be disabled with a boolean
 
 One disadvantage of using type enforcement to enforce isolation is that a new
 type is needed for each group of domains. In addition, it is not possible to
index fb71b757caaeedf871024ca503ce278a1d659b83..f7343a2dd6da9d377d4822288dc6f11efb8f07fe 100644 (file)
@@ -73,7 +73,7 @@ allow dom0_t domio_t:mmu { map_read map_write };
 
 domain_self_comms(dom0_t)
 
-auditallow dom0_t security_t:security { load_policy setenforce };
+auditallow dom0_t security_t:security { load_policy setenforce setbool };
 
 ###############################################################################
 #
@@ -92,6 +92,14 @@ create_domain(dom0_t, isolated_domU_t)
 manage_domain(dom0_t, isolated_domU_t)
 domain_comms(dom0_t, isolated_domU_t)
 
+gen_bool(prot_doms_locked, false)
+declare_domain(prot_domU_t)
+if (!prot_doms_locked) {
+       create_domain(dom0_t, prot_domU_t)
+}
+domain_comms(dom0_t, prot_domU_t)
+domain_comms(domU_t, prot_domU_t)
+
 ###############################################################################
 #
 # Device delegation