Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp374641pxb; Wed, 13 Jan 2021 06:02:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXoEZ1MPqYJVxIKZHosRQn2blZcNEOti4QlPVGestHahtS6O7ALTzF3w1uwpDpnkVH7ye5 X-Received: by 2002:a50:d80c:: with SMTP id o12mr1820494edj.338.1610546550478; Wed, 13 Jan 2021 06:02:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610546550; cv=none; d=google.com; s=arc-20160816; b=JYZYSTwgzOhdcDHJVYrDLE/9Q5oTw5d33Nwhq8cGMYhAUpXeJRc9OC3QcIkdqH+K6N 8bTwYi1TIIH//2a7kkbODsLEbGPFcBorFacnDUf1+o66oaU0UvWIylr17z2XCKPMtVh5 snzK2QAD4ZdqraEszo1lSoBapHnjB6vmQlCpgvA1XMpYfbzWc6Vr4qF6oZOqbsLb7GgN Lp8Y78YcyUbADnUFMhg7mJb7QA0z5leQgUlvdW5yGQiio+KEjzbSDgyveqNsOLjji5Jd j4/4ABKsF4DrIYdNt794+Cj9N1o8SRO0cfhEn6GRmHxoRhM/1ZWFEqMm4e6MZa2H1Ged DyRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=RlBCeClTx4oPS7T4TrAWO2vbw72k7ma7iLEwe2I5TFY=; b=rdrJWL1xSQxVzQCKQj5162u9p96BmD5vlk5jBKTqfAgywkVCviFwW50CRtwymJF9Mi 82TKbzUq5KztpsoN9poM7YymTSxvfkyf4l6qAP2h5C0nu/s5MB1goemy3scv+lZZiGV9 /tprhS4CvEfFCDioWsOHq5wxLK779htcA9UkWqqjQM+9/7fxKOvLIkv+UuSVxGKuTKAY Cp7XZl43aZr/xMHR8U/PvQnZLx9wj4aAULJ40vuTcojNsP+spMrhgoA85XakCxIQVqtW 9/kUsdrZ6Xhc2ZUI71ZcVlqAIoUUlpsVdkH8JwsFgNihuqGRAileoF435BUSYfa3CoFe q/Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=eRy5VJby; 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=NONE sp=NONE dis=NONE) header.from=ieee.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sa15si140356ejb.1.2021.01.13.06.02.23; Wed, 13 Jan 2021 06:02: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=@ieee.org header.s=google header.b=eRy5VJby; 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=NONE sp=NONE dis=NONE) header.from=ieee.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725771AbhAMN7F (ORCPT + 18 others); Wed, 13 Jan 2021 08:59:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbhAMN7F (ORCPT ); Wed, 13 Jan 2021 08:59:05 -0500 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B49E2C061575 for ; Wed, 13 Jan 2021 05:58:24 -0800 (PST) Received: by mail-io1-xd2d.google.com with SMTP id o6so4167876iob.10 for ; Wed, 13 Jan 2021 05:58:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=RlBCeClTx4oPS7T4TrAWO2vbw72k7ma7iLEwe2I5TFY=; b=eRy5VJbyGZ9ZNBfxeigmqARgv/bruIpuktJivTn1/N0lkGo0B1GukXT+WbXDl3Uj4K im6Kb1R/7v4RQ22PGyAffDzjj0+vcVxd6DXOQMuR8ysD3JxxixS0k+TOUekOQLhJAIvn YwPNP95wLbuJrUsMBdJACbQOtSXUkRadmjeDU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RlBCeClTx4oPS7T4TrAWO2vbw72k7ma7iLEwe2I5TFY=; b=gcqYoVB8KYulvKe6hywLq1rXDtJM6DE56dhj/T1p2UzXyO8FU2cOP8IKrmNCE8/xYw X873K6tPivNGa8U8EuxPD8PhgGdSWZsTY9CdqcKL2SDXruL9da9El1App+VgTLctu6L+ 4n/yGyZlCdwjHOjG2fy3EJuehmzgmteMx9Vo6WN1QkYkLP9CFz0kbyjNG2vVydN6IIvo cgOJDKUnGaEbF/lZRU+wb5IItwYLf8HWTwYCNlMRV2vjAu2zMwbkJ7ejAaZWTX8A6it4 rmP6bTMfo4UcVRsgWEM+HazUBNKYIekkvIuJbNb7otAL7HsWvuslbHPvJBcy+a6hdBaT AJQw== X-Gm-Message-State: AOAM531bLXjZQuywRYpeMtZAlcF4TizvvRzRt8XvCyH7Ls7zBPhtgp9+ Lz7ricY/lZ/sIzV+YYT3wEyX2SbItFDD8Q== X-Received: by 2002:a05:6e02:13b3:: with SMTP id h19mr2449020ilo.187.1610546303772; Wed, 13 Jan 2021 05:58:23 -0800 (PST) Received: from fedora.pebenito.net (pool-96-234-173-17.bltmmd.fios.verizon.net. [96.234.173.17]) by smtp.gmail.com with ESMTPSA id s81sm1121944ilk.32.2021.01.13.05.58.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Jan 2021 05:58:23 -0800 (PST) Subject: Re: [PATCH] latest iteration of certbot policy To: Russell Coker , selinux-refpolicy@vger.kernel.org References: From: Chris PeBenito Message-ID: <5ba70a89-ab64-9217-c311-369d826583d8@ieee.org> Date: Wed, 13 Jan 2021 08:58:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org On 1/12/21 5:55 AM, Russell Coker wrote: > I think I've addressed all issues raised in the past. > > Signed-off-by: Russell Coker This looks ok, but it's not formatted as a patch; I could work around that. However, I can't merge since there are no .if nor .fc files. > 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) > ') > -- Chris PeBenito