iPXE
sbom.h
Go to the documentation of this file.
1#ifndef _IPXE_SBOM_H
2#define _IPXE_SBOM_H
3
4/** @file
5 *
6 * Software Bill Of Materials (SBOM)
7 *
8 * Since October 2025, the Microsoft UEFI Signing Requirements have
9 * included a clause stating that "submissions must contain a valid
10 * signed SPDX SBOM in a custom '.sbom' PE section". A list of
11 * required fields is provided, and a link is given to "the Microsoft
12 * SBOM tool to aid SBOM generation". So far, so promising.
13 *
14 * The Microsoft SBOM tool has no support for handling a .sbom PE
15 * section. There is no published document that specifies what is
16 * supposed to appear within this PE section. An educated guess is
17 * that it should probably contain the raw JSON data in the same
18 * format that the Microsoft SBOM tool produces.
19 *
20 * The list of required fields does not map to identifiable fields
21 * within the JSON. In particular:
22 *
23 * - "file name / software"
24 *
25 * This might be the top-level "name" field. It's hard to tell.
26 * The SPDX SBOM specification is not particularly informative
27 * either: the only definition it appears to give for "name" is
28 * "This field identifies the name of an Element as designated by
29 * the creator", which is a spectacularly useless definition.
30 *
31 * - "software version / component generation (shim)"
32 *
33 * This may refer to the "packages[].versionInfo" field. There is
34 * no obvious relevance for the words "component", "generation", or
35 * "shim". The proximity of "generation" and "shim" suggests that
36 * this might be related in some way to the SBAT security
37 * generation, which is absolutely not the same thing as the
38 * software version.
39 *
40 * - "vendor / company name (this must exactly match the verified
41 * company name in the submitter's EV certificate on the Microsoft
42 * HDC partner center account)"
43 *
44 * This is clearly written as though it has some significance for
45 * the UEFI signing submission process. Unfortunately there is no
46 * obvious map to any defined SBOM field. An educated guess is that
47 * this might be referring to "packages[].supplier", since
48 * experiments show that the Microsoft SBOM tool will fail
49 * validation unless this field is present.
50 *
51 * - "product-name"
52 *
53 * This might also be the top-level "name" field. There is no
54 * indication given as to how this might differ from "file name /
55 * software".
56 *
57 * - "OEM Name" and "OEM ID"
58 *
59 * These seem to be terms made up on the spur of the moment. The
60 * three-letter sequence "OEM" does not appear anywhere within the
61 * codebase of the Microsoft SBOM tool.
62 *
63 * In the absence of any meaningful specification, we choose not to
64 * engage in good faith with this requirement. Instead, we construct
65 * a best guess at the contents of a .sbom section that has some
66 * chance of being accepted by the UEFI signing submission process.
67 * We assume that anything that passes "sbom-tool validate" will
68 * probably be accepted, with the only actual check being that the
69 * supplier name must match the registered EV code signing
70 * certificate.
71 *
72 * To anyone who actually cares about the arguably valuable benefits
73 * of having a software bill of materials: please stop creating junk
74 * requirements. If you want people to actually make the effort to
75 * produce useful SBOM data, then make it clear what data you want.
76 * Provide unambiguous specifications. Provide example files.
77 * Provide tools that actually do the job they are claimed to do.
78 * Don't just throw out another piece of "MUST HAS THING BECAUSE IS
79 * MORE SECURITY" garbage and call it a day.
80 *
81 */
82
83FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
84FILE_SECBOOT ( PERMITTED );
85
86/** An SBOM field */
87#define SBOM_FIELD( key, value ) "\"" key "\":" value
88
89/** An SBOM string field */
90#define SBOM_STRING( key, value ) SBOM_FIELD ( key, "\"" value "\"" )
91
92/** An SBOM package */
93#define SBOM_PACKAGE( spdxid, name, supplier, version ) \
94 "{" \
95 SBOM_STRING ( "SPDXID", spdxid ) "," \
96 SBOM_STRING ( "name", name ) "," \
97 SBOM_STRING ( "supplier", supplier ) "," \
98 SBOM_STRING ( "versionInfo", version ) \
99 "}"
100
101/** An SBOM manifest */
102#define SBOM_MANIFEST( name, supplier, version ) \
103 "{" \
104 SBOM_STRING ( "name", name ) "," \
105 SBOM_FIELD ( "files", "[]" ) "," \
106 SBOM_FIELD ( "relationships", "[]" ) "," \
107 SBOM_FIELD ( "packages", "[" \
108 SBOM_PACKAGE ( "", name, supplier, version ) \
109 "]" ) \
110 "}"
111
112/** Mark variable as being in the ".sbom" section */
113#define __sbom __attribute__ (( section ( ".sbom" ), aligned ( 512 ) ))
114
115extern const char sbom[] __sbom;
116
117#endif /* _IPXE_SBOM_H */
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define __sbom
Mark variable as being in the ".sbom" section.
Definition sbom.h:113