Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3482666ybi; Tue, 2 Jul 2019 08:30:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVJ49sKIfw2vabnKo/QrzUsMUxmfm6nQjG4tggsPMDnsXtcxo23hBdxr28/lDkz51ydHzF X-Received: by 2002:a17:90a:9b88:: with SMTP id g8mr6331934pjp.100.1562081458562; Tue, 02 Jul 2019 08:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562081458; cv=none; d=google.com; s=arc-20160816; b=j2PN817BN1PwpkT0n33emhczBSXKEYYQi2hG7pAA6Ta8/nODVRkJIM1pfHw9YQj1QA o7462R4eOz+fH2QgS8AzsX7ErYT8JBOf1k/vgovOJ48r5sMJwE2+jKg9YTzqnKGp/56d rPnlHpsbj7u8zob0fLZx3goihK3T6/XPT6Z7+WSseUv6a+xyX3g5fYGe1wG3VqS2cwJf 1tDkaZC0WUUtlYBpNRLetJpn4Ah51HbUJD/H7xPyOgCLfDbc1xA1AK5xpO1fwsAB6O1V MR72XCzKA83FjGDo1XCwFnvBJUVgK5CMJ+6WLVq3WriU0EG3ddhioGq3Egq3837vDz2t YX/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:to:from:dkim-signature; bh=GRMoOgr2wqWYGLYCr0eJPTUi25+wBd86YeThlQVi5qI=; b=XIBzAmciVuxTQIXrkJOwgHrWtVwga9NPVOC9UCsipK9bkqnu8O33/mGletJFpP1wYF FNpT3Vwz0+DHXfGOSa4xj/WlIo9W2W/6BbdwREZSQAugy0bO8RxkDIZrfDEuOSUPJ9i6 BLhZsgQdfNNaiRDSHmfJJUl+G2RnNZ//NPmwqkAd2N0wYEkVDOIYtEzfL6KfFjWUwD+Z pqOZQEQS9zTiY64XUuQq21gxMV1XXnj10j6RX9Vo1h9dDtFj4EnDSGFZf6Pr/MqfzEHJ 4Y1upl49J2/How5313h2li6VfaIhRGqZlwhDqF+asEU5o2YArzk0snvuNht9SveiZyEh nSqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tresys.onmicrosoft.com header.s=selector2-tresys-onmicrosoft-com header.b=Esc98S36; 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 69si9099727pgc.40.2019.07.02.08.30.56; Tue, 02 Jul 2019 08:30:58 -0700 (PDT) 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=@tresys.onmicrosoft.com header.s=selector2-tresys-onmicrosoft-com header.b=Esc98S36; 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 S1726594AbfGBPa4 (ORCPT + 11 others); Tue, 2 Jul 2019 11:30:56 -0400 Received: from mail-eopbgr700116.outbound.protection.outlook.com ([40.107.70.116]:63562 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725972AbfGBPa4 (ORCPT ); Tue, 2 Jul 2019 11:30:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tresys.onmicrosoft.com; s=selector2-tresys-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GRMoOgr2wqWYGLYCr0eJPTUi25+wBd86YeThlQVi5qI=; b=Esc98S36DPrBlbI7k9jrTy8h0Wbu7vWvAVBBDVJdI6NwsWsPwqr/3tVobyy0V2Esc4Q8C6SAp+q+8WYK572Gf7wQug4mBxlPoeqIv4pPtqkAc7x/c/lzPh6b/oiwaXnl04LdGqXq4WUhCbzAdyJDkff1sPXksayZcvqEQvwUgdU= Received: from BN6PR15MB1507.namprd15.prod.outlook.com (10.172.151.147) by BN6PR15MB1170.namprd15.prod.outlook.com (10.172.206.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.18; Tue, 2 Jul 2019 15:30:32 +0000 Received: from BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::80fc:6403:1abc:cb23]) by BN6PR15MB1507.namprd15.prod.outlook.com ([fe80::80fc:6403:1abc:cb23%6]) with mapi id 15.20.2032.019; Tue, 2 Jul 2019 15:30:32 +0000 From: "Sugar, David" To: "selinux-refpolicy@vger.kernel.org" Subject: [PATCH 5/5] Allow rpm scripts to alter systemd services Thread-Topic: [PATCH 5/5] Allow rpm scripts to alter systemd services Thread-Index: AQHVMOsVIceslJNEDUixhcid9c1Deg== Date: Tue, 2 Jul 2019 15:30:31 +0000 Message-ID: <20190702153014.14097-6-dsugar@tresys.com> References: <20190702153014.14097-1-dsugar@tresys.com> In-Reply-To: <20190702153014.14097-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: BN8PR03CA0034.namprd03.prod.outlook.com (2603:10b6:408:94::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-mailer: git-send-email 2.21.0 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6c8a3fc6-997e-4f12-0bb5-08d6ff02380e x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:BN6PR15MB1170; x-ms-traffictypediagnostic: BN6PR15MB1170: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:346; x-forefront-prvs: 008663486A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(4636009)(136003)(376002)(39830400003)(346002)(396003)(366004)(189003)(199004)(2616005)(305945005)(446003)(86362001)(476003)(2906002)(486006)(11346002)(66476007)(66556008)(64756008)(66446008)(5660300002)(14454004)(186003)(76176011)(25786009)(102836004)(6116002)(3846002)(2501003)(26005)(316002)(6506007)(508600001)(50226002)(66946007)(1076003)(386003)(5640700003)(52116002)(256004)(8676002)(66066001)(6916009)(6486002)(99286004)(6436002)(53936002)(36756003)(6512007)(81166006)(2351001)(7736002)(81156014)(73956011)(8936002)(71200400001)(71190400001)(68736007)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR15MB1170;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: dnIDVGjhjUkMqCoNUfJS9jP3vxWVjUumiJWR1T7V4Wu8HYp0/Z7spMvjcEWYQ/z1BkFGUu6FbqgY08trG3yD/BansE0NBKVbO9uPyiv9RnJIg21+zU2tyMKr+wVWphdGB09lYcPrIK58KxBfLzCvzhLiJW+GScFC3J4FxFgMXY3Lc8SpwhA6LxzBqadTtsyvyqJrDI9hPUp1YFGaSBjM3OXWUP/I70kUFjPeXDgRnNJ+I1LnEcDWRfbWxyWkHj/wzveSUYMipUdJF5OT5CZJutKlh0SUuzDKpAkbrsbwPsTDCf1v+FbixgTR7gmLODx6wz5YpmrjqwmXFT10adH8vzbWKd+vpwZcgG2SS26nVV3ss/aqfMdLboIbz5obrGAwUqIYEooMKLSrJCvOKfCVC6Utg3c9tRRQUhIEOXDqpFM= 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: 6c8a3fc6-997e-4f12-0bb5-08d6ff02380e X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2019 15:30:31.9039 (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-CrossTenant-userprincipalname: dsugar@tresys.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR15MB1170 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org In RPM scripts it is common to enable/start services that are being installed. This allows rpm_script_t to manage sysemd units type=3DUSER_AVC msg=3Daudit(1561033935.758:283): pid=3D1 uid=3D0 auid=3D429= 4967295 ses=3D4294967295 subj=3Dsystem_u:system_r:init_t:s0 msg=3D'avc: de= nied { enable } for auid=3Dn/a uid=3D0 gid=3D0 path=3D"/usr/lib/systemd/sy= stem/ntpdate.service" cmdline=3D"systemctl preset ntpdate.service" scontext= =3Dsystem_u:system_r:rpm_script_t:s0 tcontext=3Dsystem_u:object_r:ntpd_unit= _t:s0 tclass=3Dservice exe=3D"/usr/lib/systemd/systemd" sauid=3D0 hostname= =3D? addr=3D? terminal=3D?' type=3DUSER_AVC msg=3Daudit(1561033935.837:286): pid=3D1 uid=3D0 auid=3D429= 4967295 ses=3D4294967295 subj=3Dsystem_u:system_r:init_t:s0 msg=3D'avc: de= nied { enable } for auid=3Dn/a uid=3D0 gid=3D0 path=3D"/usr/lib/systemd/sy= stem/ntpd.service" cmdline=3D"systemctl preset ntpd.service" scontext=3Dsys= tem_u:system_r:rpm_script_t:s0 tcontext=3Dsystem_u:object_r:ntpd_unit_t:s0 = tclass=3Dservice exe=3D"/usr/lib/systemd/systemd" sauid=3D0 hostname=3D? ad= dr=3D? terminal=3D?' type=3DUSER_AVC msg=3Daudit(1561059114.937:239): pid=3D1 uid=3D0 auid=3D429= 4967295 ses=3D4294967295 subj=3Dsystem_u:system_r:init_t:s0 msg=3D'avc: de= nied { reload } for auid=3Dn/a uid=3D0 gid=3D0 cmdline=3D"systemctl preset= ntpdate.service" scontext=3Dsystem_u:system_r:rpm_script_t:s0 tcontext=3Ds= ystem_u:system_r:init_t:s0 tclass=3Dsystem exe=3D"/usr/lib/systemd/systemd"= sauid=3D0 hostname=3D? addr=3D? terminal=3D?' Signed-off-by: Dave Sugar --- policy/modules/admin/rpm.te | 2 ++ 1 file changed, 2 insertions(+) diff --git a/policy/modules/admin/rpm.te b/policy/modules/admin/rpm.te index 111fcb01..c572c741 100644 --- a/policy/modules/admin/rpm.te +++ b/policy/modules/admin/rpm.te @@ -345,6 +345,8 @@ auth_dontaudit_getattr_shadow(rpm_script_t) auth_use_nsswitch(rpm_script_t) =20 init_domtrans_script(rpm_script_t) +init_manage_all_units(rpm_script_t) +init_reload(rpm_script_t) init_telinit(rpm_script_t) =20 libs_exec_ld_so(rpm_script_t) --=20 2.21.0