Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2088710pxb; Fri, 25 Mar 2022 10:53:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWycGrT0+3seSovBwP4sVRcDm53YnKEMBCJjP0c8dw4nVN2kD+Rvl/pnl60meDwWd7SFc2 X-Received: by 2002:a17:90b:1e47:b0:1c6:d5a9:b147 with SMTP id pi7-20020a17090b1e4700b001c6d5a9b147mr13960645pjb.223.1648230792878; Fri, 25 Mar 2022 10:53:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648230792; cv=none; d=google.com; s=arc-20160816; b=Dw8CrIovIXB5gUUBrmLw4ZnP1hRUI4HxcJqNr3qb5dnJjdzDb7HfzWkMnsk/mCbS1B JfyMHw8TPwTtUFAl50Oze3sgQhVuVpQnlVsGnSSZu2C1IORPBJF7rxN8GTeZtqYsCmoJ 9MCknwvHm9xEZaIjkMJTRlnz6EZsVIG0Ru2db2pknvh1il8fQiKj0N5W7sOjoCp/SZ1+ qPxzqaymOOLjBjPVpbwZTMlvAfqhSloGY6NuHBPZmgmBNol8ghDJOUsEc2lFP0jDeKnN /ZT9IW1paBpwBWyIcHbBm/Qo9kkNUws3Td879Q4jRAF4ALBJjVsLgdM3kBZUITz3J2QR L1Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=ZCUP6p0TpB7Lq3E8e2PU3ZkgUjCgCtqJr5Ue4uRpMI4=; b=jrtwG+1eOmuBAUScA6k0hKOH5n070SYC5x3YLISrRTkB5ftIx+NGWRVVRpRssU1TVq eaRojJtHcSzCTQAyb+yyaEwoFi02MUJ03fGybYJMQqO6nXHhejPjyLi6Xo5QzVkW9+0h 2OoIDdJuULi9nQa1dGrkVbI6PGIpW0bkUHuMxRuAxwlSKdZtaWWwXUxfX+tNEd+FpY6j TWdQAIvGbxgy6Wxu8mzD0QGPZy/MxxYamkP3Tmiy06qITol8PNeqVSOm/ipYc2whO/Wu 8Cuc/Dker4Fh3FBxsNQygtfyloubH+XWhsNXpIfsIZteZVhoi5s6A6Lg12+BPMJg3pr5 KJWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=C+olqQ6u; spf=softfail (google.com: domain of transitioning selinux-refpolicy-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k2-20020a056a00134200b004fa3a8dffe6si3687508pfu.157.2022.03.25.10.53.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 10:53:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning selinux-refpolicy-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=C+olqQ6u; spf=softfail (google.com: domain of transitioning selinux-refpolicy-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D5CFA652E9; Fri, 25 Mar 2022 10:33:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234077AbiCYPi5 (ORCPT + 23 others); Fri, 25 Mar 2022 11:38:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377174AbiCYPiX (ORCPT ); Fri, 25 Mar 2022 11:38:23 -0400 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7E844A3C9 for ; Fri, 25 Mar 2022 08:35:10 -0700 (PDT) Received: by mail-qk1-x729.google.com with SMTP id r127so6215433qke.13 for ; Fri, 25 Mar 2022 08:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=ZCUP6p0TpB7Lq3E8e2PU3ZkgUjCgCtqJr5Ue4uRpMI4=; b=C+olqQ6uk9Wzil//kP2N5kGr5F5TQ0Debn7JdAU5aXuLpp818cW0Gh2rNqo1vjHeL2 HnUfas7QBISJD0+sUZJOEIt0VIlkPxcnhE5g81BCcs4uXWkFCHdh0ckYw0va8C6vSPJ/ HIfycEKL26pnGUzUTfVEGNIxfcjWMd/tLRLWU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=ZCUP6p0TpB7Lq3E8e2PU3ZkgUjCgCtqJr5Ue4uRpMI4=; b=Pj659w1yDZ969tFWi8dPGxRrtA9jp8ogoWKrwFBJCbjuh3HwL44xqnSiOaeUT/CMtq ukEvC865zIBhAVe/wUSWopgw+uxgYWIdc6VDmw5Nigs9aRmKQQUMeqKKPswywqkl/7t2 NZ3JnGJj5EK4Pug+16+aEMN1jCWdLivXQll80TYgs9KN97iHus8afQRdR6H9ge9a4yPU 2DijzRyLIRWffOkWEalyGNW4T0QIYBkpbBCJHRUOhClOeSi8524j7kjdWIPyg/ZpDPa9 lOeRcMUC7F41Fv/CTOWnQqpc33pLXLXBYV4vF5szlrD83urLBF9tZmhPY/KXA+ibAI/J N3OQ== X-Gm-Message-State: AOAM532DDNQVynvKRs8Gqd8RcBQ7BKDWy0a4zcnQe3KcYN/BSofHI7Of 2IEgwfdHIoGSvl7p6mBliUFg4KsAqxasKg== X-Received: by 2002:ae9:e64c:0:b0:67e:6d5a:d30 with SMTP id x12-20020ae9e64c000000b0067e6d5a0d30mr7119433qkl.540.1648222509450; Fri, 25 Mar 2022 08:35:09 -0700 (PDT) Received: from [192.168.1.133] (pool-68-134-25-67.bltmmd.fios.verizon.net. [68.134.25.67]) by smtp.gmail.com with ESMTPSA id h2-20020ac85842000000b002e1ec550506sm5037409qth.87.2022.03.25.08.35.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Mar 2022 08:35:08 -0700 (PDT) Message-ID: Date: Fri, 25 Mar 2022 11:35:07 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] certbot V3 Content-Language: en-US To: Russell Coker , selinux-refpolicy@vger.kernel.org References: From: Chris PeBenito In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 3/24/22 10:34, Russell Coker wrote: > Same as the last one but with the directory names for the auto trans rules > removed. I think it's ready for merging. > > Signed-off-by: Russell Coker > > Index: refpolicy-2.20220309/policy/modules/services/apache.if > =================================================================== > --- refpolicy-2.20220309.orig/policy/modules/services/apache.if > +++ refpolicy-2.20220309/policy/modules/services/apache.if > @@ -238,6 +238,24 @@ interface(`apache_domtrans',` > > ######################################## > ## > +## Execute httpd > +## > +## > +## > +## Domain allowed to execute it. > +## > +## > +# > +interface(`apache_exec',` > + gen_require(` > + type httpd_t, httpd_exec_t; > + ') > + > + can_exec($1, httpd_exec_t) > +') > + > +######################################## > +## > ## Execute httpd server in the httpd domain. > ## > ## > @@ -1430,3 +1448,21 @@ interface(`apache_admin',` > apache_run_all_scripts($1, $2) > apache_run_helper($1, $2) > ') > + > +######################################## > +## > +## rw httpd_runtime_t files > +## > +## > +## > +## Domain allowed access. > +## > +## > +# > +interface(`apache_rw_runtime_files',` > + gen_require(` > + type httpd_runtime_t; > + ') > + > + allow $1 httpd_runtime_t:file rw_file_perms; > +') > Index: refpolicy-2.20220309/policy/modules/services/certbot.te > =================================================================== > --- refpolicy-2.20220309.orig/policy/modules/services/certbot.te > +++ refpolicy-2.20220309/policy/modules/services/certbot.te > @@ -43,7 +43,7 @@ allow certbot_t self:udp_socket all_udp_ > 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) > +files_var_lib_filetrans(certbot_t, certbot_lib_t, dir) > manage_dirs_pattern(certbot_t, certbot_lib_t, certbot_lib_t) > manage_files_pattern(certbot_t, certbot_lib_t, certbot_lib_t) > > @@ -62,7 +62,7 @@ allow certbot_t certbot_tmp_t:file mmap_ > allow certbot_t certbot_tmpfs_t:file mmap_exec_file_perms; > allow certbot_t certbot_runtime_t:file mmap_exec_file_perms; > > -logging_search_logs(certbot_t) > +logging_log_filetrans(certbot_t, certbot_log_t, dir) > allow certbot_t certbot_log_t:dir manage_dir_perms; > allow certbot_t certbot_log_t:file manage_file_perms; > > @@ -80,11 +80,15 @@ corenet_tcp_connect_dns_port(certbot_t) > # bind to http port for standalone mode > corenet_tcp_bind_http_port(certbot_t) > > +dev_read_urand(certbot_t) > + > domain_use_interactive_fds(certbot_t) > > files_read_etc_files(certbot_t) > files_read_usr_files(certbot_t) > > +# dontaudit for attempts to write python cache files > +libs_dontaudit_write_lib_dirs(certbot_t) > libs_exec_ldconfig(certbot_t) > # for /usr/lib/gcc/x86_64-linux-gnu/8/collect2 > libs_exec_lib_files(certbot_t) > @@ -110,5 +114,17 @@ optional_policy(` > # for writing to webroot > apache_manage_sys_content(certbot_t) > > - apache_search_config(certbot_t) > + apache_append_log(certbot_t) > + apache_exec(certbot_t) > + apache_exec_modules(certbot_t) > + > + # for certbot to create nginx config > + apache_manage_config(certbot_t) > + > + apache_rw_runtime_files(certbot_t) > + apache_signal(certbot_t) > +') > + > +optional_policy(` > + xdg_search_config_dirs(certbot_t) > ') Merged. -- Chris PeBenito