第2章 ACM策略配置
在xensec_ezpolicy里,点击New Orgbutton。新增加三个组织:A-Bank、B-Bank和AutoCorp,而且在A-Bank下创建两个部门:SecurityUnderwriting和MarketAnalysis。然后选中__UNLABELED__、A-Bank和B-Bank三项,点击Create run-time exclusion rulefrom selectionbutton,将其增加到一个冲突集中,接着用类似方法将__UNLABELED__、A-Bank.MarketAnalysis和A-Bank.SecurityUnderwriting三项增加到一个冲突集中。终于结果例如以下图所看到的:

选择菜单里的File ->Save as Xen ACM Security Policy …将策略文件保存到路径:/etc/xen/acm-security/policies/mytest-security_policy.xml
该文件终于内容例如以下所看到的:
<?xml version="1.0" encoding="UTF-8"?
>
<!-- Auto-generated by ezPolicy -->
<SecurityPolicyDefinition xmlns="http://www.ibm.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com ../../security_policy.xsd ">
<PolicyHeader>
<PolicyName>mytest</PolicyName>
<Date>Tue Jun 09 14:41:58 2015</Date>
<Version>1.0</Version>
</PolicyHeader>
<SimpleTypeEnforcement>
<SimpleTypeEnforcementTypes>
<Type>SystemManagement</Type>
<Type>__UNLABELED__</Type>
<Type>A-Bank</Type>
<Type>A-Bank.SecurityUnderwriting</Type>
<Type>A-Bank.MarketAnalysis</Type>
<Type>B-Bank</Type>
<Type>AutoCorp</Type>
</SimpleTypeEnforcementTypes>
</SimpleTypeEnforcement>
<ChineseWall priority="PrimaryPolicyComponent">
<ChineseWallTypes>
<Type>SystemManagement</Type>
<Type>__UNLABELED__</Type>
<Type>A-Bank</Type>
<Type>A-Bank.SecurityUnderwriting</Type>
<Type>A-Bank.MarketAnalysis</Type>
<Type>B-Bank</Type>
<Type>AutoCorp</Type>
</ChineseWallTypes>
<ConflictSets>
<Conflict name="RER">
<Type>__UNLABELED__</Type>
<Type>A-Bank</Type>
<Type>B-Bank</Type>
</Conflict>
<Conflict name="RER">
<Type>__UNLABELED__</Type>
<Type>A-Bank.MarketAnalysis</Type>
<Type>A-Bank.SecurityUnderwriting</Type>
</Conflict>
</ConflictSets>
</ChineseWall>
<SecurityLabelTemplate>
<SubjectLabels bootstrap="SystemManagement">
<VirtualMachineLabel>
<Name>SystemManagement</Name>
<SimpleTypeEnforcementTypes>
<Type>SystemManagement</Type>
<Type>__UNLABELED__</Type>
<Type>A-Bank</Type>
<Type>A-Bank.SecurityUnderwriting</Type>
<Type>A-Bank.MarketAnalysis</Type>
<Type>B-Bank</Type>
<Type>AutoCorp</Type>
</SimpleTypeEnforcementTypes>
<ChineseWallTypes>
<Type>SystemManagement</Type>
</ChineseWallTypes>
</VirtualMachineLabel>
<VirtualMachineLabel>
<Name>__UNLABELED__</Name>
<SimpleTypeEnforcementTypes>
<Type>__UNLABELED__</Type>
</SimpleTypeEnforcementTypes>
<ChineseWallTypes>
<Type>__UNLABELED__</Type>
</ChineseWallTypes>
</VirtualMachineLabel>
<VirtualMachineLabel>
<Name>A-Bank</Name>
<SimpleTypeEnforcementTypes>
<Type>A-Bank</Type>
</SimpleTypeEnforcementTypes>
<ChineseWallTypes>
<Type>A-Bank</Type>
</ChineseWallTypes>
</VirtualMachineLabel>
<VirtualMachineLabel>
<Name>A-Bank.SecurityUnderwriting</Name>
<SimpleTypeEnforcementTypes>
<Type>A-Bank.SecurityUnderwriting</Type>
</SimpleTypeEnforcementTypes>
<ChineseWallTypes>
<Type>A-Bank</Type>
<Type>A-Bank.SecurityUnderwriting</Type>
</ChineseWallTypes>
</VirtualMachineLabel>
<VirtualMachineLabel>
<Name>A-Bank.MarketAnalysis</Name>
<SimpleTypeEnforcementTypes>
<Type>A-Bank.MarketAnalysis</Type>
</SimpleTypeEnforcementTypes>
<ChineseWallTypes>
<Type>A-Bank</Type>
<Type>A-Bank.MarketAnalysis</Type>
</ChineseWallTypes>
</VirtualMachineLabel>
<VirtualMachineLabel>
<Name>B-Bank</Name>
<SimpleTypeEnforcementTypes>
<Type>B-Bank</Type>
</SimpleTypeEnforcementTypes>
<ChineseWallTypes>
<Type>B-Bank</Type>
</ChineseWallTypes>
</VirtualMachineLabel>
<VirtualMachineLabel>
<Name>AutoCorp</Name>
<SimpleTypeEnforcementTypes>
<Type>AutoCorp</Type>
</SimpleTypeEnforcementTypes>
<ChineseWallTypes>
<Type>AutoCorp</Type>
</ChineseWallTypes>
</VirtualMachineLabel>
</SubjectLabels>
<ObjectLabels>
<ResourceLabel>
<Name>SystemManagement</Name>
<SimpleTypeEnforcementTypes>
<Type>SystemManagement</Type>
</SimpleTypeEnforcementTypes>
</ResourceLabel>
<ResourceLabel>
<Name>__UNLABELED__</Name>
<SimpleTypeEnforcementTypes>
<Type>__UNLABELED__</Type>
</SimpleTypeEnforcementTypes>
</ResourceLabel>
<ResourceLabel>
<Name>A-Bank</Name>
<SimpleTypeEnforcementTypes>
<Type>A-Bank</Type>
</SimpleTypeEnforcementTypes>
</ResourceLabel>
<ResourceLabel>
<Name>A-Bank.SecurityUnderwriting</Name>
<SimpleTypeEnforcementTypes>
<Type>A-Bank.SecurityUnderwriting</Type>
</SimpleTypeEnforcementTypes>
</ResourceLabel>
<ResourceLabel>
<Name>A-Bank.MarketAnalysis</Name>
<SimpleTypeEnforcementTypes>
<Type>A-Bank.MarketAnalysis</Type>
</SimpleTypeEnforcementTypes>
</ResourceLabel>
<ResourceLabel>
<Name>B-Bank</Name>
<SimpleTypeEnforcementTypes>
<Type>B-Bank</Type>
</SimpleTypeEnforcementTypes>
</ResourceLabel>
<ResourceLabel>
<Name>AutoCorp</Name>
<SimpleTypeEnforcementTypes>
<Type>AutoCorp</Type>
</SimpleTypeEnforcementTypes>
</ResourceLabel>
</ObjectLabels>
</SecurityLabelTemplate>
</SecurityPolicyDefinition>
下一步。关闭全部虚拟机,在命令行里运行下面命令,使刚才编辑的策略生效。
xm resetpolicy xm setpolicy ACM mytest
以下,给domain1和domain2分别设置A-Bank和B-Bank的标签:
xm addlabel A-Bank dom domain1.xm xm addlabel B-Bank dom domain2.xm
接着,给虚拟磁盘文件设置A-Bank和B-Bank的标签:
xm addlabel A-Bank res tap:aio:/root/vm1disk xm addlabel B-Bank res tap:aio:/root/vm2disk
设置结果如图所看到的。
这样才干保证虚拟机domain1能訪问磁盘文件vm1disk,虚拟机domain1能訪问磁盘文件vm1disk,虚拟机才会创建成功,从而验证了STE策略。
然后创建domain1虚拟机,保持domain1开启的同一时候,再启动domain2虚拟机:
xm create domain2.xm xm create domain2.xm
这时我们会发现domain2虚拟机创建失败。例如以下图所看到的,提示Error: Domain inconflict set with running domain?
这是因为在ChineseWall策略里,虚拟机domain1的标签为A-Bank,虚拟机domain2的标签为B-Bank,而A-Bank和B-Bank在同一个利益冲突类(Run-time Exclustion Rules)中,因此无法同一时候在同一个主机中执行。
第3章 遇到的错误与解决方式
1. 编译tools时失败,提示check_Python_devel函数检查失败。是个bug
解决方式:改动/xen/tools/check/check_python_devel文件。去掉里面的验证
2. 编译tools时失败。提示undefinedreference to symbol 'timer_settime@@GLIBC_2.3.3
解决方式:依照http://stackoverflow.com/questions/18286738/undefined-reference-to-symbol-timer-settimeglibc-2-3-3里的说明。将/xen/tools/ioemu-remote/Makefile.target里的LIBS+=-lm改动为LIBS+=-lz -lrt –lm
3. 编译tools时失败,提示xg_main.c:181:52:error: 'ulong' undeclared (first use in this
function)
解决方式:參照http://lists.xen.org/archives/html/xen-devel/2012-12/msg00429.html
改动/xen/tools/debugger/gdbsx/xg/xg_main.c。在文件开头增加#include <sys/types.h>
4. 编译tools时失败,提示ocamlfind:command not found
解决方式:apt-getinstall ocaml-findlib
5. 编译tools时失败,提示Error:Unbound module Xenbus
解决方式:改动/xen/tools/ocaml/xenstored/connection.ml里的Line:118,把那三行凝视掉。加入let is_backend_mmap con =false
6. Ubuntu怎样进行视频录制
解决方式:利用kazam进行视频录制。用法例如以下:
apt-get install kazam apt-get install pulseaudio pulseaudio //打开pulseaudioserver kazam //执行视频录制软件
第4章 參考资料
[1] List of Ubuntu releases. http://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Table_of_versions
[2] Ubuntu12.04安装Xen4. http://www.linuxidc.com/Linux/2013-03/81303.htm
[3] XEND. http://wiki.xen.org/wiki/XEND
[4] Ubuntu 10.04 (with grub2)安装 Xen 4.0.1. http://www.linuxidc.com/Linux/2011-07/39259.htm
[5] 怎么用U盘安装Ubuntu. http://www.linuxidc.com/Linux/2014-10/108402.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-04/129857.htm
