Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3588709ybv; Sun, 16 Feb 2020 00:54:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwuS9uAk1582Bs+skLdrJ8STD1kgj1BlESs2a4QHnU9MUUe5XIxkElMIB94g43SKm5eIIH2 X-Received: by 2002:aca:4c11:: with SMTP id z17mr6529183oia.104.1581843281068; Sun, 16 Feb 2020 00:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581843281; cv=none; d=google.com; s=arc-20160816; b=gMuVnmEZ0EpkdkAVXEN7m7QC2sY1DDjtujvjbOd2LVfNdYB2rlbviTVZ0WVbSDwytO HzJw2a503l4WoILt0TSpEW4Smv3iHA4jqo5ztKPLl2W98pY7ebof3CCXc3OIkWJaawQr 47rk1gpHu9NrKJmpU2FxT+WJayJkWPy5Be8eTk1cE0Nd2vqZFHBikUQwCta2nhp8kn5y 9E34dVo+gQd8JrCEzQzLKe4DxND+D/U/9D1golooNG30V8HrQ3DQqB7jvSMHA82rDUKy B4O8NyLWJvMszi9rOiEMoq/Oyf69jBoDqpv7lcn1GxsursT84ouzmvJZ3OzImHN2m8Bk Eh4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T0VRoEqT6iT/sHGn1L1dlyf5R7pB/I/r4hAwYlaMbwQ=; b=wj/oSHXueKcOuMXHBp4kPKnLrT0tIXP7etcOEDODvT/pykv8uFDTvUqrCFbxGvzwi/ AXPimHSMNYWB6FomGVTDElp1/sWbD95cyYMjaAx4Em7HnZngwmGiz+RIzbP30KcIEnpU OdkJwlIo27uFyO2ShYvxv/onwq/l3yPRY02w2XhCb2vw1RURrg1SC8r05VTOyGFVxXrD JrCwUt1Pnya4zukXektZb1zt5kDJdVLtOvV31FJg9Gr1surysTv1BF1K+1/Zyna+wfR1 y5knBgHkJXlZWJDoxEjjJPC+OtMsQYlXiBNgIGthRvaY1aLBRaOrFhyoseMlqIM8yKxj JoIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@perfinion-com.20150623.gappssmtp.com header.s=20150623 header.b=th4rFbS1; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y73si4846029oia.246.2020.02.16.00.54.38; Sun, 16 Feb 2020 00:54:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@perfinion-com.20150623.gappssmtp.com header.s=20150623 header.b=th4rFbS1; spf=pass (google.com: best guess record for domain of selinux-refpolicy-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=selinux-refpolicy-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726009AbgBPIyi (ORCPT + 13 others); Sun, 16 Feb 2020 03:54:38 -0500 Received: from mail-pg1-f172.google.com ([209.85.215.172]:34532 "EHLO mail-pg1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgBPIyi (ORCPT ); Sun, 16 Feb 2020 03:54:38 -0500 Received: by mail-pg1-f172.google.com with SMTP id j4so7448604pgi.1 for ; Sun, 16 Feb 2020 00:54:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perfinion-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T0VRoEqT6iT/sHGn1L1dlyf5R7pB/I/r4hAwYlaMbwQ=; b=th4rFbS1nm+VZI+ZxC8Hiq/Du32fNCt5dtU/82L/X9x8jfAFxEkqub5h8CgZ2Xxp6g Wmz2In6jyg+Qnnh/4pBsWD39ZFNppGBn8O83Wj7Co0HXbrwpfN4zgePAM8VOWO8T1LW6 TkqhtcOvZnHlzgI+03twPCPgsBTw9euOF31Wr13WB4uUSo2llwUdqZ/TdZS68LLGvdme Bp8tIGTqEm0Qq7xq4k/Ei5NTJlNcJ4/KL6zub66kk9+7q87DV3hB+Z1A11/X0HeLHczC D8VgpOjxPlpiZV0lie8vjgfWZ/RW6e8RdL7WYaFY2L9/U4oCqHIigXpvVpWCfDBbkCsm dbcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T0VRoEqT6iT/sHGn1L1dlyf5R7pB/I/r4hAwYlaMbwQ=; b=L3epjVmKCWzM7VDfZZ9g7lGAiLF3/US2eiVvWB1PuPfTMexUS12jTgkVmR55mqho2E avBoLIbWIlEJNF5004LE8y2VZ24pRtKvQcU+NMBzIWz5bWiJ4dQWMIwr38YSCU0QQore I/Y3GT8TVibxtw9VdCkqy+PKEwu18Q3wp7Hu94nkrmuyct1rYs0Uvd94tEy+uEtWJoD9 7zuzN58O8jVswKOOI1F+KjQLf00ZBLqxqPLE7zXU/utSHbrDvjrbskXpNlHsSlZZxQSS Rb2nSdmgTyu3ToGEuxYxdPZUdbG2oVAbXKA/e7K0zI3pXuzgAkd83ch7gPm7+SG9xlkZ FPvA== X-Gm-Message-State: APjAAAVO0vPR9743lXg372YF6iBhkvkfRy6ii5HLIi63MGpg6f6PEBHw L2YH9n3bNN5YG42q89yfsdW97A3uLdYENg== X-Received: by 2002:a63:f44d:: with SMTP id p13mr11873287pgk.224.1581843277636; Sun, 16 Feb 2020 00:54:37 -0800 (PST) Received: from localhost ([101.127.140.252]) by smtp.gmail.com with ESMTPSA id e26sm12770300pfl.59.2020.02.16.00.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Feb 2020 00:54:37 -0800 (PST) From: Jason Zaman To: selinux-refpolicy@vger.kernel.org Cc: Jason Zaman Subject: [PATCH 03/10] accountsd: Add watch perms Date: Sun, 16 Feb 2020 16:54:15 +0800 Message-Id: <20200216085422.36530-3-jason@perfinion.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200216085422.36530-1-jason@perfinion.com> References: <20200216085422.36530-1-jason@perfinion.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org From: Jason Zaman avc: denied { watch } for pid=7134 comm="gmain" path="/var/log" dev="zfs" ino=7092 scontext=system_u:system_r:accounts _t:s0-s0:c0.c1023 tcontext=system_u:object_r:var_log_t:s0 tclass=dir permissive=0 avc: denied { watch } for pid=7134 comm="gmain" path="/etc" dev="zfs" ino=1436 scontext=system_u:system_r:accountsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=dir permissive=0 --- policy/modules/services/accountsd.te | 2 ++ policy/modules/system/logging.if | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/policy/modules/services/accountsd.te b/policy/modules/services/accountsd.te index 9bf5962a..2e13e943 100644 --- a/policy/modules/services/accountsd.te +++ b/policy/modules/services/accountsd.te @@ -40,6 +40,7 @@ dev_read_sysfs(accountsd_t) files_read_mnt_files(accountsd_t) files_read_usr_files(accountsd_t) +files_watch_etc_dirs(accountsd_t) fs_getattr_xattr_fs(accountsd_t) fs_list_inotifyfs(accountsd_t) @@ -54,6 +55,7 @@ miscfiles_read_localization(accountsd_t) logging_list_logs(accountsd_t) logging_send_syslog_msg(accountsd_t) logging_set_loginuid(accountsd_t) +logging_watch_generic_logs_dir(accountsd_t) userdom_read_user_tmp_files(accountsd_t) userdom_read_user_home_content_files(accountsd_t) diff --git a/policy/modules/system/logging.if b/policy/modules/system/logging.if index 9c7a0dba..b2bba984 100644 --- a/policy/modules/system/logging.if +++ b/policy/modules/system/logging.if @@ -1224,6 +1224,24 @@ interface(`logging_manage_generic_logs',` manage_files_pattern($1, var_log_t, var_log_t) ') +######################################## +## +## Watch generic log dirs. +## +## +## +## Domain allowed access. +## +## +# +interface(`logging_watch_generic_logs_dir',` + gen_require(` + type var_log_t; + ') + + allow $1 var_log_t:dir watch; +') + ######################################## ## ## All of the rules required to administrate -- 2.24.1