Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A3F4C43381 for ; Wed, 20 Mar 2019 00:20:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6DD520828 for ; Wed, 20 Mar 2019 00:20:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=tresys.onmicrosoft.com header.i=@tresys.onmicrosoft.com header.b="EeDlt3t9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727433AbfCTAUh (ORCPT ); Tue, 19 Mar 2019 20:20:37 -0400 Received: from mail-eopbgr770110.outbound.protection.outlook.com ([40.107.77.110]:53831 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726891AbfCTAUh (ORCPT ); Tue, 19 Mar 2019 20:20:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tresys.onmicrosoft.com; s=selector1-tresys-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IccvKBCfB2Ez122xtbc3vzoN9M9Txp3Z2QuaFwbzCr4=; b=EeDlt3t9MZldfTAAcq3Jzdx/KvnTUv76GB4KNXWMqg1yCrmFIrj78+1kL+dqVd8Iivqrovltnv61Ui3cbgDsARmPz/SOAZNVgxv6sKbuZKSkwbzTC+sezgQ8b4Ify1D+AbOkJoHW+C3VtzOkBMA0370BP/dDTz+0ri4zsAwO6JM= Received: from BN6PR15MB1507.namprd15.prod.outlook.com (10.172.151.147) by BN6PR15MB1156.namprd15.prod.outlook.com (10.172.205.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Wed, 20 Mar 2019 00:20:34 +0000 Received: from BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::ec41:1dc7:5fd4:a07a]) by BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::ec41:1dc7:5fd4:a07a%8]) with mapi id 15.20.1709.015; Wed, 20 Mar 2019 00:20:34 +0000 From: "Sugar, David" To: "selinux-refpolicy@vger.kernel.org" Subject: [PATCH 1/4] Add interface ntp_dbus_chat Thread-Topic: [PATCH 1/4] Add interface ntp_dbus_chat Thread-Index: AQHU3rK7zGAEiqwTIkO63dCbuKsOSA== Date: Wed, 20 Mar 2019 00:20:33 +0000 Message-ID: <20190320002012.21220-2-dsugar@tresys.com> References: <20190320002012.21220-1-dsugar@tresys.com> In-Reply-To: <20190320002012.21220-1-dsugar@tresys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2601:154:c201:cca:6e88:14ff:fed4:292c] x-clientproxiedby: BL0PR03CA0002.namprd03.prod.outlook.com (2603:10b6:208:2d::15) To BN6PR15MB1507.namprd15.prod.outlook.com (2603:10b6:404:c6::19) authentication-results: spf=none (sender IP is ) smtp.mailfrom=dsugar@tresys.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5c8c6dcb-62d8-4e3e-b24b-08d6acc9ddff x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020);SRVR:BN6PR15MB1156; x-ms-traffictypediagnostic: BN6PR15MB1156: x-microsoft-antispam-prvs: x-forefront-prvs: 098291215C x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(136003)(376002)(39840400004)(346002)(396003)(199004)(189003)(486006)(46003)(446003)(508600001)(305945005)(102836004)(6506007)(76176011)(6916009)(106356001)(386003)(105586002)(7736002)(99286004)(52116002)(2616005)(476003)(11346002)(186003)(2501003)(2906002)(36756003)(14454004)(6512007)(6486002)(53936002)(81156014)(5640700003)(97736004)(86362001)(81166006)(316002)(6436002)(6116002)(1076003)(50226002)(5660300002)(68736007)(14444005)(2351001)(256004)(25786009)(71190400001)(71200400001)(8936002)(8676002);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1156;H:BN6PR15MB1507.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: tresys.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: sK4VnY7tMPwEGC6sjO5/VuZiqnws0FZkt6HBxDQnl3FQWhNbuZ1R6gS5g46VuzG6XtiBgl4k4cmlh0xzTd/v38017ET8d2/xf7Gmz8hbK0RIESkRQkX/JapZcgjz2nfObNbvaqQ9aOZUD+9YcqjS3pUnDahU8uBd0rpR5LMV/UdKWhN43SIHm229IqawzfG6Hsu19Tk16JSZ/7Ff2ocxAvo1LTVuZAp4gsv9mOHTYHa29Ha/Hf9vkfjz1unaPwI4VynAfJ+g162fgjpibKSwvW53cgD58X0UNWvosu7sKwCZDGW827sjT9IR8Vbnf18xpLHs6jcOiuujBZRrH/h0cIkMPXo1HSlMpo2fZxKZrlsuwd+8X0AsILuLDCh35/NbA4ZVXbCLyXX1sdeNTTrS+ugBgQzND0CWBd1oOOz1RLk= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: tresys.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c8c6dcb-62d8-4e3e-b24b-08d6acc9ddff X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2019 00:20:33.6823 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a0d45667-6c07-4e88-868f-4ac9af95c7ed X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1156 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org type=3DUSER_AVC msg=3Daudit(1553013821.622:9900): pid=3D7377 uid=3D81 auid= =3D4294967295 ses=3D4294967295 subj=3Dsystem_u:system_r:system_dbusd_t:s0-s= 0:c0.c1023 msg=3D'avc: denied { send_msg } for msgtype=3Dmethod_call inte= rface=3Dorg.freedesktop.timedate1 member=3DSetTimezone dest=3Dorg.freedeskt= op.timedate1 spid=3D16280 tpid=3D16281 scontext=3Dsysadm_u:sysadm_r:setting= s_t:s0-s0:c0.c1023 tcontext=3Dsystem_u:system_r:ntpd_t:s0 tclass=3Ddbus ex= e=3D"/usr/bin/dbus-daemon" sauid=3D81 hostname=3D? addr=3D? terminal=3D?' type=3DUSER_AVC msg=3Daudit(1553013821.625:9911): pid=3D7377 uid=3D81 auid= =3D4294967295 ses=3D4294967295 subj=3Dsystem_u:system_r:system_dbusd_t:s0-s= 0:c0.c1023 msg=3D'avc: denied { send_msg } for msgtype=3Dmethod_return de= st=3D:1.258 spid=3D16281 tpid=3D16280 scontext=3Dsystem_u:system_r:ntpd_t:s= 0 tcontext=3Dsysadm_u:sysadm_r:settings_t:s0-s0:c0.c1023 tclass=3Ddbus exe= =3D"/usr/bin/dbus-daemon" sauid=3D81 hostname=3D? addr=3D? terminal=3D?' Signed-off-by: Dave Sugar --- policy/modules/services/ntp.if | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/policy/modules/services/ntp.if b/policy/modules/services/ntp.i= f index f1a90c55..7fa20c8d 100644 --- a/policy/modules/services/ntp.if +++ b/policy/modules/services/ntp.if @@ -79,6 +79,27 @@ interface(`ntp_run',` roleattribute $2 ntpd_roles; ') =20 +######################################## +## +## Send and receive messages from +## ntpd over dbus. +## +## +## +## Domain allowed access. +## +## +# +interface(`ntp_dbus_chat',` + gen_require(` + type ntpd_t; + class dbus send_msg; + ') + + allow $1 ntpd_t:dbus send_msg; + allow ntpd_t $1:dbus send_msg; +') + ######################################## ## ## Execute ntpdate server in the ntpd domain. --=20 2.20.1