Skip to contentSkip to conversation

New policy for tboot utilities

PATCH New Luis Ressel 2 participants 2 messages Mar 7, 2016 – Mar 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 New policy for tboot utilities

tboot is an OSS project for using the features of Intel TXT. Some of its included utilities (might) need special permissions. For now, there's only a policy for txt-stat (it needs access to /dev/mem).

---
 tboot.fc |  1 +
 tboot.if | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 tboot.te | 24 ++++++++++++++++++++++++
 3 files changed, 71 insertions(+)
 create mode 100644 tboot.fc
 create mode 100644 tboot.if
 create mode 100644 tboot.te
tboot.fc new file +1 -0
new file mode 100644
index 0000000..437e1d5
@@ -0,0 +1 @@
+/usr/sbin/txt-stat		--	gen_context(system_u:object_r:txtstat_exec_t,s0)
tboot.if new file +46 -0

46 lines not on this page · raw message

tboot.te new file +24 -0
new file mode 100644
index 0000000..4961a36
@@ -0,0 +1,24 @@
+policy_module(tboot, 1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+attribute_role txtstat_roles;
+roleattribute system_r txtstat_roles;
+
+type txtstat_t;
+type txtstat_exec_t;
+application_domain(txtstat_t, txtstat_exec_t)
+role txtstat_roles types txtstat_t;
+
+########################################
+#
+# Local policy
+#
+
+dev_read_raw_memory(txtstat_t)
+
+domain_use_interactive_fds(txtstat_t)
+userdom_use_user_terminals(txtstat_t)
Signature · 1 line
2.7.2
#1 lore raw

PATCH v3 1/1 New policy for tboot utilities

Quoted 3 lines · Luis Ressel

tboot is an OSS project for using the features of Intel TXT. Some of its included utilities (might) need special permissions. For now, there's only a policy for txt-stat (it needs access to /dev/mem).

Merged.

Quoted 99 lines
---
 tboot.fc |  1 +
 tboot.if | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 tboot.te | 24 ++++++++++++++++++++++++
 3 files changed, 71 insertions(+)
 create mode 100644 tboot.fc
 create mode 100644 tboot.if
 create mode 100644 tboot.te
tboot.fc new file +1 -0
new file mode 100644
index 0000000..437e1d5
@@ -0,0 +1 @@
+/usr/sbin/txt-stat		--	gen_context(system_u:object_r:txtstat_exec_t,s0)
tboot.if new file +46 -0
new file mode 100644
index 0000000..0ffe6d8
@@ -0,0 +1,46 @@
+## <summary>Utilities for the tboot TXT module.</summary>
+
+########################################
+## <summary>
+##	Execute txt-stat in the txtstat domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+#
+interface(`tboot_domtrans_txtstat',`
+	gen_require(`
+		type txtstat_t, txtstat_exec_t;
+	')
+
+	corecmd_search_bin($1)
+	domtrans_pattern($1, txtstat_exec_t, txtstat_t)
+')
+
+########################################
+## <summary>
+##	Execute txt-stat in the txtstat domain, and
+##	allow the specified role the txtstat domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to transition.
+##	</summary>
+## </param>
+## <param name="role">
+##	<summary>
+##	The role to be allowed the txtstat domain.
+##	</summary>
+## </param>
+#
+interface(`tboot_run_txtstat',`
+	gen_require(`
+		type txtstat_t;
+		attribute_role txtstat_roles;
+	')
+
+	tboot_domtrans_txtstat($1)
+	roleattribute $2 txtstat_roles;
+')
tboot.te new file +24 -0
new file mode 100644
index 0000000..4961a36
@@ -0,0 +1,24 @@
+policy_module(tboot, 1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+attribute_role txtstat_roles;
+roleattribute system_r txtstat_roles;
+
+type txtstat_t;
+type txtstat_exec_t;
+application_domain(txtstat_t, txtstat_exec_t)
+role txtstat_roles types txtstat_t;
+
+########################################
+#
+# Local policy
+#
+
+dev_read_raw_memory(txtstat_t)
+
+domain_use_interactive_fds(txtstat_t)
+userdom_use_user_terminals(txtstat_t)
Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com