From 73edbc91012e11a6f7bd7f0df053bfa00d13471c Mon Sep 17 00:00:00 2001 From: Chris PeBenito Date: Mon, 6 Oct 2008 14:01:59 +0000 Subject: [PATCH] trunk: add oident from dominick grift. --- Changelog | 1 + policy/modules/services/oident.fc | 10 ++++ policy/modules/services/oident.if | 85 +++++++++++++++++++++++++++++++ policy/modules/services/oident.te | 73 ++++++++++++++++++++++++++ 4 files changed, 169 insertions(+) create mode 100644 policy/modules/services/oident.fc create mode 100644 policy/modules/services/oident.if create mode 100644 policy/modules/services/oident.te diff --git a/Changelog b/Changelog index 3799670f6..dc008a968 100644 --- a/Changelog +++ b/Changelog @@ -14,6 +14,7 @@ named pipe. Updated init_telinit() to match. - Added modules: cyphesis (Dan Walsh) + oident (Dominick Grift) w3c (Dan Walsh) * Wed Jul 02 2008 Chris PeBenito - 20080702 diff --git a/policy/modules/services/oident.fc b/policy/modules/services/oident.fc new file mode 100644 index 000000000..c219f0e70 --- /dev/null +++ b/policy/modules/services/oident.fc @@ -0,0 +1,10 @@ +HOME_DIR/\.oidentd.conf gen_context(system_u:object_r:ROLE_oidentd_home_t, s0) + +/etc/oidentd\.conf -- gen_context(system_u:object_r:oidentd_config_t, s0) +/etc/oidentd_masq\.conf -- gen_context(system_u:object_r:oidentd_config_t, s0) + +/etc/rc\.d/init\.d/oidentd -- gen_context(system_u:object_r:oidentd_initrc_exec_t, s0) + +/usr/sbin/oidentd -- gen_context(system_u:object_r:oidentd_exec_t, s0) + + diff --git a/policy/modules/services/oident.if b/policy/modules/services/oident.if new file mode 100644 index 000000000..7cff0d82b --- /dev/null +++ b/policy/modules/services/oident.if @@ -0,0 +1,85 @@ +## SELinux policy for Oident daemon. +## +##

+## Oident daemon is a server that implements the TCP/IP +## standard IDENT user identification protocol as +## specified in the RFC 1413 document. +##

+##
+ +####################################### +## +## The per role template for the Oidentd module. +## +## +##

+## This template creates derived domains which are used +## for Oident daemon. +##

+##

+## This template is invoked automatically for each user, and +## generally does not need to be invoked directly +## by policy writers. +##

+##
+## +## +## The prefix of the user domain (e.g., user +## is the prefix for user_t). +## +## +## +## +## The type of the user domain. +## +## +## +## +## The role associated with the user domain. +## +## +# +template(`oidentd_per_role_template', ` + + ######################################## + # + # Oident daemon shared declarations + # + + gen_require(` + attribute oidentd_user_content_type; + ') + + type $1_oidentd_home_t, oidentd_user_content_type; + userdom_user_home_content($1, oidentd_$1_content_t) + + typeattribute oidentd_$1_content_t oidentd_user_content_type; + + ######################################## + # + # Oident daemon shared policy + # + + allow $2 oidentd_$1_content_t:file manage_file_perms; + allow $2 oidentd_$1_content_t:file relabel_file_perms; +') + +######################################## +## +## Allow the specified domain to read +## Oidentd personal configuration files. +## +## +## +## Domain allowed access. +## +## +# +interface(`oidentd_read_all_user_content', ` + gen_require(` + attribute oidentd_user_content_type; + ') + + allow $1 oidentd_user_content_type:file read_file_perms; + userdom_search_all_users_home_dirs($1) +') diff --git a/policy/modules/services/oident.te b/policy/modules/services/oident.te new file mode 100644 index 000000000..2b8070c17 --- /dev/null +++ b/policy/modules/services/oident.te @@ -0,0 +1,73 @@ + +policy_module(oident, 1.0.0) + +######################################## +# +# Oident daemon private declarations +# + +attribute oidentd_user_content_type; + +type oidentd_t; +type oidentd_exec_t; +init_daemon_domain(oidentd_t, oidentd_exec_t) + +type oidentd_initrc_exec_t; +init_script_file(oidentd_initrc_exec_t) + +type oidentd_config_t; +files_config_file(oidentd_config_t) + +######################################## +# +# Oident daemon private policy +# + +allow oidentd_t self:capability { setuid setgid }; +allow oidentd_t self:netlink_route_socket { write getattr read bind create nlmsg_read }; +allow oidentd_t self:netlink_tcpdiag_socket { write read create nlmsg_read }; +allow oidentd_t self:tcp_socket { setopt read bind create accept write getattr listen }; +allow oidentd_t self:udp_socket { write read create connect getattr ioctl }; +allow oidentd_t self:unix_dgram_socket { create connect }; + +allow oidentd_t oidentd_config_t:file read_file_perms; + +corenet_all_recvfrom_unlabeled(oidentd_t) +corenet_all_recvfrom_netlabel(oidentd_t) +corenet_tcp_sendrecv_all_if(oidentd_t) +corenet_tcp_sendrecv_all_nodes(oidentd_t) +corenet_tcp_bind_all_nodes(oidentd_t) +corenet_tcp_bind_auth_port(oidentd_t) +corenet_sendrecv_auth_server_packets(oidentd_t) + +files_read_etc_files(oidentd_t) + +kernel_read_kernel_sysctls(oidentd_t) +kernel_read_network_state(oidentd_t) +kernel_read_network_state_symlinks(oidentd_t) +kernel_read_sysctl(oidentd_t) + +libs_use_ld_so(oidentd_t) +libs_use_shared_libs(oidentd_t) + +logging_send_syslog_msg(oidentd_t) + +miscfiles_read_localization(oidentd_t) + +sysnet_read_config(oidentd_t) + +oidentd_read_all_user_content(oidentd_t) + +optional_policy(` + nis_use_ypbind(oidentd_t) +') + +tunable_policy(`use_samba_home_dirs', ` + fs_list_cifs(oidentd_t) + fs_read_cifs_files(oidentd_t) +') + +tunable_policy(`use_nfs_home_dirs', ` + fs_list_nfs(oidentd_t) + fs_read_nfs_files(oidentd_t) +')