mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
[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>
This commit is contained in:
1 parent
423ce9cf9e
commit
df70dfb525
7 files changed
+38
-72
No files matched your search
@@ -406,7 +406,7 @@ def parsePolicyXml( ):
|
||||
msg = msg + 'Please validate the Policy file used.'
|
||||
formatXmlError( msg )
|
||||
|
||||
allCSMTypes[csName][1] = csMemberList
|
||||
allCSMTypes[csName][1] = csMemberList
|
||||
|
||||
if pOrder != '':
|
||||
formPolicyOrder[1] = pOrder
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- mode: python; -*-
|
||||
import sys
|
||||
import traceback
|
||||
import getopt
|
||||
|
||||
# add fallback path for non-native python path installs if needed
|
||||
sys.path.insert(-1, '/usr/lib/python')
|
||||
sys.path.insert(-1, '/usr/lib64/python')
|
||||
|
||||
from xen.util.security import ACMError, err, get_decision, active_policy
|
||||
|
||||
def usage():
|
||||
print "Usage: acm_getdecision -i domainid --label labelname"
|
||||
print " Test program illustrating the retrieval of"
|
||||
print " access control decisions from Xen. At this time,"
|
||||
print " only sharing (STE) policy decisions are supported."
|
||||
print " Arguments are two paramters in any combination:"
|
||||
print "\t -i domain_id or --domid domain_id"
|
||||
print "\t -l labelname or --label labelname"
|
||||
print " Return value:"
|
||||
print "\t PERMITTED if access is permitted"
|
||||
print "\t DENIED if access is denied"
|
||||
print "\t ACMError -- e.g., unknown label or domain id"
|
||||
err("Usage")
|
||||
|
||||
try:
|
||||
|
||||
if len(sys.argv) != 5:
|
||||
usage()
|
||||
|
||||
decision_args = []
|
||||
|
||||
for idx in range(1, len(sys.argv), 2):
|
||||
if sys.argv[idx] in ['-i', '--domid']:
|
||||
decision_args.append(['domid', sys.argv[idx+1]])
|
||||
elif sys.argv[idx] in ['-l', '--label']:
|
||||
decision_args.append(['access_control',
|
||||
['policy', active_policy],
|
||||
['label', sys.argv[idx+1]]
|
||||
])
|
||||
else:
|
||||
print "unknown argument %s" % sys.argv[idx]
|
||||
usage()
|
||||
|
||||
if len(decision_args) != 2:
|
||||
print "too many arguments"
|
||||
usage()
|
||||
|
||||
print get_decision(decision_args[0], decision_args[1])
|
||||
|
||||
except ACMError:
|
||||
pass
|
||||
except:
|
||||
traceback.print_exc(limit=1)
|
||||