From: sven.vermeulen@siphos.be (Sven Vermeulen)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH v2 1/2] Support the console/graphical links browser
Date: Sun, 13 Nov 2011 10:37:51 +0100 [thread overview]
Message-ID: <20111113093751.GB16792@siphos.be> (raw)
In-Reply-To: <20111113093714.GA16792@siphos.be>
Introduce the links_t domain for the links browser, which is an
ncurses/svgalib/X11 browser (so supports both commandline-only as
well as GUI environments)
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
---
links.fc | 6 +++++
links.if | 36 +++++++++++++++++++++++++++++++++++
links.te | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 105 insertions(+), 0 deletions(-)
create mode 100644 links.fc
create mode 100644 links.if
create mode 100644 links.te
diff --git a/links.fc b/links.fc
new file mode 100644
index 0000000..5749b58
--- /dev/null
+++ b/links.fc
@@ -0,0 +1,6 @@
+HOME_DIR/\.links(/.*)? gen_context(system_u:object_r:links_home_t,s0)
+
+#
+# /usr
+#
+/usr/bin/links -- gen_context(system_u:object_r:links_exec_t,s0)
diff --git a/links.if b/links.if
new file mode 100644
index 0000000..bf3e20a
--- /dev/null
+++ b/links.if
@@ -0,0 +1,36 @@
+## <summary>Links web browser</summary>
+
+#######################################
+## <summary>
+## The role interface for the links module.
+## </summary>
+## <param name="user_role">
+## <summary>
+## The role associated with the user domain.
+## </summary>
+## </param>
+## <param name="user_domain">
+## <summary>
+## The type of the user domain.
+## </summary>
+## </param>
+#
+interface(`links_role',`
+ gen_require(`
+ type links_t, links_exec_t, links_tmpfs_t, links_home_t;
+ ')
+
+ role $1 types links_t;
+
+ manage_dirs_pattern($2, links_home_t, links_home_t)
+ manage_files_pattern($2, links_home_t, links_home_t)
+ manage_lnk_files_pattern($2, links_home_t, links_home_t)
+
+ relabel_dirs_pattern($2, links_home_t, links_home_t)
+ relabel_files_pattern($2, links_home_t, links_home_t)
+ relabel_lnk_files_pattern($2, links_home_t, links_home_t)
+
+ domtrans_pattern($2, links_exec_t, links_t)
+
+ ps_process_pattern($2, links_t)
+')
diff --git a/links.te b/links.te
new file mode 100644
index 0000000..7c9d03f
--- /dev/null
+++ b/links.te
@@ -0,0 +1,63 @@
+policy_module(links, 1.0.0)
+
+############################
+#
+# Declarations
+#
+
+## <desc>
+## <p>
+## Allow links to manage files in users home directories (download files)
+## </p>
+## </desc>
+gen_tunable(links_manage_user_files, false)
+
+type links_t;
+type links_exec_t;
+userdom_user_application_domain(links_t, links_exec_t)
+
+type links_home_t;
+userdom_user_home_content(links_home_t)
+
+type links_tmpfs_t;
+userdom_user_tmpfs_file(links_tmpfs_t)
+
+############################
+#
+# Policy
+#
+
+allow links_t self:process signal_perms;
+allow links_t self:unix_stream_socket create_stream_socket_perms;
+
+manage_dirs_pattern(links_t, links_home_t, links_home_t)
+manage_files_pattern(links_t, links_home_t, links_home_t)
+manage_lnk_files_pattern(links_t, links_home_t, links_home_t)
+manage_sock_files_pattern(links_t, links_home_t, links_home_t)
+manage_fifo_files_pattern(links_t, links_home_t, links_home_t)
+userdom_user_home_dir_filetrans(links_t, links_home_t, dir)
+
+manage_files_pattern(links_t, links_tmpfs_t, links_tmpfs_t)
+manage_lnk_files_pattern(links_t, links_tmpfs_t, links_tmpfs_t)
+manage_fifo_files_pattern(links_t, links_tmpfs_t, links_tmpfs_t)
+manage_sock_files_pattern(links_t, links_tmpfs_t, links_tmpfs_t)
+fs_tmpfs_filetrans(links_t, links_tmpfs_t, { file lnk_file sock_file fifo_file })
+
+corenet_tcp_connect_http_port(links_t)
+
+domain_use_interactive_fds(links_t)
+
+auth_use_nsswitch(links_t)
+
+miscfiles_read_localization(links_t)
+
+userdom_use_user_terminals(links_t)
+
+tunable_policy(`links_manage_user_files',`
+ userdom_manage_user_home_content_dirs(links_t)
+ userdom_manage_user_home_content_files(links_t)
+')
+
+optional_policy(`
+ xserver_user_x_domain_template(links, links_t, links_tmpfs_t)
+')
--
1.7.3.4
next prev parent reply other threads:[~2011-11-13 9:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-13 9:37 [refpolicy] [PATCH v2 0/2] Add links_t domain for the links browser Sven Vermeulen
2011-11-13 9:37 ` Sven Vermeulen [this message]
2011-11-13 10:12 ` [refpolicy] [PATCH v2 1/2] Support the console/graphical " Russell Coker
2011-11-13 11:12 ` Sven Vermeulen
2011-11-13 11:48 ` Russell Coker
2011-11-13 18:56 ` Sven Vermeulen
2011-11-13 9:38 ` [refpolicy] [PATCH v2 2/2] Allow user domains to call links Sven Vermeulen
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=20111113093751.GB16792@siphos.be \
--to=sven.vermeulen@siphos.be \
--cc=refpolicy@oss.tresys.com \
/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.