From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 08 Sep 2023 20:38:44 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qegNR-008WO7-GK for lore@lore.pengutronix.de; Fri, 08 Sep 2023 20:38:44 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qegNQ-0001Ns-0J; Fri, 08 Sep 2023 20:38:44 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qegND-0001Nh-4g; Fri, 08 Sep 2023 20:38:31 +0200 Received: from mol by pty.whiteo.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qegNC-00Awvh-Mg; Fri, 08 Sep 2023 20:38:30 +0200 Date: Fri, 8 Sep 2023 20:38:30 +0200 From: Michael Olbrich To: Simon Falsig Message-ID: Mail-Followup-To: Simon Falsig , Alexander Dahl , =?utf-8?B?SmnFmWkgVmFuxJtr?= , "ptxdist@pengutronix.de" References: <20230907-jockstrap-dreamily-124aa43b7c7e@ifak-system.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=4.0 tests=AWL,BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL autolearn=no autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] SBOM support X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Alexander Dahl , "ptxdist@pengutronix.de" , =?utf-8?B?SmnFmWkgVmFuxJtr?= Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Hi, On Fri, Sep 08, 2023 at 09:05:26AM +0000, Simon Falsig wrote: > Thanks for your reply! I've never used Buildroot, so really good with some hints as to how > others solve this. > > >> My suggestion would be to add a _CPE variable to each package (built from > >> whatever other variables make sense, typically _VERSION). I managed to add this > >> for the fast report (extracting it to pkg_cpe in rules/post/ptxd_make_world_common.make, > >> and adding it to the report in scripts/lib/ptxd_make_world_report.sh), but I > >> wouldn't be surprised if there are other places/report that need to track this > >> also for consistency? > >> Packages that specify _CPE would then have this included in their report, and > >> there'd be no change for the packages that don't specify it. > > > > As far as I know buildroot [1] already has support for this. They construct this from > > defaults and override it with several different variables if defaults are not sufficient > > for a particular project: > > > > _CPE_ID_VENDOR > > _CPE_ID_VERSION > > _CPE_ID_UPDATE > > _CPE_ID_PRODUCT > > > > And maybe more? Some quirks handling like this is probably necessary in ptxdist, too? > > > > Greets > > Alex > > I see - Buildroot essentially automatically creates the CPE based on existing data in the > package, and that can then be overridden if needed. I guess the benefit is that this in > many cases works directly out of the box without any further configuration - but with the > risk that a wrong CPE is generated. What would be a wrong CPE? I know very little about this, but I assume, that would be something like the wrong string for vendor/product, etc. We need to use the same as everybody else, so matching is possible, right? Are there any machine readable list we can use to validate this? That would help with review and maintenance. Anyways, the report should not included any automatically created CPE. It should contain all the data to assemble those anyways, so it could be an optional part of the SBOM creation. > (From what I can see, ptxdist doesn't really provide any variable that can be extracted for > the VENDOR field though?) For open source projects, a vendor often makes very little sense. What is used in such cases anyways? > Explicitly specifying the CPE in each package would lower the risk of getting wrong CPEs, as > you'd instead just not get a CPE for packages that don't specify it. As I said, it could be optional. I don't know enough about this to decide either way. > Personally, I'd probably lean towards the latter (rather no CVE than a wrong one) for our > usecase, but would be open to other ways if that can mean getting this upstreamed? I think an option would be good to start with. That way we can see if anything useful is created and you can disable it without any patches. Michael -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |