Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3351690rdg; Tue, 17 Oct 2023 11:51:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrMBcxAc6kIkOsCfyvi1ibb9e4tbY3E0Rnrbfd5REaQmzN4agaMikLovlL7Hdf/QJGRlfU X-Received: by 2002:a05:6808:211e:b0:3ae:1298:257a with SMTP id r30-20020a056808211e00b003ae1298257amr4269264oiw.1.1697568695691; Tue, 17 Oct 2023 11:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697568695; cv=none; d=google.com; s=arc-20160816; b=alLiYn0i05zbkuGBye1gpSfsxu/A2hKHoH7yrGQ/ETRzc9YYx43lzF2OF/WcbDKQAI EDg6gG8y5nXaOdniy883Zky/JLWH8Wr/toKfeqgvL0EqzFnd6RkUTJO4HihPNg6QGHK3 3vPekY/R6ApLLqKUqC20BEq5K6wIkCJ17KjtcV5VgXlJMMM5Gpt+8PmazqnYNUT3FMkW QgLPnCl9rR4UZTUBcF0lFaBtC2h9BjdYwMpdm5Q2dwcCob91uO3cr2GiyGsqu/JzK3Xc Vg/ASdv0iUT5skNVmLDK8+x/6CPv87ORPrsULQt+JD+gDP1RR1yy6pz2z0JIIBGrlxRT RL4Q== 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=1j8E84ykBKtkhB7y9PxztHZ9P/6cyMaN8QtwhDRi5Po=; fh=Fa1ZJv3pgmPDwi64qg2xppUSiR+75UeKgpMOFRYTr+A=; b=B9euKiDpGXA8uFwAfpR+A0EUlX1+HG83MUSRDh2HE9arfY+stbJLkIWUG5I8l8INcG N1q+n0JCmkoED7fTRoHmlMiJ0vs6/Xt5YssTXLxMp3T75JwDYdFEGplJCI6i7/m+J5rt jY+r24JWsSjyUKCY3qvX/0uh6caa3zAp1Uk6KkkWWSSqjM57GaK1TokA2b+jJoxp4EiY /EBrruLaXy2qU/4U9UvMKZOWIZE1czUu7xKQJPQHdAmuwKTb2vEiOkbT/PvZpzKNW5LV C0VLXDwiyjqZYdQbdraHAvnyOZSujt2xsJLG4c/J12tSkX83cgVOKDitrzOkAcIvVQg+ 07qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=Y8Vl8DBa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id cb15-20020a056a02070f00b00578ac88e239si407482pgb.595.2023.10.17.11.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 11:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@paul-moore.com header.s=google header.b=Y8Vl8DBa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 66F32807FCDA; Tue, 17 Oct 2023 11:51:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234843AbjJQSv0 (ORCPT + 99 others); Tue, 17 Oct 2023 14:51:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234966AbjJQSvZ (ORCPT ); Tue, 17 Oct 2023 14:51:25 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9270BF1 for ; Tue, 17 Oct 2023 11:51:23 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-d9beb865a40so2640915276.1 for ; Tue, 17 Oct 2023 11:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paul-moore.com; s=google; t=1697568683; x=1698173483; 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=1j8E84ykBKtkhB7y9PxztHZ9P/6cyMaN8QtwhDRi5Po=; b=Y8Vl8DBaBNtjAOCM/MWDthg+L23DOuja9vDD8qMSZIdJSiuW7hI3Cz+i6pm1Ro754A 1WPxRO0aENo/HuQ9fM+/p14MsczUyUPMlHI7lG/ZTAcEMeJ4oMqOX1lF+sV16FnMN3JJ E+t8QbD+hpNknxjKCJDEesOvG5/zZt++RpLDUewHREFhC8xUqBMBoUBI/ZWiIORXmvz4 3G4RhFBa7nyrOczCsOLhOtNlGg8JNfRXcXjPI1QceMSBQ8jOseQIWscUUnFaLJ1HhqcR /5b254BSkoZ9ue8zbgXKizPqhvaY0ho2fBEfwFjO5s5xCDEcTRYNrcmQQmwBPz0+5Svm llyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697568683; x=1698173483; 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=1j8E84ykBKtkhB7y9PxztHZ9P/6cyMaN8QtwhDRi5Po=; b=LSWUwNjq7ad1otHYIJW1VPr+BFUBCcjG2oqgWzvLzIonGqpTfzUzqjSYnuzVqo18WJ iRfxD3ug3hGMogr4BTLINU4Jao2oIyHXU3RYUQV8uHxb/Vgjx91qZOCy1t7E1bTypGUc nd2ogXTpyXOOdq1E0L1URPdyPcWJWd9KxkhJbA1hRQICbTjOKHDe3Z16E8zcqV7tYatG YFk04Qoirdf/ePG2Y2nmCAOA1EJ11AL2Z4/FtJ2x0Q7y3MzBsHNcEyFHfcUpZBFcxUt6 PG55usGESiGCjOgPxbRUQ6+n6brh0XU6A5z6Sq6MNN4+0ppOEsRjZY6UYAMWZqmYhEqm AprA== X-Gm-Message-State: AOJu0YwaMOUCEv6PCpg4jh998v2Ucag87R8IXz4qC+Y+/VZRlA4FDJ91 ck+tKpOJs7ddk8D/8Y1QHcfEkX7j54z98/jQkQl+ X-Received: by 2002:a25:50d:0:b0:d99:de67:c3dc with SMTP id 13-20020a25050d000000b00d99de67c3dcmr3190714ybf.2.1697568682729; Tue, 17 Oct 2023 11:51:22 -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> <5c795b4cf6d7460af205e85a36194fa188136c38.camel@linux.ibm.com> In-Reply-To: <5c795b4cf6d7460af205e85a36194fa188136c38.camel@linux.ibm.com> From: Paul Moore Date: Tue, 17 Oct 2023 14:51:11 -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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 17 Oct 2023 11:51:33 -0700 (PDT) On Tue, Oct 17, 2023 at 1:59=E2=80=AFPM Mimi Zohar wr= ote: > On Tue, 2023-10-17 at 13:29 -0400, Paul Moore wrote: > > On Tue, Oct 17, 2023 at 1:09=E2=80=AFPM Mimi Zohar wrote: > > > 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 propert= ies to a set of > > > > > > > > > kernel usages, while still letting users configure these = constraints. > > > > > > > > > > > > > > > > That is an interesting idea. Would the other security main= tainers be in > > > > > > > > support of such an approach? Would a LSM be the correct in= terface? > > > > > > > > Some of the recent work I have done with introducing key us= age and CA > > > > > > > > enforcement is difficult for a distro to pick up, since the= se changes can be > > > > > > > > viewed as a regression. Each end-user has different signin= g procedures > > > > > > > > and policies, so making something work for everyone is diff= icult. 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. Woul= d this > > > > > 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 kern= el > > > > 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 o= n > > > 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 contro= l usage > > > 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. > > I don't believe defining per purpose/operation specific keyrings will > resolve the underlying problem of granularity. Perhaps not completely, but for in-kernel operations I believe it is an attractive idea. --=20 paul-moore.com