README for simplified policy XML support 1. Related commands (1) seedit-export This programs reads simplified policy and export to XML format. * Usage: seedit-export -i -o * Example: When you want to generate XML from default policy. ./seedit-export -i /etc/selinux/seedit/src/policy/simplified_policy/all -o test.xml test.xml is XML format simplified policy (2) seedit-import This program read XML format simplified policy and output simplified policy that seedit-converter can understand. * Usage: seedit-import -i -o xml file is converted into simplified policy, output path is output dir. If -o is omitted, simplified policy jointed together is displayed to stdout. + Example: $ mkdir testdir $ ./seedit-import.py -i test.xml -o testdir This read test.xml and output simplified policy to testdir $ ls testdir acpid_t.a hald_t.a modutils_t.a rpm_t.a system_crond_t.a automount_t.a httpd_t.a mount_t.a run_init_t.a user_r.a cannaserver_t.a init_t.a mysqld_t.a sendmail_t.a webmin_t.a crond_t.a initrc_t.a named_t.a smbd_t.a xfs_t.a dbus_t.a kernel_t.a newrole_t.a sshd_t.a xinetd_t.a dhcpcd_t.a klogd_t.a postfix_t.a staff_r.a xserver_t.a gdm_t.a login_t.a proftpd_t.a su_t.a getty_t.a lvm_t.a restorecon_t.a sysadm_r.a global mail_t.a rpm_script_t.a syslogd_t.a Simplified policy is generated. 2. Syntax of xml format simplified policy For detailed syntax, see simplified_policy.dtd. DTD is available at http://seedit.sourceforge.net/doc/simplified_policy.dtd . And for meaning of SPDL description, see Simplified Policy Manual at http://seedit.sourceforge.net/documents.html . 2.1 Basic structue, simplified_policy tag and domain tag (1) tag It is root tag. Within the tag,
tag is repeated like below.
xxxx
xxxx
xxxx .... (2)
tag Between domain tag, access control rule for corresponding domain is described. * Attribute: > id: domain or role name > type: "role" or "domain" If "domain", value stored id is domain, if "role" value stored id is role * Example
xxxxxxxx
Configuration xxxxx is for domain "httpd_t".
xxxxxx
Configuration xxxxxx is for role "sysadm_r" .2 Tags to describe access control (1) domaintrans tag Corresponds to "domain_trasn" statement in SPDL. Describes domain transision by parentdomain and entrypoint tag, like below. (2) user tag Corresponds to "user" statement of SPDL. Specifies user name by value attribute like below. (3) allowfile tag There are three Attribute - type: allow|deny|exclusive - only: yes|no - exclusive: yes|no Corresponds to "allow" statement of SPDL. Let's see how to describe allow statement in XML form. a) allow For example, allow /hoge r,s; When "allow", use type="allow", and only="no" and specify filename and permissions like below. You must use one permission tag for one permission. If you want to represent "allowonly" use attribute only="yes". And if you want to represent "deny" use attribute type"deny". b) allow exclusive