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=-7.1 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,URIBL_BLOCKED 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 8BA97C43387 for ; Fri, 11 Jan 2019 15:31:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5CD3C20836 for ; Fri, 11 Jan 2019 15:31:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=tresys.onmicrosoft.com header.i=@tresys.onmicrosoft.com header.b="Q9kpi08x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732224AbfAKPbM (ORCPT ); Fri, 11 Jan 2019 10:31:12 -0500 Received: from mail-eopbgr700120.outbound.protection.outlook.com ([40.107.70.120]:34256 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731608AbfAKPbM (ORCPT ); Fri, 11 Jan 2019 10:31:12 -0500 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=5wPQiBPhZdPjf6PnBU/+6NXfcDzFej1IKwFl9Wrrbqc=; b=Q9kpi08x6y9CIIpu075Z3TLh8Ah//PNoE+w3YsNcw1o9GPWAN6XiR8dhalJrHAwRfblZhw1ylqwLEmUWzDt269+EZX9whO+9X5JnozNmpmFMy+st25Ug0UuF6s5oZXkJI1ubswXCeD4V4gUcIYoX3hG1XK47jMxt/uym2JnOSIg= Received: from BN6PR15MB1507.namprd15.prod.outlook.com (10.172.151.147) by BN6PR15MB1378.namprd15.prod.outlook.com (10.172.150.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.15; Fri, 11 Jan 2019 15:30:54 +0000 Received: from BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::6d82:5bd:50b3:6a10]) by BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::6d82:5bd:50b3:6a10%3]) with mapi id 15.20.1516.016; Fri, 11 Jan 2019 15:30:54 +0000 From: "Sugar, David" To: "selinux-refpolicy@vger.kernel.org" Subject: [PATCH 1/2] Interface with systemd_hostnamed over dbus to set hostname Thread-Topic: [PATCH 1/2] Interface with systemd_hostnamed over dbus to set hostname Thread-Index: AQHUqcKjjNVYpIAZ+0qQMqfx4rY9BA== Date: Fri, 11 Jan 2019 15:30:53 +0000 Message-ID: <20190111153011.27275-4-dsugar@tresys.com> References: <20190111153011.27275-1-dsugar@tresys.com> In-Reply-To: <20190111153011.27275-1-dsugar@tresys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [96.244.17.66] x-clientproxiedby: BN8PR12CA0034.namprd12.prod.outlook.com (2603:10b6:408:60::47) 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-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN6PR15MB1378;6:T6Gkl+gfkVST6uvPBSixu5obRxEnp+Dq7QKEH16bMlEga1XsAcvat9wttvZpmUbcBRbcQjovra7GrSA38g8bQHAusDCqj2LDnjTufZO7HFdVrgY+/1n5YHrRBlIctaI7Xlw5SxpvSP/PTD6QZdGo80Z3STRoUoGg4OR2ySvcvuhODxv0dtq91fROu9kXQBzMT/fNlpwVzzr9Ol1QpExxIxzCDyUsrgEnLCO1sCj5xDGLxOdC7Ou9L/F1HFM+OnrfI9NJS31wXhAVI1trn57aWSZe3jyo5KeU4CE8EBHrLpJGt8c8MTJpeCUukskQFIX0nAij58ynef0gaFynu38AallVeyuDQY/jXIoPoY4zd+PtVMgJWJjOiYIW+Ki87rqd/oMREHivCEDGiK5iIQD1ZvGhO2CFPixwafcmxvmOQViV0M0VnSkdX+NbT3akv2apnMpUV+dasKUMWdiCdZy1pA==;5:EOTjd1gc5O9J9/1yATUVber1J0KoTlnmxf18qJxNIaf8PjGmoMkkfhz2kJWFFfJyQk7OwN9bHx2hIJektGWdljGWQDv01e0mJ3QHHhOMVnDH4IZzf2O9tCRC7QqYPb1aKa9KoGezRVUWFfCR05Fg7Fk/Mxlg292Z8QoMM27qq0APJuz7awhKv0epf7gn8SmaU0AtG03PgNGzxc2/56H0hw==;7:2o2KKlx30hb7Gnwd1JHDG3CjGK8jh2pXEF168Wi/7bKRw5aAg+CLnXIgv4EZgvN6D7HcyI4rKK7KJquqc9lHIuRskjA8/xbJ+eSBH3yWMmcLQu8xOZKqMCWv4clJ5cda+8SJjN1tohaZiFLo2UfSgg== x-ms-office365-filtering-correlation-id: a4328030-080e-404e-b2d5-08d677d9c5a8 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600109)(711020)(2017052603328)(7153060)(7193020);SRVR:BN6PR15MB1378; x-ms-traffictypediagnostic: BN6PR15MB1378: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39830400003)(376002)(366004)(136003)(346002)(396003)(189003)(199004)(316002)(86362001)(14444005)(6916009)(36756003)(66066001)(256004)(97736004)(508600001)(99286004)(14454004)(5660300001)(71200400001)(71190400001)(105586002)(106356001)(2906002)(76176011)(551544002)(26005)(102836004)(2351001)(6506007)(386003)(53936002)(6512007)(6116002)(3846002)(7736002)(11346002)(52116002)(486006)(476003)(2616005)(8676002)(81156014)(8936002)(186003)(2501003)(446003)(6486002)(81166006)(5640700003)(6436002)(305945005)(68736007)(1076003)(25786009);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1378;H:BN6PR15MB1507.namprd15.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: V/eB2/ILucRvDmO7dVgLyhC5KdmACyJs4mMuDC4HiESa5PMI6NV/D/0FMUOpTY4pUsGVKegxFZEkDL84y0PkVogLnGIwXaeKm8a9LtTaYyhuH/ul8k69RqU/++FDqDvU7ObjR4Krfiux6QBSROW7olseClGT4eWS2/BVBe3FFBocfja3u7G+G0uDr2T76vTTgSg4FEV8seSu/AyoSzvEddVL22Yz6snfl+I9FmYWpHYs9wlB0iRnSvxpMqPR3lVP+T1yloUcyGB0vJfGSnrkiFpjNvJqJaIx0+BdFcctX6Cf3tt3X/uaUSw64VxO5ru35PjZOVqHlXJVsCyDR9EDTT4Z+KP4o5Ojeeq5bRTtIs0GWgGiv4XcOjjZVlqc5lN+/w7qnyjTcrXyKm3Q0lA5NeXjUDYoSr4v64/9ymrMJaE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: a4328030-080e-404e-b2d5-08d677d9c5a8 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 15:30:53.0882 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a0d45667-6c07-4e88-868f-4ac9af95c7ed X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1378 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org type=3DUSER_AVC msg=3Daudit(1547039052.040:558): pid=3D7159 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.hostname1 member=3DSetPrettyHostname dest=3Dorg.fre= edesktop.hostname1 spid=3D7563 tpid=3D7564 scontext=3Dsysadm_u:sysadm_r:app= lyconfig_t:s0-s0:c0.c1023 tcontext=3Dsystem_u:system_r:systemd_hostnamed_t:= s0 tclass=3Ddbus exe=3D"/usr/bin/dbus-daemon" sauid=3D81 hostname=3D? addr= =3D? terminal=3D?' type=3DUSER_AVC msg=3Daudit(1547039052.040:560): pid=3D7159 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.29 spid=3D7564 tpid=3D7563 scontext=3Dsystem_u:system_r:systemd_hos= tnamed_t:s0 tcontext=3Dsysadm_u:sysadm_r:applyconfig_t:s0-s0:c0.c1023 tclas= s=3Ddbus exe=3D"/usr/bin/dbus-daemon" sauid=3D81 hostname=3D? addr=3D? ter= minal=3D?' Signed-off-by: Dave Sugar --- policy/modules/system/systemd.if | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/policy/modules/system/systemd.if b/policy/modules/system/syste= md.if index 9c70afc9..740b3a92 100644 --- a/policy/modules/system/systemd.if +++ b/policy/modules/system/systemd.if @@ -268,6 +268,27 @@ interface(`systemd_read_machines',` allow $1 systemd_machined_var_run_t:file read_file_perms; ') =20 +######################################## +## +## Send and receive messages from +## systemd hostnamed over dbus. +## +## +## +## Domain allowed access. +## +## +# +interface(`systemd_dbus_chat_hostnamed',` + gen_require(` + type systemd_hostnamed_t; + class dbus send_msg; + ') + + allow $1 systemd_hostnamed_t:dbus send_msg; + allow systemd_hostnamed_t $1:dbus send_msg; +') + ######################################## ## ## allow systemd_passwd_agent to inherit fds --=20 2.20.1