I am generating SBOM for graal-vm-native binaries.
- I have created a simple maven project with few dependencies.
- downloaded graalvm-jdk-21
- Built maven project using
mvn clean package
- Generated native binary using command
-
graalvm-jdk-21.0.8+12.1/Contents/Home/bin/native-image -cp target/classes demo.Fortune -o target/fortune
-
- Scanned native binary directly and also tried from docker image
Sample Output
{
"id": "31911a4b68121b97",
"name": "com.fasterxml.jackson.core/jackson-annotations",
"version": "2.19.1",
"type": "UnknownPackage",
"foundBy": "graalvm-native-image-cataloger",
"locations": [ ],
"licenses": [ ],
"language": "",
"cpes": [
{
"cpe": "cpe:2.3:a:annotations:annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:annotations:jackson-annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:annotations:jackson:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:annotations:jackson_annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:core:annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:core:jackson-annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:core:jackson:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:core:jackson_annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:fasterxml:annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:fasterxml:jackson-annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:fasterxml:jackson:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:fasterxml:jackson_annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson-annotations:annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson-annotations:jackson-annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson-annotations:jackson:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson-annotations:jackson_annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson:annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson:jackson-annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson:jackson:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
},
{
"cpe": "cpe:2.3:a:jackson:jackson_annotations:2.19.1:*:*:*:*:*:*:*",
"source": "declared"
}
],
"purl": ""
},
Problem,
- Type is returned as `UnknownPackage`
- PURL is empty
am I doing anything wrong? is there any way we can have proper values for type and PURL?
Update:
Files inside the binary
There are 32 section headers, starting at offset 0xed83768:
Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
[ 0] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
[ 1] .interp PROGBITS 0000000000400318 00000318
000000000000001c 0000000000000000 A 0 0 1
[ 2] .note.gnu.pr[...] NOTE 0000000000400338 00000338
0000000000000020 0000000000000000 A 0 0 8
[ 3] .note.gnu.bu[...] NOTE 0000000000400358 00000358
0000000000000024 0000000000000000 A 0 0 4
[ 4] .note.ABI-tag NOTE 000000000040037c 0000037c
0000000000000020 0000000000000000 A 0 0 4
[ 5] .gnu.hash GNU_HASH 00000000004003a0 000003a0
00000000000001dc 0000000000000000 A 6 0 8
[ 6] .dynsym DYNSYM 0000000000400580 00000580
00000000000018d8 0000000000000018 A 7 1 8
[ 7] .dynstr STRTAB 0000000000401e58 00001e58
000000000000125b 0000000000000000 A 0 0 1
[ 8] .gnu.version VERSYM 00000000004030b4 000030b4
0000000000000212 0000000000000002 A 6 0 2
[ 9] .gnu.version_r VERNEED 00000000004032c8 000032c8
00000000000000e0 0000000000000000 A 7 1 8
[10] .rela.dyn RELA 00000000004033a8 000033a8
0000000000000738 0000000000000018 A 6 0 8
[11] .rela.plt RELA 0000000000403ae0 00003ae0
00000000000010e0 0000000000000018 AI 6 25 8
[12] .init PROGBITS 0000000000405000 00005000
000000000000001b 0000000000000000 AX 0 0 4
[13] .plt PROGBITS 0000000000405020 00005020
0000000000000b50 0000000000000010 AX 0 0 16
[14] .text PROGBITS 0000000000406000 00006000
00000000077279fb 0000000000000000 AX 0 0 4096
[15] .fini PROGBITS 0000000007b2d9fc 0772d9fc
000000000000000d 0000000000000000 AX 0 0 4
[16] .rodata PROGBITS 0000000007b2e000 0772e000
000000000002f4de 0000000000000000 A 0 0 4096
[17] .svm_heap PROGBITS 0000000007b5e000 0775e000
0000000007619000 0000000000000000 A 0 0 4096
[18] .eh_frame_hdr PROGBITS 000000000f177000 0ed77000
0000000000000d5c 0000000000000000 A 0 0 4
[19] .eh_frame PROGBITS 000000000f177d60 0ed77d60
0000000000004314 0000000000000000 A 0 0 8
[20] .init_array INIT_ARRAY 000000000f17ddc0 0ed7cdc0
0000000000000008 0000000000000008 WA 0 0 8
[21] .fini_array FINI_ARRAY 000000000f17ddc8 0ed7cdc8
0000000000000008 0000000000000008 WA 0 0 8
[22] .data.rel.ro PROGBITS 000000000f17ddd0 0ed7cdd0
0000000000000008 0000000000000000 WA 0 0 8
[23] .dynamic DYNAMIC 000000000f17ddd8 0ed7cdd8
00000000000001e0 0000000000000010 WA 7 0 8
[24] .got PROGBITS 000000000f17dfb8 0ed7cfb8
0000000000000048 0000000000000008 WA 0 0 8
[25] .got.plt PROGBITS 000000000f17e000 0ed7d000
00000000000005b8 0000000000000008 WA 0 0 8
[26] .data PROGBITS 000000000f17f000 0ed7e000
0000000000005330 0000000000000000 WA 0 0 4096
[27] .bss NOBITS 000000000f184340 0ed83330
0000000000000698 0000000000000000 WA 0 0 32
[28] .comment PROGBITS 0000000000000000 0ed83330
0000000000000072 0000000000000001 MS 0 0 1
[29] .annobin.notes PROGBITS 0000000000000000 0ed833a2
000000000000013e 0000000000000001 MS 0 0 1
[30] .gnu.build.a[...] NOTE 000000000f1869d8 0ed834e0
0000000000000144 0000000000000000 0 0 4
[31] .shstrtab STRTAB 0000000000000000 0ed83624
0000000000000142 0000000000000000 0 0 1