Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3608187pxy; Mon, 26 Apr 2021 05:54:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrWfio75PbjX7MGKshq+jRUteocLfrmMA0ptZcMNGE0KFeA40KN9uNd/D93+nhAv67xf4T X-Received: by 2002:a63:d915:: with SMTP id r21mr16861723pgg.69.1619441663979; Mon, 26 Apr 2021 05:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619441663; cv=none; d=google.com; s=arc-20160816; b=R4KaSLesCowsWBA+fdIQ8f4NSLrnPY7+VDnQwVmZ2NkLYRr5rkwQSylSy9feiMWqgT d7+vWV7Mp0EPIAntwHae9z07J9ijyfwGu3iyswpdGCZpomB/+m7NuB1AWvyU+VT3eiGe URFCXI023tPHJ45ei8tTpI4hyXXHe8KWRUL38J/3HQBDYtKthZN+htFMHofYTVHvdH9j NOIKnnFOcrybaVDpSqXT/IvX+DRSiDbJEnAS++hUBS8n1QX74GnmLJfTrVmPevv5CtX4 wmGZUPduSuF1+ZZ8J3IIkBGT412FDP8Jnl5e2zMojg6lF1Yi2njoQGS7Yp1V8Ni3uffi kWnQ== 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=RSUIAdg4J01RCeg3Q2SGlkN5hvELndSFTQCeGS81eLE=; b=HCQ5wwE3/+Bwq8od3en43nfIeQSIK1n1mez6pAkVhThsU4IFeCxQZHlDlkKCevi8KH /GhKjHcyd2zwcI9oR9++3/9fRe11NxNOBHCuESS4R7h12ynQqmgJ9IWEy1+CALgZU5mA zPYW/EWlg/YzEEDPq3r2ZUCDx7NSE+6ydueu+d2vCVqJvIQ99xCctnNZUwmwaFB/FhSu +EilCqHB6Owv6rox4K374RSTg/t+LzYO6S+owI6GIL4hsucuIXelpmviBGzvluXEbdEx MXDh82lS6obr2VN2Sz5dbq73tzHXrNY0fzwbm11nIBZi1gnd7txTv3DQL4T/kZWkSZ7v vTUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=V3g9HhQc; 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 s23si17759618pgl.464.2021.04.26.05.54.21; Mon, 26 Apr 2021 05:54:23 -0700 (PDT) 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=V3g9HhQc; 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 S233262AbhDZMyw (ORCPT + 17 others); Mon, 26 Apr 2021 08:54:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233545AbhDZMyE (ORCPT ); Mon, 26 Apr 2021 08:54:04 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79703C061574 for ; Mon, 26 Apr 2021 05:53:23 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id a30so371162qvb.12 for ; Mon, 26 Apr 2021 05:53:23 -0700 (PDT) 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=RSUIAdg4J01RCeg3Q2SGlkN5hvELndSFTQCeGS81eLE=; b=V3g9HhQcSR61aJWosIcUGG/SOq+evMfBA6jnNwBj3ZfZt3iOyL6f3GhZTrFYR4t/c3 jMTZ4iTggpUzvHyCrWRdam511X50O+kzL7WXJnpDsxSyZP0U11h16dpji28WI8GHvQnM SuC2WiyuNwS7EeOqv3aUioO81dZw9oGysUDL4= 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=RSUIAdg4J01RCeg3Q2SGlkN5hvELndSFTQCeGS81eLE=; b=sZRNlnhWnUHd7aIx0t9WjKXKpvZlXp2sPX9ZJo8A6WWUMVyc16JfG6RO5ISkZpyhcJ OsZPJ7n0wUtdlu8P3tDjl9ATL1uQl0UG6U27nB86gUw7E8XDUWJ8+TjsEefJWQe9DpEZ qdL6+s9jYjQ4MXxLtksEUeO34ygx/9+FHwZ082OBRb+8uY60Fisqvip+gt0mbj/C9LLz zSINgDyvjgIm7phGZFGlXyAb2K9AyfC9rbRuTRshiFIduTWchRDOUbqXprVSIsNAtMsH R6rzv+jzo6F+zYJE2rmSiAlEdRWYO6aAA3NhY/B5S3/dyHYTkG7MjMwKlGedElP4MzGv xY6Q== X-Gm-Message-State: AOAM530R/2vUvgNKp3BNAcBJH8KzmzMBPzQF9/EKHBkJatVEqhleElxi DsDNQ6WDysCFNov4JDhksEyBv7X1cT9SDw== X-Received: by 2002:a0c:aa44:: with SMTP id e4mr10376062qvb.41.1619441602361; Mon, 26 Apr 2021 05:53:22 -0700 (PDT) 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 f22sm10630030qkm.134.2021.04.26.05.53.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Apr 2021 05:53:21 -0700 (PDT) Subject: Re: [PATCH] puppet changes To: Russell Coker , selinux-refpolicy@vger.kernel.org References: From: Chris PeBenito Message-ID: <04c6e5fa-1fd4-af32-1bee-5d6789934137@ieee.org> Date: Mon, 26 Apr 2021 08:52:56 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 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 4/20/21 11:06 PM, Russell Coker wrote: > I've just briefly tried setting up puppet and here are some policy changes. > The label of the /var/cache/puppet directory doesn't have policy because I > didn't get to the stage of it being used (contributions welcome). > > The corecmd_bin_entry_type() lines are the most important thing as puppet > is started by a common command for both server and agent, so we need stuff Why isn't this executable labeled with puppet_exec_t? Am I missing something? > like the below in systemd service files. > > [Service] > SELinuxContext=system_u:system_r:puppet_t:s0 > > [Service] > SELinuxContext=system_u:system_r:puppetmaster_t:s0 > > I have some other possible changes for Puppet, if someone who knows it well > would like to have a discussion about that. > > Signed-off-by: Russell Coker > > Index: refpolicy-2.20210203/policy/modules/admin/puppet.fc > =================================================================== > --- refpolicy-2.20210203.orig/policy/modules/admin/puppet.fc > +++ refpolicy-2.20210203/policy/modules/admin/puppet.fc > @@ -11,6 +11,7 @@ > /usr/sbin/puppetd -- gen_context(system_u:object_r:puppet_exec_t,s0) > /usr/sbin/puppetmasterd -- gen_context(system_u:object_r:puppetmaster_exec_t,s0) > > +/var/cache/puppet(/.*)? gen_context(system_u:object_r:puppet_cache_t,s0) > /var/lib/puppet(/.*)? gen_context(system_u:object_r:puppet_var_lib_t,s0) > > /var/log/puppet(/.*)? gen_context(system_u:object_r:puppet_log_t,s0) > Index: refpolicy-2.20210203/policy/modules/admin/puppet.te > =================================================================== > --- refpolicy-2.20210203.orig/policy/modules/admin/puppet.te > +++ refpolicy-2.20210203/policy/modules/admin/puppet.te > @@ -36,6 +36,9 @@ init_daemon_runtime_file(puppet_runtime_ > type puppet_tmp_t; > files_tmp_file(puppet_tmp_t) > > +type puppet_cache_t; > +files_type(puppet_cache_t) > + > type puppet_var_lib_t; > files_type(puppet_var_lib_t) > > @@ -96,6 +99,7 @@ kernel_read_kernel_sysctls(puppet_t) > kernel_read_net_sysctls(puppet_t) > kernel_read_network_state(puppet_t) > > +corecmd_bin_entry_type(puppet_t) > corecmd_exec_bin(puppet_t) > corecmd_exec_shell(puppet_t) > corecmd_read_all_executables(puppet_t) > @@ -267,6 +271,7 @@ allow puppetmaster_t puppet_etc_t:lnk_fi > allow puppetmaster_t puppet_log_t:dir setattr_dir_perms; > append_files_pattern(puppetmaster_t, puppet_log_t, puppet_log_t) > create_files_pattern(puppetmaster_t, puppet_log_t, puppet_log_t) > +read_files_pattern(puppetmaster_t, puppet_log_t, puppet_log_t) > setattr_files_pattern(puppetmaster_t, puppet_log_t, puppet_log_t) > logging_log_filetrans(puppetmaster_t, puppet_log_t, { file dir }) > > @@ -287,6 +292,7 @@ kernel_read_system_state(puppetmaster_t) > kernel_read_crypto_sysctls(puppetmaster_t) > kernel_read_kernel_sysctls(puppetmaster_t) > > +corecmd_bin_entry_type(puppetmaster_t) > corecmd_exec_bin(puppetmaster_t) > corecmd_exec_shell(puppetmaster_t) > > -- Chris PeBenito