Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3310645rdg; Tue, 17 Oct 2023 10:29:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9hvLteZC/MeSDa6Ccv6XFj4J3OkoU8BQsKh0KsWpP2BNjECZphtY29YAKmHgGCK1Pwhu9 X-Received: by 2002:a05:6a21:a101:b0:171:8e16:ea86 with SMTP id aq1-20020a056a21a10100b001718e16ea86mr2389432pzc.31.1697563772784; Tue, 17 Oct 2023 10:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697563772; cv=none; d=google.com; s=arc-20160816; b=j9jkvRS9WdRN3xUzfrUP/6mtv3QWw3yZmBeHZWNlpzyRHWKsl5xO+XjtEVSxh+PVLJ GnWUl7TUZgUNumnrlqVoVSpSEjchUi04K7+LSMpSoAeAetyJnI1WmM8ZArNOE1sBZfe5 7/CwkQiGSIIlI64BoWejxa1gwVgFC1VQsI6nTlqCPffuyFpmzoK3CqBAf65OZRuczs3C cIDA2v0zT2LcQSaqS7Ac/Y6P46ZrGFri5Cyx46ZXbRKdK7BeWUfYS9fzyrNr4wljup3L Au4Xpj4JQnDg2q87k25Qqx4i2YfasPuqfxnJ5+rnYIVgwA4FgMGDb8lFxHI8n8sB93ZC nLFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=w1ro9HlJSCZOnQY3V+1VmfmbVpDBOi+uN5Fq4ETuRqg=; fh=Fa1ZJv3pgmPDwi64qg2xppUSiR+75UeKgpMOFRYTr+A=; b=Bo0gNo65vyUSUG/ArIH/dBekJ1vyfTT9er+iN6KAEP17OOIoN3hRqISHxHjdkHvkcQ hwNpQKGHW67VT2bN2dkRI66rEC2tgyBJANWsKjNTHgf9Uo0WXkf8kgKydhX6BYfksmtr Tl05eScQy5DN3Fh4Ec/7SK35NOvye1z8jRviKN59hgr+N44XZKTBuXJTZgloqIkMxkuW OsT1/emhfTslgkvmItqfnP7CPRRHeaFHjgO3lK85DbWpsoDWKtuNbm2uUPQn1RgV1Irv XMZxvUFIsdojdTnO3BfGfMU1XQOdjgNHCl4A50PDDbc9lQMYYgHIF3Giaf77JAtQdXrB MLuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=deAuIb4p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id i68-20020a639d47000000b005783367f97fsi201927pgd.342.2023.10.17.10.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 10:29:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=deAuIb4p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=paul-moore.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D99D2803B350; Tue, 17 Oct 2023 10:29:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343979AbjJQR3X (ORCPT + 99 others); Tue, 17 Oct 2023 13:29:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234760AbjJQR3W (ORCPT ); Tue, 17 Oct 2023 13:29:22 -0400 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C1B3113 for ; Tue, 17 Oct 2023 10:29:19 -0700 (PDT) Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-d9ac31cb051so6395496276.3 for ; Tue, 17 Oct 2023 10:29:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1697563758; x=1698168558; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=w1ro9HlJSCZOnQY3V+1VmfmbVpDBOi+uN5Fq4ETuRqg=; b=deAuIb4pEhjm6eBPy09V3tBAICS79bZ60HcDl2EaptWgOX65CHSTtunZZBxZywbUxc 7f/LQE141m184U03smIc9cArPvIvNYDioVqhTS+gfnVqBeUF9afNOp16zXYcDEeWe5vr EqdXfpM6LQWgrJhH0Tsl67FUAhZp26IVs6T3bMgKMU8V6wv9YGhB+rL36JPgLuYVYq73 petuYj48JGDAZMHz/6hXb4+5JgL7/m6oIlqO+QeoJrBUGJc4CMSPtDfyqOV6p62xxonx Iy7WCVQP07odKbIUI/GZKYzITHpkahyoCLxVvrjmQaxVKPWlBdM1IUcYIn/TbocVdrFe Gd+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697563758; x=1698168558; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w1ro9HlJSCZOnQY3V+1VmfmbVpDBOi+uN5Fq4ETuRqg=; b=Y5iqc29pjj/JI8VF+aA7UAEEoVbX09o7hKwcuXa+3mEiBY2VldElTyotW6YsfOjh+n HhwCcYv28i8IjKgSpJdK8+OQyec7GBb85y9DDfNARPsSRgWYPunKgVLo/LY9G6vase3V SuY+qBZlQN3CmvIiX0tSswmxseC3U+6D66BtFFk7UyjHKX6KvdEfKiTTlrHJPwQA/M0n cJvL2+4qYahh3X4bA3aQ4uY9J1e+VRbXaRAKPEcR/uvoDh6WIk0x7iLQVWvZExsz4jAB UxjWIWR8WG6yPAkSW1WzZvqL5YGHHUoMuw27Cdr4hopEVKxg6SjSgRPxnp0hq48a/ald 9mbQ== X-Gm-Message-State: AOJu0Yx1xdgafUK0kNiMQLysWuzrrqQgcM6CnG43JMhQLe3uvCXkPxeL FCRY9NMRmGnzN49seo+1Eef19OTnW4vmULWbMthq X-Received: by 2002:a25:2383:0:b0:d9a:3bbb:8602 with SMTP id j125-20020a252383000000b00d9a3bbb8602mr2572828ybj.64.1697563757988; Tue, 17 Oct 2023 10:29:17 -0700 (PDT) MIME-Version: 1.0 References: <932231F5-8050-4436-84B8-D7708DC43845@oracle.com> <7335a4587233626a39ce9bc8a969957d7f43a34c.camel@linux.ibm.com> <1149b6dbfdaabef3e48dc2852cc76aa11a6dd6b0.camel@linux.ibm.com> <4A0505D0-2933-43BD-BEEA-94350BB22AE7@oracle.com> <20230913.Ceifae7ievei@digikod.net> <20230914.shah5al9Kaib@digikod.net> <20231005.dajohf2peiBu@digikod.net> In-Reply-To: From: Paul Moore Date: Tue, 17 Oct 2023 13:29:07 -0400 Message-ID: Subject: Re: RFC: New LSM to control usage of x509 certificates To: Mimi Zohar Cc: =?UTF-8?B?TWlja2HDq2wgU2FsYcO8bg==?= , Eric Snowberg , "Serge E. Hallyn" , Jarkko Sakkinen , David Howells , David Woodhouse , Kanth Ghatraju , Konrad Wilk , "linux-integrity@vger.kernel.org" , "keyrings@vger.kernel.org" , open list , linux-security-module@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 17 Oct 2023 10:29:29 -0700 (PDT) On Tue, Oct 17, 2023 at 1:09=E2=80=AFPM Mimi Zohar wr= ote: > On Tue, 2023-10-17 at 11:45 -0400, Paul Moore wrote: > > On Tue, Oct 17, 2023 at 9:48=E2=80=AFAM Mimi Zohar wrote: > > > On Thu, 2023-10-05 at 12:32 +0200, Micka=C3=ABl Sala=C3=BCn wrote: > > > > > > > A complementary approach would be to create an > > > > > > > LSM (or a dedicated interface) to tie certificate properties = to a set of > > > > > > > kernel usages, while still letting users configure these cons= traints. > > > > > > > > > > > > That is an interesting idea. Would the other security maintain= ers be in > > > > > > support of such an approach? Would a LSM be the correct interf= ace? > > > > > > Some of the recent work I have done with introducing key usage = and CA > > > > > > enforcement is difficult for a distro to pick up, since these c= hanges can be > > > > > > viewed as a regression. Each end-user has different signing pr= ocedures > > > > > > and policies, so making something work for everyone is difficul= t. Letting the > > > > > > user configure these constraints would solve this problem. > > > > > > Something definitely needs to be done about controlling the usage of > > > x509 certificates. My concern is the level of granularity. Would th= is > > > be at the LSM hook level or even finer granaularity? > > > > You lost me, what do you mean by finer granularity than a LSM-based > > access control? Can you give an existing example in the Linux kernel > > of access control granularity that is finer grained than what is > > provided by the LSMs? > > The current x509 certificate access control granularity is at the > keyring level. Any key on the keyring may be used to verify a > signature. Finer granularity could associate a set of certificates on > a particular keyring with an LSM hook - kernel modules, BPRM, kexec, > firmware, etc. Even finer granularity could somehow limit a key's > signature verification to files in particular software package(s) for > example. > > Perhaps Micka=C3=ABl and Eric were thinking about a new LSM to control us= age > of x509 certificates from a totally different perspective. I'd like to > hear what they're thinking. > > I hope this addressed your questions. Okay, so you were talking about finer granularity when compared to the *current* LSM keyring hooks. Gotcha. If we need additional, or modified, hooks that shouldn't be a problem. Although I'm guessing the answer is going to be moving towards purpose/operation specific keyrings which might fit in well with the current keyring level controls. --=20 paul-moore.com