Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp362574pxb; Wed, 27 Jan 2021 09:24:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0BVLiTvQyWnigZkyLQTrHcajlhIUhqko71N8eFtvp0ZNh7hdN01Qfi0Vd1Jj0ZH8tetvG X-Received: by 2002:a17:907:7785:: with SMTP id ky5mr7835545ejc.176.1611768281756; Wed, 27 Jan 2021 09:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611768281; cv=none; d=google.com; s=arc-20160816; b=n5e1ntKe6bumRFQOl0tpN+QAsfVAKmV9kesr/tkYvw8ShjnMUeUb/47gBG5XkQ14kf fLpKDGGX2LoHltfBDij1PrXoPR6RLTwoXI0HeXWJzRZzkKyBm66HwV4b/3lhGkW3nDc9 thoF6xQwZPTd6DRXJVc4imNL7YLcB6rZUWrO7EJGwxgCy1ZBUlU7JmDZqrjEJEU04YyU oYI7kt5x5P6ut02Hfj0KLKqWNj3L+J+emYf6WlpIzbxU58AGhH8LNwmsjhpWgc0C47Lg AD2tidFAk2/uEKICM2WT41f3Xbfz9scuNZhV8z+SUB0aFDuRV98ElUa2sf76Xt7oxYwV IKFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=HgCnNM0TRl5QJ5Ofj3lAQQpTuc3AYymZAvp+cL0jncU=; b=MH3YJ0lubftSO3+VsZmijYl0uinKtf1eqyFsfBTFu6lgdRRPoC6yPn2hAOQ0YYc5L8 LIW/Wtn2l0lLRqov516Jw2+r9ibiC587rMa+m0GpwICOBCon064mxHxnnU2TLy+pm6cA 2Mjh6yyuYzT9mDGTRsocUOcT4SE/yFQqwO2LVcrEkLksWYwG0G163gbI/410xpUcF9AT DI5lGSScK1i75JIzkDl3rESf0qtLFLdOy9ktsiHNBvKGCBGn9byZ/2lMpUDFe7ehof/H JC4V2LWGCed7KOjejJGgJCGwdbpoB/eMj7adM6T1dtt04VD3BbPn5qbiXdSvBFVp0B8m iTbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=1lZ+ieku; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qh14si1106896ejb.360.2021.01.27.09.24.34; Wed, 27 Jan 2021 09:24:41 -0800 (PST) Received-SPF: pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=1lZ+ieku; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=coker.com.au Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233783AbhA0RWx (ORCPT + 16 others); Wed, 27 Jan 2021 12:22:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234165AbhA0RVW (ORCPT ); Wed, 27 Jan 2021 12:21:22 -0500 Received: from smtp.sws.net.au (smtp.sws.net.au [IPv6:2a01:4f8:140:71f5::dada:cafe]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D24A6C061573 for ; Wed, 27 Jan 2021 09:20:41 -0800 (PST) Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id 0A0111662C for ; Thu, 28 Jan 2021 04:20:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1611768040; bh=HgCnNM0TRl5QJ5Ofj3lAQQpTuc3AYymZAvp+cL0jncU=; l=6671; h=Date:From:To:Subject:From; b=1lZ+iekugt7UvIV3SbbbpMNII1jPmhs0DZinxKHvC9i7QSVaPtUDsu8LuO+Zqprvx BTjf+JnjObW0aPKeRcJemHgn73887bYTA6Cc5w/rfB/QlD6X+tEXA7BzYYQLDml0v5 LO73qaCj1tzvAw+XJ9K/PqiQLLXB7EX53ja4FaX0= Received: by xev.coker.com.au (Postfix, from userid 1001) id 081AD133C935; Thu, 28 Jan 2021 04:20:36 +1100 (AEDT) Date: Thu, 28 Jan 2021 04:20:35 +1100 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] misc network patches with Dominick's changes*2 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org I think this one is good for merging now. Signed-off-by: Russell Coker Index: refpolicy-2.20210126/policy/modules/admin/netutils.te =================================================================== --- refpolicy-2.20210126.orig/policy/modules/admin/netutils.te +++ refpolicy-2.20210126/policy/modules/admin/netutils.te @@ -109,6 +109,7 @@ allow ping_t self:tcp_socket create_sock allow ping_t self:rawip_socket { create ioctl read write bind getopt setopt getattr }; allow ping_t self:packet_socket { create ioctl read write bind getopt setopt }; allow ping_t self:netlink_route_socket create_netlink_socket_perms; +allow ping_t self:icmp_socket create; corenet_all_recvfrom_netlabel(ping_t) corenet_sendrecv_icmp_packets(ping_t) @@ -156,13 +157,14 @@ allow traceroute_t self:capability { net allow traceroute_t self:fifo_file rw_inherited_fifo_file_perms; allow traceroute_t self:process signal; allow traceroute_t self:rawip_socket create_socket_perms; -allow traceroute_t self:packet_socket create_socket_perms; +allow traceroute_t self:packet_socket { map create_socket_perms }; allow traceroute_t self:udp_socket create_socket_perms; can_exec(traceroute_t, traceroute_exec_t) kernel_read_system_state(traceroute_t) kernel_read_network_state(traceroute_t) +kernel_search_fs_sysctls(traceroute_t) corecmd_search_bin(traceroute_t) @@ -197,6 +199,7 @@ auth_use_nsswitch(traceroute_t) logging_send_syslog_msg(traceroute_t) +miscfiles_read_generic_certs(traceroute_t) miscfiles_read_localization(traceroute_t) userdom_use_inherited_user_terminals(traceroute_t) Index: refpolicy-2.20210126/policy/modules/system/sysnetwork.fc =================================================================== --- refpolicy-2.20210126.orig/policy/modules/system/sysnetwork.fc +++ refpolicy-2.20210126/policy/modules/system/sysnetwork.fc @@ -27,6 +27,7 @@ ifdef(`distro_debian',` /etc/dhcp3?/dhclient.* gen_context(system_u:object_r:dhcp_etc_t,s0) /etc/systemd/network(/.*)? gen_context(system_u:object_r:net_conf_t,s0) +/etc/tor/torsocks\.conf -- gen_context(system_u:object_r:net_conf_t,s0) ifdef(`distro_redhat',` /etc/sysconfig/network-scripts/.*resolv\.conf -- gen_context(system_u:object_r:net_conf_t,s0) Index: refpolicy-2.20210126/policy/modules/system/sysnetwork.te =================================================================== --- refpolicy-2.20210126.orig/policy/modules/system/sysnetwork.te +++ refpolicy-2.20210126/policy/modules/system/sysnetwork.te @@ -5,6 +5,14 @@ policy_module(sysnetwork, 1.26.5) # Declarations # +## +##

+## Determine whether DHCP client +## can manage samba +##

+##
+gen_tunable(dhcpc_manage_samba, false) + attribute_role dhcpc_roles; roleattribute system_r dhcpc_roles; @@ -175,6 +183,18 @@ ifdef(`init_systemd',` ') optional_policy(` + tunable_policy(`dhcpc_manage_samba',` + samba_manage_var_files(dhcpc_t) + init_exec_script_files(dhcpc_t) + init_get_system_status(dhcpc_t) + samba_stop(dhcpc_t) + samba_start(dhcpc_t) + samba_reload(dhcpc_t) + samba_status(dhcpc_t) + ') +') + +optional_policy(` avahi_domtrans(dhcpc_t) ') Index: refpolicy-2.20210126/policy/modules/services/samba.if =================================================================== --- refpolicy-2.20210126.orig/policy/modules/services/samba.if +++ refpolicy-2.20210126/policy/modules/services/samba.if @@ -729,3 +729,79 @@ interface(`samba_admin',` files_list_tmp($1) admin_pattern($1, { swat_tmp_t smbd_tmp_t winbind_tmp_t }) ') + +######################################## +## +## start samba daemon +## +## +## +## Domain allowed access. +## +## +# +interface(`samba_start',` + gen_require(` + type samba_unit_t; + ') + + allow $1 samba_unit_t:file getattr; + allow $1 samba_unit_t:service start; +') + +######################################## +## +## stop samba daemon +## +## +## +## Domain allowed access. +## +## +# +interface(`samba_stop',` + gen_require(` + type samba_unit_t; + ') + + allow $1 samba_unit_t:file getattr; + allow $1 samba_unit_t:service stop; +') + +######################################## +## +## get status of samba daemon +## +## +## +## Domain allowed access. +## +## +# +interface(`samba_status',` + gen_require(` + type samba_unit_t; + ') + + allow $1 samba_unit_t:file getattr; + allow $1 samba_unit_t:service status; +') + +######################################## +## +## reload samba daemon +## +## +## +## Domain allowed access. +## +## +# +interface(`samba_reload',` + gen_require(` + type samba_unit_t; + ') + + allow $1 samba_unit_t:file getattr; + allow $1 samba_unit_t:service reload; +') Index: refpolicy-2.20210126/policy/modules/services/mon.te =================================================================== --- refpolicy-2.20210126.orig/policy/modules/services/mon.te +++ refpolicy-2.20210126/policy/modules/services/mon.te @@ -58,6 +58,9 @@ manage_files_pattern(mon_t, mon_var_log_ manage_files_pattern(mon_t, mon_runtime_t, mon_runtime_t) files_runtime_filetrans(mon_t, mon_runtime_t, file) +# to read fips_enabled +kernel_read_crypto_sysctls(mon_t) + kernel_read_kernel_sysctls(mon_t) kernel_read_network_state(mon_t) kernel_read_system_state(mon_t) Index: refpolicy-2.20210126/policy/modules/services/mailman.te =================================================================== --- refpolicy-2.20210126.orig/policy/modules/services/mailman.te +++ refpolicy-2.20210126/policy/modules/services/mailman.te @@ -112,6 +112,7 @@ corecmd_exec_bin(mailman_cgi_t) dev_read_urand(mailman_cgi_t) files_search_locks(mailman_cgi_t) +files_read_usr_files(mailman_cgi_t) term_use_controlling_term(mailman_cgi_t) Index: refpolicy-2.20210126/policy/modules/services/dkim.te =================================================================== --- refpolicy-2.20210126.orig/policy/modules/services/dkim.te +++ refpolicy-2.20210126/policy/modules/services/dkim.te @@ -35,6 +35,7 @@ kernel_read_vm_overcommit_sysctl(dkim_mi corenet_udp_bind_generic_node(dkim_milter_t) corenet_udp_bind_all_unreserved_ports(dkim_milter_t) +corenet_udp_bind_generic_port(dkim_milter_t) dev_read_urand(dkim_milter_t) # for cpu/online