BOM
Towards a verifiable artifact tree� & enabling launch-time security scanning
Contributors:� - Ed Warnicke� - Frederick Kautz� - Aeva Black
What is an SBOM
Metadata
Artifact ID
Artifact ID
Identifies an
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Information about the artifact like:
Learning from Git: Git Objects
␀
${type}⎵${size}\0
${content}
${type} - Git Object Type as a string
${size} - size in bytes of ${content} represented as a string base 10.
${content} - []byte of the content
Learning from Git: Git Ref
${type}⎵${size}\0
${content}
sha1
${gitref}
Example ${gitref}:
Learning from Git: Every file in a git repo is a ‘blob’
␀
blob⎵${size}\0
${content}
${content} - []byte of the file contents
Every Artifact is a blob
blob⎵${size}\0
${content}
Since every artifact is a []byte array, every artifact is a blob
Separate Metadata from Artifact Tree
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Metadata
Artifact ID
Separate Metadata from Artifact Tree
Metadata
Artifact ID
Artifact ID
Artifact ID
Artifact ID
Artifact ID
Artifact ID
Artifact ID
Metadata
Metadata
Metadata
Metadata
Metadata
Metadata
Metadata
Examples of Artifacts Trees
Examples of Artifacts Trees
Examples of Artifacts Trees
Examples of Artifacts Trees
Examples of Artifacts Trees
Examples of Artifacts Trees
Use the Git Ref as the Artifact ID
Artifact Git Ref
Artifact Git Ref
Artifact Git Ref
Artifact Git Ref
Artifact Git Ref
Artifact Git Ref
Artifact Git Ref
Represent the child relationship using a ‘GitBOM’ doc
Artifact-1 Git Ref
Artifact-2 Git Ref
Artifact-3 Git Ref
Artifact-4 Git Ref
Artifact-5 Git Ref
Artifact-6 Git Ref
Artifact-7 Git Ref
blob⎵${size}\0
blob⎵${a-6 git ref}\n
blob⎵${a-7 git ref}\n
Artifact-3’s GitBOM
blob⎵${size}\0
blob⎵${a-2 git ref}⎵bom⎵${a-2’s GitBOM git ref}\n
blob⎵${a-3 git ref}⎵bom⎵${a-3’s GitBOM git ref}\n
Artifact-1’s GitBOM
blob⎵${size}\0
blob⎵${a-4 git ref}\n
blob⎵${a-5 git ref}\n
Artifact-2’s GitBOM
Lexical order
Metadata can reference artifacts or GitBOMs by Git Ref
Artifact-1 Git Ref
Artifact-2 Git Ref
Artifact-3 Git Ref
Artifact-4 Git Ref
Artifact-5 Git Ref
Artifact-6 Git Ref
Artifact-7 Git Ref
Metadata
Metadata
Metadata
Metadata
Metadata
Embed the Git Ref of the GitBOM into the artifact
Compiler/Linker Integration
Distributing GitBOMs
Vulnerability Tracing
Other uses
BOM
Towards a verifiable artifact tree� & enabling launch-time security scanning
Example1:
blob⎵c0f35b8ae567f5348df3711496fdc0ef6f634169\n
blob⎵c64efd8bd8bceca8c69f9b5b7647cf0ff61fed59\n
Lexically ordered
85322091b1d50a23d1c2a0f5933788a2a958f2ad
gitref
Imagine we have:
hello.c -> gitref(hello.c) == c64efd8bd8bceca8c69f9b5b7647cf0ff61fed59
hello.c #includes <stdio.h> -> gitref(stdio.h) == c0f35b8ae567f5348df3711496fdc0ef6f634169
And we are building hello.o. The resulting GitBOM is:
We would write to hello.o a single additional elf section ‘.bom’ containing the 20 byte:
85322091b1d50a23d1c2a0f5933788a2a958f2ad
Overhead - total 89 bytes:
Example1:
Elf Header
Program Header Table
.text
.rodata
.shstrtab
.bom
...
Section Header Table
+ 20 bytes
+ 5 bytes
+ 64 bytes
Example1:
Write out to the same directory as hello.o:
./.bom/object/85/322091b1d50a23d1c2a0f5933788a2a958f2ad
The contents of hello.o’s GitBOM
Note: file size will be 46 bytes * number of .c and .h files. So for example, if we had 1 .c file and 999 .h files, the file size would be 46000 bytes.
Note: This is a file in the file system, it is *not* inserted into the .o file.
blob⎵c0f35b8ae567f5348df3711496fdc0ef6f634169\n
blob⎵c64efd8bd8bceca8c69f9b5b7647cf0ff61fed59\n
LLVM
FrontEnd
Pass
Pass
Pass
Pass
BackEnd
.c
IR
IR
IR
IR
IR
.o
1. Determine .c and .h files
2. Compute GitBOM document
3. Write out the GitBom document to the ./.bom/object directory
4. Add GitBOM gitref and file location as IR Metadata
1. Read GitBOM gitref from IR Metadata
2. Add .bom section to elf file containing only the gitref (20 bytes)
3. Read GitBOM file location from IR Metadata
4. Copy GitBOM file to ./.bom/object of output directory
Example2:
Imagine we have:
hello.o -> gitref(hello.o) == da2f5371ac5135d436b3dd3f2810c3c705cad1ea
goodbye.o -> gitref(goodbye.o) == a9c8ab2cc116562393fc675b2b4dede22f845967
And we are building a greeting executable:
llvm-ld -o ${GREETING_DIR}/greeting ${HELLO_DIR}/hello.o ${GOODBYE_DIR}/goodbye.o
The linker looks for a .bom section in hello.o, finds it, and it contains:
85322091b1d50a23d1c2a0f5933788a2a958f2ad
The linker looks for a .bom section in goodbye.o, finds it, and it contains:
34a7ad58295540383be53114b8c6ca3b98611a75
The linker computes the GitBOM for the greetings executable:
blob⎵a9c8ab2cc116562393fc675b2b4dede22f845967⎵bom⎵34a7ad58295540383be53114b8c6ca3b98611a75\n
blob⎵da2f5371ac5135d436b3dd3f2810c3c705cad1ea⎵bom⎵85322091b1d50a23d1c2a0f5933788a2a958f2ad\n
0f4f259bb0fc79aaeea37598b0fda9fef0c2efea
gitref
Example2:
We would write to the greetings executable a single additional elf section ‘.bom’ containing the 20 byte:
0f4f259bb0fc79aaeea37598b0fda9fef0c2efea
Overhead - total 89 bytes:
blob⎵a9c8ab2cc116562393fc675b2b4dede22f845967⎵bom⎵34a7ad58295540383be53114b8c6ca3b98611a75\n
blob⎵da2f5371ac5135d436b3dd3f2810c3c705cad1ea⎵bom⎵85322091b1d50a23d1c2a0f5933788a2a958f2ad\n
Write out to the same directory as the greetings executable (${GREETING_DIR}):
./.bom/object/0f/4f259bb0fc79aaeea37598b0fda9fef0c2efea
The contents of the greeting executables GitBOM
Note: file size will be 90 bytes * number of .o files. So for example, if we had 1000 .o files, the file size would be 90000 bytes.
Note: This is a file in the file system, it is *not* inserted into the executable file
Example3: Container Image Integration
{
"schemaVersion": 2,
"config": {
"mediaType": "application/vnd.oci.image.config.v1+json",
"size": 7023,
"digest": "sha256:b5b2b2c507a0944348e0303114d8d93aaaa081732b86451d9bce1f432a537bc7"
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"size": 32654,
"digest": "sha256:9834876dcfb05cb167a5c24953eba58c4ac89b1adf57f28f2f9d09af107ee8f0"
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"size": 73109,
"digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736"
}
],
"annotations": {
"gitbom”: “sha256:3c3a4604a545cdc127456d94e421cd355bca5b528f4a9c1905b15da2eb4a4c6b”
}
}