Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3038842pxb; Tue, 12 Jan 2021 05:01:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLvQ1xrnAibzYHjs8RbtfVSgdmy6EfI9agOg2Dl+XzdQv0HsSTNUjc+fpW5CTeuCMFtPNi X-Received: by 2002:a17:907:3fa6:: with SMTP id hr38mr1676627ejc.24.1610456490029; Tue, 12 Jan 2021 05:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610456490; cv=none; d=google.com; s=arc-20160816; b=AbBDWY+LnG5rLphhrL4M5jjJyk7CHU/xDEj9idvPkPoDLnpFUkEUSAPcPCcNSs78Mx 7i9f88wD7a6C8UO9sqjgqV6fVmYH7tGaWhAahr9csYWqkjHSj+pisxZuucYhPj1SZ404 aNEICLW0QigVVt0rdOHVEbHMfHvMD8l4gKt2NP5IXleLstw8SSRk8UdE7Vqsbbhpnml2 LQEZ42Hm83KlSH+EL5pPe0j7Xx2iCphldW/PjlhSKo4vIrbnIuTOSgK9ZYRLURcbdkJ1 sGWOwstwDgWQVjY/LYQxyOoy9AqCMLTJMM2hQ1Lkj3wcETRDBNQt8CQAME0aPh4O8bKv azsA== 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=8EY/GHs+CwAsr5BMNyhrDEQaQ2DgpkrIhU1tVHTIMhY=; b=iYJToWluXj3FPn5GJGHDwP2Zj557YGvtGerIAFrIPl5RsqpgRGMHPxRKHY0ZvC6q+c KOL+Mjp2avyKItLOCvHVyYe4hdqYfT47Wh6ZcKHYK1axtWFy6xctCF+h8jW8Ks3iqDvA fbRIYwyA2VuvtshYAQdM+mkXbAUjzmRzZIlgAuC0ViJ6FPYj4VRfvuNh67KAxkSjHKON qUTYChP2Y/OgJSwdeBbzJi0akORUTBYYpPG9j4Rb3ZnbxHTgCc3SxJzx2B6zNVSUDxkE ryoV9oR7koNUOUWbzAMnQCWEkUIAb9m2W6exnGtbJF5P1tVUk9LkO8z5QRajLkGweLue qp7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@coker.com.au header.s=2008 header.b=FWnSmDvH; 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 l19si1246214edq.537.2021.01.12.05.01.25; Tue, 12 Jan 2021 05:01:30 -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=FWnSmDvH; 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 S1727455AbhALK4U (ORCPT + 18 others); Tue, 12 Jan 2021 05:56:20 -0500 Received: from smtp.sws.net.au ([46.4.88.250]:48266 "EHLO smtp.sws.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727236AbhALK4U (ORCPT ); Tue, 12 Jan 2021 05:56:20 -0500 Received: from xev.coker.com.au (localhost [127.0.0.1]) by smtp.sws.net.au (Postfix) with ESMTP id A2CAD165A0 for ; Tue, 12 Jan 2021 21:55:37 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=coker.com.au; s=2008; t=1610448937; bh=8EY/GHs+CwAsr5BMNyhrDEQaQ2DgpkrIhU1tVHTIMhY=; l=3144; h=Date:From:To:Subject:From; b=FWnSmDvHAHzs+U3ZWSpXA+9KIaJPJlqP9CSLdT59z4tG4R9MvzHbvsB02ytHHb0Mx EBip2DhHnFRgCKh95GkYAnKAw62fUcvHU5NKstTurrmgwuN01n0sPKSmlk7s+4x89l RXxX6JnXtaO9bvkgomVFVSsIMpmNIvE+DyO9b5t0= Received: by xev.coker.com.au (Postfix, from userid 1001) id 29DF012ED063; Tue, 12 Jan 2021 21:55:33 +1100 (AEDT) Date: Tue, 12 Jan 2021 21:55:33 +1100 From: Russell Coker To: selinux-refpolicy@vger.kernel.org Subject: [PATCH] latest iteration of certbot policy 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 I've addressed all issues raised in the past. Signed-off-by: Russell Coker policy_module(certbot, 1.0.0) ######################################## # # Declarations # type certbot_t; type certbot_exec_t; init_daemon_domain(certbot_t, certbot_exec_t) type certbot_log_t; logging_log_file(certbot_log_t) type certbot_runtime_t alias certbot_var_run_t; files_runtime_file(certbot_runtime_t) type certbot_tmp_t; files_tmp_file(certbot_tmp_t) type certbot_tmpfs_t; files_tmpfs_file(certbot_tmpfs_t) type certbot_lib_t alias certbot_var_lib_t; files_type(certbot_lib_t) ######################################## # # Local policy # allow certbot_t self:fifo_file { getattr ioctl read write }; allow certbot_t self:capability { chown dac_override sys_resource }; allow certbot_t self:udp_socket all_udp_socket_perms; allow certbot_t self:tcp_socket all_tcp_socket_perms; allow certbot_t self:netlink_route_socket create_netlink_socket_perms; files_search_var_lib(certbot_t) manage_dirs_pattern(certbot_t, certbot_lib_t, certbot_lib_t) manage_files_pattern(certbot_t, certbot_lib_t, certbot_lib_t) manage_files_pattern(certbot_t, certbot_tmp_t, certbot_tmp_t) files_tmp_filetrans(certbot_t, certbot_tmp_t, { file }) manage_files_pattern(certbot_t, certbot_tmpfs_t, certbot_tmpfs_t) fs_tmpfs_filetrans(certbot_t, certbot_tmpfs_t, { file }) # this is for certbot to have write-exec memory, I know it is bad # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913544 # the Debian bug report has background about python-acme and python3-openssl allow certbot_t self:process execmem; allow certbot_t certbot_tmp_t:file { map execute }; allow certbot_t certbot_tmpfs_t:file { map execute }; allow certbot_t certbot_runtime_t:file { map execute }; logging_search_logs(certbot_t) allow certbot_t certbot_log_t:dir manage_dir_perms; allow certbot_t certbot_log_t:file manage_file_perms; manage_files_pattern(certbot_t, certbot_runtime_t, certbot_runtime_t) files_runtime_filetrans(certbot_t, certbot_runtime_t, file) kernel_search_fs_sysctls(certbot_t) corecmd_list_bin(certbot_t) corecmd_mmap_bin_files(certbot_t) corenet_tcp_bind_generic_node(certbot_t) corenet_tcp_connect_http_port(certbot_t) corenet_tcp_connect_dns_port(certbot_t) # bind to http port for standalone mode corenet_tcp_bind_http_port(certbot_t) domain_use_interactive_fds(certbot_t) files_read_etc_files(certbot_t) files_read_usr_files(certbot_t) libs_exec_ldconfig(certbot_t) # for /usr/lib/gcc/x86_64-linux-gnu/8/collect2 libs_exec_lib_files(certbot_t) miscfiles_read_localization(certbot_t) miscfiles_read_generic_certs(certbot_t) miscfiles_manage_generic_tls_privkey_dirs(certbot_t) miscfiles_manage_generic_tls_privkey_files(certbot_t) miscfiles_manage_generic_tls_privkey_lnk_files(certbot_t) sysnet_read_config(certbot_t) userdom_dontaudit_search_user_home_dirs(certbot_t) userdom_use_user_ptys(certbot_t) optional_policy(` # for writing to webroot apache_manage_sys_content(certbot_t) apache_search_config(certbot_t) ')