Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for linux/arm64 for java openjdk binary classifier #2373

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wagoodman
Copy link
Contributor

Attempts to match on the following section in a linux/arm64 binary:

❯ file bin-java
bin-java: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, not stripped

❯ xxd -s 0x00000970 -l 100 bin-java
00000970: f763 43a9 fd7b c4a8 c003 5fd6 c003 5fd6  .cC..{...._..._.
00000980: fd7b bfa9 fd03 0091 fd7b c1a8 c003 5fd6  .{.......{...._.
00000990: 0100 0200 0000 0000 312e 3800 0000 0000  ........1.8.....
000009a0: 312e 382e 305f 3339 322d 6230 3800 0000  1.8.0_392-b08...
000009b0: 6f70 656e 6a64 6b00 6a61 7661 0000 0000  openjdk.java....
000009c0: 011b 033b 1c00 0000 0200 0000 44ff ffff  ...;........D...
000009d0: 3800 0000                                8...

Before change:

❯ syft --platform linux/arm64 docker.io/eclipse-temurin:8u392-b08-jdk | grep binary
 ✔ Pulled image
 ✔ Loaded image                                                                                                                                          index.docker.io/library/eclipse-temurin:8u392-b08-jdk
 ✔ Parsed image                                                                                                                        sha256:f6657e24bf8ef61a6623c0c73d1d922a3162ebb160d12d617f94fcc2cd4a46cb
 ✔ Cataloged packages              [151 packages]
bash                 5.1.16                                   binary

After change:

❯ go run ./cmd/syft --platform linux/arm64 docker.io/eclipse-temurin:8u392-b08-jdk | grep binary
 ✔ Loaded image                                                                                                                                          index.docker.io/library/eclipse-temurin:8u392-b08-jdk
 ✔ Parsed image                                                                                                                        sha256:f6657e24bf8ef61a6623c0c73d1d922a3162ebb160d12d617f94fcc2cd4a46cb
 ✔ Cataloged packages              [152 packages]
bash                 5.1.16                                   binary
java                 1.8.0_392-b08                            binary

TODO:

  • add tests

@wagoodman wagoodman added WIP work in progress / do not merge enhancement New feature or request labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WIP work in progress / do not merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant