Skip to contentSkip to conversation

New policy for tboot utilities

PATCH Superseded Luis Ressel 2 participants 3 messages Mar 5, 2016 – Mar 7, 2016

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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 | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tboot.te | 24 ++++++++++++++++++++++
 3 files changed, 97 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 +72 -0

72 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 v2 1/1 New policy for tboot utilities

Quoted 20 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).

tboot.if new file +15 -0
+########################################
+## <summary>
+##	Role access for txt-stat
+## </summary>
+## <param name="role">
+##	<summary>
+##	Role allowed access
+##	</summary>
+## </param>
+## <param name="domain">
+##	<summary>
+##	User domain for the role
+##	</summary>
+## </param>
+#

tboot.if line 72

Quoted 10 lines
tboot.if new file +10 -0
+interface(`tboot_txtstat_role',`
+	gen_require(`
+		type txtstat_t;
+	')
+
+	tboot_run_txtstat($2, $1)
+
+	ps_process_pattern($2, txtstat_t)
+	allow $2 txtstat_t:process { signull signal sigkill };
+')

Are all of the utilities simple command line tools (the ones that may need domains in the future)? If so, this interface doesn't seem necessary. The role interfaces are usually for complicated apps that have their own derived types e.g. for home directory content.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#2 lore raw

PATCH v2 1/1 New policy for tboot utilities

Quoted 5 lines · On Mon, 7 Mar 2016 10:13:29 -0500 "Christopher J. PeBenito"…

Are all of the utilities simple command line tools (the ones that may need domains in the future)? If so, this interface doesn't seem necessary. The role interfaces are usually for complicated apps that have their own derived types e.g. for home directory content.

Yes, all of them are simple CLI tools. The ps_process_pattern() isn't really needed either, root has those permissions anyway. I'll send an updated patch.

Signature · 9 lines
Regards,
Luis Ressel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20160307/30c40c91/attachment.bin