Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3188116pxp; Mon, 14 Mar 2022 12:53:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsk9kBfkat3OYZZmMMTIXNT0QPHKVgga2k75gJyeT2a4hMgtuVGbrV3nVV5cS3grYv3+87 X-Received: by 2002:a05:6402:1941:b0:413:2555:53e3 with SMTP id f1-20020a056402194100b00413255553e3mr22310687edz.164.1647287591271; Mon, 14 Mar 2022 12:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647287591; cv=none; d=google.com; s=arc-20160816; b=fWK4gZGy6/sLDd1LwCfZ7s4HAdJwxrv4NaNB6gctY+cWvNatjsV4/akjKwLrQ81AsY P6+ppy4+f818hfyR39+7tvwAHsnwBJXKVdVyC6Ln4hpQXfBVMtDhFOI+LIf+ye6y95qN 2cL1HmgPReZFiGKaohMFX8MugA+A85bULVHL0jyVXIgQZ28umEXRuSjkMKLZxYZjqgsb Rer8i/osOQJV8qn+tiK8+0CfPeMQN9KfMyr0ACsSmgpSrV4OVkZspDbf7ZN2znmlm8TZ 4Lbj/pkBdpy0D5oTII9R8qyX/0JG32hpSRqRRSBFsaEbf3RcxCsC0ofgwi6EOuMH4ynN HIQA== 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=lmmmc6uBhYIZX6bdS7UrHdhp8wAF7KdS7NCyEIcqyOM=; b=NVds4bTJ9ljxldYIqD4pAdv/3p7UYE0sm8Ip1uaW6fhyFRui54UHgwIhxYbtofXksV /oWPZ9OgSC+D2QmK0dJxe7mTqmEbJpJEwO/kL2X1S+PuK6dU+jgyOFNomaD9Y3QY1Odr NVO+kVdNZtX8N4UzFdHRi5ZT5KxUjpeDXJC/kGDff93o7fdQZOZFH3hLGw8O5nwEez4K HIZwEe7tHcTYdKH0xV/k/T8aMCBbDQbdL3hvXUq7drluvnV8Qm4gVRjeQ/+GQ8REwaJm sIVE7P9sOHbk9MquGJWKMo8L1sAsF51VoWHsM55SCYXLKM1J4LUb2iFOLoc2ZcReLlea py8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=Yu6xgCBZ; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020a17090636d300b006d09b6eb3e8si10029699ejc.258.2022.03.14.12.53.02; Mon, 14 Mar 2022 12:53:11 -0700 (PDT) Received-SPF: pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=Yu6xgCBZ; spf=pass (google.com: domain of selinux-refpolicy-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230419AbiCNNy2 (ORCPT + 23 others); Mon, 14 Mar 2022 09:54:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230109AbiCNNy1 (ORCPT ); Mon, 14 Mar 2022 09:54:27 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D93FB21E33 for ; Mon, 14 Mar 2022 06:53:16 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id z85so17157846vsz.5 for ; Mon, 14 Mar 2022 06:53:16 -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=lmmmc6uBhYIZX6bdS7UrHdhp8wAF7KdS7NCyEIcqyOM=; b=Yu6xgCBZ4AGDwOPcnSlZbFC/Aeazuof0RX1rXN3ARRFsLtniFUrfHEqEeKPLmL/SqE HFnUzzP+X4V8uBwfVE9KPaWROPuq5cX9w45KRqeX/9BYxSsccyQPZUL4WXunXpHkMXgW kQIKD64a5/HXn3fmjDuH4j2+TWEmiIVnK+jWw= 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=lmmmc6uBhYIZX6bdS7UrHdhp8wAF7KdS7NCyEIcqyOM=; b=syc5xaxeizBs92k5SCHltHbvQLgpa3e/7VpZQrm3AVngF51t+F4Lm3qKI8kGF1hPYn KB7sF8SHONhFGI8zIW7GRPzcXzss0bbMOT8i5y7VN1V6No3jOwOyz5Ff8JfXs/1xXoth DilYppzGKnFIVuita5Ux+DW9/hUWQepZC43ea3MP3m3RytG6At3pbGjGof6NFOdQ37Wm gvDOBTt0+PRcB34ngjXWVrIE7DEC2/duaJU11XRF7cc2utUrU9S8yQK4/MS7uBNynY3A XcM3atuZb99vDDvC77kF/7ip1oYJKJqYofD8/mF1b5X4VQmwEAj65eYaFP0hnj9dvPuz P59Q== X-Gm-Message-State: AOAM532R+jow2wSY6oFuaY3vpJO80ie0FZYKemgStMV10qB2nqlBY+yn wmPL3lSaxHQnVKX4VFix3upzonP2NPJ3Dw== X-Received: by 2002:a67:fa55:0:b0:322:8595:c946 with SMTP id j21-20020a67fa55000000b003228595c946mr9427204vsq.85.1647265995904; Mon, 14 Mar 2022 06:53:15 -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 d126-20020a1f9b84000000b0033218f9a425sm2265132vke.25.2022.03.14.06.53.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Mar 2022 06:53:15 -0700 (PDT) Message-ID: <736887c7-d588-8562-4933-030947915fe2@ieee.org> Date: Mon, 14 Mar 2022 09:53:14 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] certbot V2 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.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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/9/22 00:19, Russell Coker wrote: > Same as the last one but with the relabelto 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, "letsencrypt") > 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, "letsencrypt") I don't see any conflicting type_transitions here or above. If there are none, then the letsencrypt should be removed. > 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) > ') -- Chris PeBenito