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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 5DBB0C43387 for ; Sun, 23 Dec 2018 10:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 242FF2176F for ; Sun, 23 Dec 2018 10:53:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YxGpttc4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727916AbeLWKxg (ORCPT ); Sun, 23 Dec 2018 05:53:36 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:39754 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbeLWKxg (ORCPT ); Sun, 23 Dec 2018 05:53:36 -0500 Received: by mail-ed1-f67.google.com with SMTP id b14so8194250edt.6 for ; Sun, 23 Dec 2018 02:53:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=MFZy7yPiQmHAPTBCSNp/Viz8ic/5MN49xqyQIdzRphE=; b=YxGpttc4EOVVQylGNsEHfePPyPni62taWOcCbG77KUI+T2DMdWhHkDbW1Uaoq5d1D0 3btYf2JN3flLuUUSz5e+21gMhe+bvVfEKMGEi6fpwmBd2mUATqN79nXQDxEqhvEdi1ts 8GEYe0fZiVFJb/Vsc6d6udc3d303I5zMyuL6pJwIu8nuWH+OlDQBi6et38b9HUOL1Bc0 wlZmRHEU38YO8L4YWYGspYnk1goPIEfiRSyqqdVrCkaC1L0anClhpTkktB4GjkllvbJj bivy2ks7pkuzEMdQjWSVQBRDCZIxiam+sEHz+iydJ3vPJqeGOVLky2r5TceSloIn0Cs0 0ppw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=MFZy7yPiQmHAPTBCSNp/Viz8ic/5MN49xqyQIdzRphE=; b=MOa/IwZnDrIl2CckvTz+VfXEFlDtQ+tt70XJb06T7suX/XvSIN5S7CvWqqBgMm7Y1o KVoB8sVKV4Fej5Bnvcd22a8gRYS0nSgilIWH+JL7Y7a71a385O7CXJa2v6SM5BFntEfY Wo/bk4N4AYgssDanvwy65XYakeX+6KIr6IQu/OTerJGf2B8DNmRvkMXqRqb+b2J8pXFe ap+RWSILwqtM20bsHwS4RvfeqyqcrigrmNgCBYfMVMgcHXLtYCG0dx6vtfoah/MrC65n oddCf/pPx5qV782El+f6JUztbUselfRlYzefcbJnvWN3W9x6GmCjLpKZDyiT6qVNEvWZ QPXg== X-Gm-Message-State: AA+aEWbVQjO40M23w4FrL/ewU/NafyxED5ryL/9xIAicIEljfFr5UmOV bPRicTcAIf65UFFdpEJESFI= X-Google-Smtp-Source: AFSGD/UFvoWlGkNwhTnRO+wIp+9lWia9MQ20OU98LZQKlkD7eQGrgpequLomh5k22setmvoIohCv4Q== X-Received: by 2002:a50:8262:: with SMTP id 89mr7170993edf.125.1545562011568; Sun, 23 Dec 2018 02:46:51 -0800 (PST) Received: from brutus.lan ([2001:985:d55d::438]) by smtp.gmail.com with ESMTPSA id z40sm8198367edz.86.2018.12.23.02.46.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Dec 2018 02:46:50 -0800 (PST) Date: Sun, 23 Dec 2018 11:46:48 +0100 From: Dominick Grift To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" Subject: Re: [PATCH 2/2] pam_faillock creates files in /run/faillock Message-ID: <20181223104648.GB20992@brutus.lan> Mail-Followup-To: "Sugar, David" , "selinux-refpolicy@vger.kernel.org" References: <20181221014026.2867-1-dsugar@tresys.com> <20181221014026.2867-2-dsugar@tresys.com> <20181221103416.GA4520@brutus.lan> <2d2d6c7f-3084-d6f6-ce1b-42c9d9535969@tresys.com> <20181223102000.GA20992@brutus.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rS8CxjVDS/+yyDmU" Content-Disposition: inline In-Reply-To: <20181223102000.GA20992@brutus.lan> User-Agent: Every email client sucks, this one just sucks less. X-PGP-Key: https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Sender: selinux-refpolicy-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux-refpolicy@vger.kernel.org --rS8CxjVDS/+yyDmU Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 23, 2018 at 11:20:00AM +0100, Dominick Grift wrote: > On Sat, Dec 22, 2018 at 02:58:41AM +0000, Sugar, David wrote: > >=20 > > On 12/21/18 5:34 AM, Dominick Grift wrote: > > > On Fri, Dec 21, 2018 at 01:41:25AM +0000, David Sugar wrote: > > >> These are changes needed when pam_fallock created files in /run/fail= lock > > >> (which is labeled faillog_t). sudo and xdm (and probably other doma= ins) > > >> will create files in this directory for successful and failed logins > > >> attempts. > > > The pam stuff has become a bit broken in my view. > > > > > > We use to use auth_use_pam() for these kinds of things but the interf= ace was forgotten and not updated properly. > > > > > > So for example sudo does not even call auth_use_pam() and a lot of st= uff was added directly to the login_pgm domain that should have been added = to auth_use_pam() instead. > > > > > > My opinion is that this belongs in auth_use_pam() > >=20 > > Dominick, > >=20 > > I see those interfaces.=A0 It looks like xdm_t already uses=20 > > auth_login_pgm_domain(xdm_t).=A0 It also isn't really clear to me what = the=20 > > difference is between auth_login_pgm_domain() and auth_use_pam().=A0 I= =20 > > will make updates moving my change into auth_use_pam() and also update= =20 > > sudo_role_template() to use (I think) auth_login_pgm_domain (). >=20 > sudo is not an auth_login_pgm_domain() i believe >=20 > the auth_use_pam() is a subset of auth_login_pgm_domain() >=20 > so login_pgm domains are pam clients plus extras needed to log in users >=20 > a auth_use_pam() (pam client) has a pam stack but it might not actually d= o logins >=20 > sudo uses pam but its not a real login program, so afaik sudo should call= auth_use_pam() > xdm is a login_pgm, so is sshd etc >=20 > systemd is also a pam client, but not a login program And yes systemd needs to be able to create these /run/faillock/USER files a= s well, but if you test this on RHEL then you wont see it because RHEL doesnt use /etc/pam.d/systemd-user (i suppose) so: 1. auth_use_pam() =3D=3D "pam clients" (programs that have a file in /etc/p= am.d), they use pam for authentication of some sort 2, auth_login_pgm_domain() =3D=3D superset (special pam clients that need p= ermissions to do actual logins) >=20 > >=20 > > I will resubmit this patch, > >=20 > > --- snip --- >=20 > --=20 > Key fingerprint =3D 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 > https://sks-keyservers.net/pks/lookup?op=3Dget&search=3D0x3B6C5F1D2C7B6B02 > Dominick Grift --=20 Key fingerprint =3D 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=3Dget&search=3D0x3B6C5F1D2C7B6B02 Dominick Grift --rS8CxjVDS/+yyDmU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCAAdFiEEujmXliIBLFTc2Y4AJXSOVTf5R2kFAlwfZ5QACgkQJXSOVTf5 R2m3sAv/SJ7rc0yh+0AxGjEp9TUiLM2lgfFa3gIV7nw8X6M8NKy7T/+35uJC6i+U X7fRUgSaSc7N+ag18NvpHhUoaqyPaIIHTi69gig9ri9EziEGtnZM8RhK+gMrNxAP Rs7ELshUDclr6lXEFXJaWvF0jv9CQT8lnpAndVvpwfVKzCNzcpBdO/pN52CmPrrP J+eA+y4n2cV/rWtjECILpjUGpkuDmfIhPiLPgrWC9Dz0r/CjOk8IQjFE60jxwb0Z 8G47u5lyFqVOzeVbqAG71d4HWJCmKz7xSxyC5iNHXrq0ED0Q8HRWM1/MCpuCHNzJ pPYzeSZnbvlGSUHbG2Occ7PuRawFBxz0ypWYOzNHv62gC5jz8jvgmqqZgwu928+r FSdfTBi+Jp+RZmfbHD+9i9lrZTojZTuwaM0j7f2KVNcovDsdrQZFaBsgEIx8aoYe 3iCfPtO56CDN8vTba0SvCgYEkrWiZIxqB3JHcyTiSbct22K9fpmjvymRhHMd319v iC5RMUb2 =j5ep -----END PGP SIGNATURE----- --rS8CxjVDS/+yyDmU--