From: cpebenito@tresys.com (Christopher J. PeBenito)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH] Add a policy module for shibboleth authentication
Date: Fri, 4 Apr 2014 15:13:54 -0400 [thread overview]
Message-ID: <533F0472.7020200@tresys.com> (raw)
In-Reply-To: <b2e3ef88-de1c-4890-9e33-0f7642d5a606@HUB2.rwth-ad.de>
On 03/15/2014 09:29 AM, Martin Lang wrote:
> Signed-off-by: Martin Lang <lang@automata.rwth-aachen.de>
> ---
> apache.te | 5 ++++
> shibboleth.fc | 6 +++++
> shibboleth.if | 40 ++++++++++++++++++++++++++++++
> shibboleth.te | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 126 insertions(+)
> create mode 100644 shibboleth.fc
> create mode 100644 shibboleth.if
> create mode 100644 shibboleth.te
Merged.
> diff --git a/apache.te b/apache.te
> index 3ca9c1f..6ad78d4 100644
> --- a/apache.te
> +++ b/apache.te
> @@ -867,6 +867,11 @@ optional_policy(`
> ')
>
> optional_policy(`
> + shibboleth_read_config(httpd_t)
> + shibboleth_stream_connect(httpd_t)
> +')
> +
> +optional_policy(`
> smokeping_read_lib_files(httpd_t)
> ')
>
> diff --git a/shibboleth.fc b/shibboleth.fc
> new file mode 100644
> index 0000000..a0b9626
> --- /dev/null
> +++ b/shibboleth.fc
> @@ -0,0 +1,6 @@
> +/etc/shibboleth(/.*)? gen_context(system_u:object_r:shibboleth_etc_t,s0)
> +
> +/usr/sbin/shibd -- gen_context(system_u:object_r:shibboleth_exec_t,s0)
> +
> +/var/log/shibboleth(/.*)? gen_context(system_u:object_r:shibboleth_log_t,s0)
> +/var/run/shibboleth(/.*)? gen_context(system_u:object_r:shibboleth_var_run_t,s0)
> diff --git a/shibboleth.if b/shibboleth.if
> new file mode 100644
> index 0000000..4a3ba02
> --- /dev/null
> +++ b/shibboleth.if
> @@ -0,0 +1,40 @@
> +## <summary>Shibboleth authentication deamon</summary>
> +
> +########################################
> +## <summary>
> +## Allow your application domain to access
> +## config files from shibboleth
> +## </summary>
> +## <param name="domain">
> +## <summary>
> +## The domain which should be enabled.
> +## </summary>
> +## </param>
> +#
> +interface(`shibboleth_read_config',`
> + gen_require(`
> + type shibboleth_etc_t;
> + ')
> +
> + read_files_pattern($1, shibboleth_etc_t, shibboleth_etc_t)
> +')
> +
> +########################################
> +## <summary>
> +## Allow the specified domain to connect to shibboleth with a unix socket.
> +## </summary>
> +## <param name="domain">
> +## <summary>
> +## Domain allowed access.
> +## </summary>
> +## </param>
> +#
> +interface(`shibboleth_stream_connect',`
> + gen_require(`
> + type shibboleth_t;
> + type shibboleth_var_run_t;
> + ')
> +
> + stream_connect_pattern($1, shibboleth_var_run_t, shibboleth_var_run_t, shibboleth_t)
> + files_search_pids($1)
> +')
> diff --git a/shibboleth.te b/shibboleth.te
> new file mode 100644
> index 0000000..d1f4212
> --- /dev/null
> +++ b/shibboleth.te
> @@ -0,0 +1,75 @@
> +policy_module(shibboleth, 2.0.0)
> +
> +########################################
> +#
> +# Declarations
> +#
> +
> +type shibboleth_t;
> +type shibboleth_exec_t;
> +init_daemon_domain(shibboleth_t, shibboleth_exec_t)
> +
> +type shibboleth_etc_t;
> +files_config_file(shibboleth_etc_t)
> +
> +type shibboleth_log_t;
> +logging_log_file(shibboleth_log_t)
> +
> +type shibboleth_var_run_t;
> +files_pid_file(shibboleth_var_run_t)
> +init_daemon_run_dir(shibboleth_var_run_t, "shibboleth")
> +
> +########################################
> +#
> +# Local policy
> +#
> +
> +allow shibboleth_t self:process { signal_perms };
> +
> +# networking:
> +# shibboleth uses tcp sockets for connecting to central
> +# authentication server and unix stream sockets
> +# to exchange information with the apache module
> +allow shibboleth_t self:unix_stream_socket create_stream_socket_perms;
> +allow shibboleth_t self:tcp_socket create_stream_socket_perms;
> +
> +read_files_pattern(shibboleth_t, shibboleth_etc_t, shibboleth_etc_t)
> +read_lnk_files_pattern(shibboleth_t, shibboleth_etc_t, shibboleth_etc_t)
> +
> +manage_files_pattern(shibboleth_t, shibboleth_log_t, shibboleth_log_t)
> +
> +manage_files_pattern(shibboleth_t, shibboleth_var_run_t, shibboleth_var_run_t)
> +manage_sock_files_pattern(shibboleth_t, shibboleth_var_run_t, shibboleth_var_run_t)
> +
> +
> +corenet_all_recvfrom_netlabel(shibboleth_t)
> +corenet_all_recvfrom_unlabeled(shibboleth_t)
> +corenet_tcp_connect_http_port(shibboleth_t)
> +corenet_tcp_sendrecv_all_ports(shibboleth_t)
> +corenet_tcp_sendrecv_generic_if(shibboleth_t)
> +corenet_tcp_sendrecv_generic_node(shibboleth_t)
> +
> +dev_read_urand(shibboleth_t)
> +
> +domain_dontaudit_use_interactive_fds(shibboleth_t)
> +
> +files_read_etc_files(shibboleth_t)
> +files_read_usr_files(shibboleth_t)
> +files_search_etc(shibboleth_t)
> +
> +term_dontaudit_search_ptys(shibboleth_t)
> +term_dontaudit_use_all_ptys(shibboleth_t)
> +term_dontaudit_use_all_ttys(shibboleth_t)
> +
> +
> +logging_log_filetrans(shibboleth_t, shibboleth_log_t, { file dir })
> +logging_send_syslog_msg(shibboleth_t)
> +
> +miscfiles_read_localization(shibboleth_t)
> +
> +sysnet_dns_name_resolve(shibboleth_t)
> +
> +
> +# permissions for the configuration files
> +# there is shared information between apache and shibboleth, e.g., certificates
> +apache_read_config(shibboleth_t)
>
--
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
prev parent reply other threads:[~2014-04-04 19:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-15 13:29 [refpolicy] [PATCH] Add a policy module for shibboleth authentication Martin Lang
2014-04-04 19:13 ` Christopher J. PeBenito [this message]
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=533F0472.7020200@tresys.com \
--to=cpebenito@tresys.com \
--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.