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 79523C43387 for ; Tue, 15 Jan 2019 03:20:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4943A20645 for ; Tue, 15 Jan 2019 03:20:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=tresys.onmicrosoft.com header.i=@tresys.onmicrosoft.com header.b="hv7foxfV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727582AbfAODUe (ORCPT ); Mon, 14 Jan 2019 22:20:34 -0500 Received: from mail-eopbgr700096.outbound.protection.outlook.com ([40.107.70.96]:51280 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727439AbfAODUd (ORCPT ); Mon, 14 Jan 2019 22:20:33 -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=hv7foxfV/XA2ij4/kaFP/RnO1TlIqILnWtehByrZwhM0bkBUzbGD2pBb6Tktu5rSITFrQ1JZxG3cCCLbvcnxxPb/1N6w4UMbN+Om/xst6cNbEHCMAkhXSUTtQZqXgcORa0uyRyfNLKz8D4QDtZ6mUQ5Hy2Hk58GHIVG0O4Zrqh8= 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.1516.18; Tue, 15 Jan 2019 03:20:30 +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.019; Tue, 15 Jan 2019 03:20:30 +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: AQHUrIFDKCvGgQuOcUiS662caF6D7A== Date: Tue, 15 Jan 2019 03:20:28 +0000 Message-ID: <20190115032018.28662-2-dsugar@tresys.com> References: <20190115032018.28662-1-dsugar@tresys.com> In-Reply-To: <20190115032018.28662-1-dsugar@tresys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [73.180.141.176] x-clientproxiedby: BL0PR02CA0009.namprd02.prod.outlook.com (2603:10b6:207:3c::22) 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-microsoft-exchange-diagnostics: 1;BN6PR15MB1156;6:EGKe3w5nF8l+usZ9Wz1bAXzQSnx/2bg0ZvuXxaf/U7Q7iStUTvwiM4I6q9aV/93S5o4dUmFfbp2GgGMYkeAK/20PagNs5g92MPtuD/ekeAGUGEMF0OEMn5bSeMXqvZY2mYNKxIJTUMX9ffFDrLNtiLo6ysx0VjuUx8ZF+VIK4YEQrKMxxbQ7NEupv4blwW1Bk9fIEv802QzB7p5I2CQ4yk3C1H5W4hS5ZYH9rob3WR9WAWnMMhPjm2LRBhax9N2WdZXzpf3pzJeNVxQFyGW2hotXRNehPqHjyh3nGyjL79XB+YlyWEe4a+oO2YmrLYl1Recy0mKQR4pSKfwdt2Xr32IazzBbfD7R1+YECUqHXjU/qDlnedo3TZdbH5x9Xn6FG+yLNF6GRf7BWIKGHAXnTsBdmO6mWlt1rEc/H+qIR5V3lJo1ORjE/YHJSTljVfRnmzL5gr4o1JYaFHoFk3GGhg==;5:tHnrBhVzFbdk/eXNHW4M/e4fWPtg1ZnOFmJU2EiiFeO0xTHKqVsJDcd07Nb0Ql9H/IeUYehwj+h7y1n7pmCVDlIZAcLyVLyFqrjD/Ct2wzT1yPLzubKoIE+wGnbox/wXqlLtxIY4vYKcIv3HqL8QeMeRL+ZcTJT+ElNnQjQ5Bs8le0wpEDQysVWMGn3NLaiPzKGSKGnQcHsXJT5fxcF8hQ==;7:dxOEjShX+pLE72SF2UCZQbVOpnVbczlMm/cDkQFd0oUOIxqQtkSINOPi9ftobmDpUWHNBr9XIP8L59W8NfHoBAc3xmJsftcQ66vEDpYUkqO8cj7P6cOKteTdTIp42GotAZN8KAVWZEQD0GQjYHecgA== x-ms-office365-filtering-correlation-id: a9c0ef15-c132-410b-b90e-08d67a9865ef x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(7094020)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7027125)(7023125)(5600109)(711020)(2017052603328)(7153060)(7193020);SRVR:BN6PR15MB1156; x-ms-traffictypediagnostic: BN6PR15MB1156: x-microsoft-antispam-prvs: x-forefront-prvs: 0918748D70 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(189003)(199004)(86362001)(14454004)(256004)(508600001)(446003)(2501003)(6486002)(36756003)(486006)(66066001)(6436002)(5640700003)(14444005)(97736004)(11346002)(476003)(105586002)(2616005)(106356001)(2906002)(2351001)(99286004)(26005)(76176011)(52116002)(6116002)(25786009)(3846002)(7736002)(5660300001)(8936002)(6512007)(305945005)(102836004)(71200400001)(53936002)(81156014)(8676002)(50226002)(6916009)(81166006)(68736007)(6506007)(386003)(1076003)(71190400001)(186003);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1156;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: cn8W285oYljjG0be0XDESBuJP2yMSGrVgl0ldi5pBiw/irPZF0qupgiElVzxxi9PQd4/SjStZFqK/Wf3uWrmBzkAU32eZICx1Ldhf2GOaVAAZ2QhQll93oI+FzYBdg6cdsTv9+9zlmU91YJjzrlpBCQl5fLx0RAGYDYN2N4ZqUThsvhhy992c53W2YB5Lm8J7j9au9eSZ2+Id4kITRea8VNbrKcfZo0Vt57rBXxmlA9RTT3SahcYz4PcBfsnFCndCrhBszW6OyCZVPqFhBJ0hWiddwT2NA5IyW6LVVRH5Qkk5P8h679oT3wb2em1UKMc9d/GRZEmGbnOLyiIdNMn4yefT5oh2yh0wNBiiYBhpYDLA2gL1UuT/4brYioc+UZ52Ir8zh6mttwCsJ7j1XRdUCDXZNCCcRzgPPDNKd11Mvs= 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: a9c0ef15-c132-410b-b90e-08d67a9865ef X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2019 03:20:28.2710 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a0d45667-6c07-4e88-868f-4ac9af95c7ed 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(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