From: paul.moore@hp.com
To: selinux@tycho.nsa.gov
Subject: [RFC 1/2] Reference policy: NetLabel policy additions
Date: Tue, 10 Oct 2006 13:15:26 -0400 [thread overview]
Message-ID: <20061010172154.448485000@hp.com> (raw)
In-Reply-To: 20061010171524.936739000@hp.com
This patch adds basic NetLabel support to the reference policy.
---
refpolicy/policy/modules/system/netlabel.fc | 7 ++++
refpolicy/policy/modules/system/netlabel.if | 37 +++++++++++++++++++++++++
refpolicy/policy/modules/system/netlabel.te | 41 ++++++++++++++++++++++++++++
3 files changed, 85 insertions(+)
Index: refpolicy.lblnet/refpolicy/policy/modules/system/netlabel.fc
===================================================================
--- /dev/null
+++ refpolicy.lblnet/refpolicy/policy/modules/system/netlabel.fc
@@ -0,0 +1,7 @@
+
+########################################
+#
+# netlabel file contexts
+#
+
+/sbin/netlabelctl -- gen_context(system_u:object_r:netlabelctl_exec_t,s0)
Index: refpolicy.lblnet/refpolicy/policy/modules/system/netlabel.if
===================================================================
--- /dev/null
+++ refpolicy.lblnet/refpolicy/policy/modules/system/netlabel.if
@@ -0,0 +1,37 @@
+## <summary>NetLabel packet labeling</summary>
+
+########################################
+## <summary>
+## Allow the domain to receive UDP packets via NetLabel connections.
+## </summary>
+## <param name="domain">
+## <summary>
+## The type of the process requesting this access.
+## </summary>
+## </param>
+#
+interface(`netlabel_udp_recvfrom',`
+ gen_require(`
+ type unlabeled_t;
+ ')
+
+ allow $1 unlabeled_t:udp_socket recvfrom;
+')
+
+########################################
+## <summary>
+## Allow the domain to receive TCP packets via NetLabel connections.
+## </summary>
+## <param name="domain">
+## <summary>
+## The type of the process requesting this access.
+## </summary>
+## </param>
+#
+interface(`netlabel_tcp_recvfrom',`
+ gen_require(`
+ type unlabeled_t;
+ ')
+
+ allow $1 unlabeled_t:tcp_socket recvfrom;
+')
Index: refpolicy.lblnet/refpolicy/policy/modules/system/netlabel.te
===================================================================
--- /dev/null
+++ refpolicy.lblnet/refpolicy/policy/modules/system/netlabel.te
@@ -0,0 +1,41 @@
+
+policy_module(netlabel,1.0.0)
+
+########################################
+#
+# Declarations
+#
+
+type netlabelctl_t;
+type netlabelctl_exec_t;
+
+domain_type(netlabelctl_t)
+domain_entry_file(netlabelctl_t,netlabelctl_exec_t)
+
+########################################
+#
+# NetLabel Local policy
+#
+
+# sending netlabel'd packets does not require a selinux privilege, however
+# receiving netlabel's packets does
+allow staff_t unlabeled_t:{ tcp_socket udp_socket } recvfrom;
+allow user_t unlabeled_t:{ tcp_socket udp_socket } recvfrom;
+
+########################################
+#
+# netlabelctl Local policy
+#
+
+# allow sysadm_t to run netlabelctl
+domain_auto_trans(sysadm_t,netlabelctl_exec_t,netlabelctl_t)
+
+# allow netlabelctl access to shared libraries
+libs_use_ld_so(netlabelctl_t)
+libs_use_shared_libs(netlabelctl_t)
+
+# allow netlabelctl fd access
+domain_use_interactive_fds(netlabelctl_t)
+
+# allow communication with kernel subsystem
+allow netlabelctl_t self:netlink_socket { create bind write read };
--
paul moore
linux security @ hp
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-10-10 17:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-10 17:15 [RFC 0/2] NetLabel changes for Reference policy paul.moore
2006-10-10 17:15 ` paul.moore [this message]
2006-10-10 18:10 ` [RFC 1/2] Reference policy: NetLabel policy additions Christopher J. PeBenito
2006-10-10 19:52 ` Paul Moore
2006-10-10 21:07 ` Paul Moore
2006-10-10 17:15 ` [RFC 2/2] Reference policy: Restrict NetLabel to same MLS label connections by default paul.moore
2006-10-10 18:12 ` Christopher J. PeBenito
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061010172154.448485000@hp.com \
--to=paul.moore@hp.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.