-
Notifications
You must be signed in to change notification settings - Fork 596
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
License not pickedup for binaries like java (openjdk), node (nodejs) #2765
Comments
Dear team, |
Hi @mithunms333, unfortunately we don't have a ready workaround for you in this case. We are discussing some improvements the binary catalogers and how to handle some special cases like the JDK and JRE. We do have another issue discussing a possible framework for "hints" that would give you some tools to customize the output of the SBOM on a per cataloger basis: #31 I will go ahead and keep this issue open for you until we have a resolution, and if you need anything else please feel free to open another issue. |
Developer note: after a discussion about implementing this feature, we think the following approach may work reasonably well and help to scale the binary classifiers without the need to add individual catalogers for each case:
An example of how this might look is (naming and exact details TBD, of course):
So, in the event that a matching package is discovered by this cataloger, a secondary set of functions may run to append additional information to the package, in this example appending any license information found based on the paths relative to where the binary was located. |
Hi @kzantow java binary executable will be foudn at: there would be few other supporting jars- probably applicable to same LICENSE at: |
From https://github.com/anchore/syft/releases/tag/v1.13.0, Syft will check more detail information for JDK binary. Now, I'm checking "buildType" and installed path to judge some detected jdk binary are OracleJDK or OpenJDK Oracle build.
|
Hi @witchcraze , This tar.gz contains the LICENSE file, which is just a text file. The meta data for this can be foun at following link: Please suggest to me if you have any work around ideas. |
Sorry for confusion. I have no concrete workaround. As I wrote, current syft can list files including LICENSE,
|
Hi, Syft's license cataloger should pickup this LICENSE file and add the license name in the above json field in output. |
For openjdk, with the JDK cataloger, there would be a reasonably easy enhancement to search in the set of JVM files matching known license file names to attempt to gather licenses. Syft integrates a Google license classification library for this purpose elsewhere (like go license enrichment). |
requesting to kindly let me know if this is planned in any upcoming enhancement or bug-fix cycle? I am not from the tech stack of syft, and hence unable to fix it myself. |
What happened:
I ran syft scan on a container image which has java tar binaries downloaded (not installed as rpm linux packages) and placed from openjdk (downloaded from github - adoptium). The SBOM json (SPDX, CycloneDX) lists the binary component with name 'java' and its correct version, location. But its license is not picked up. There is a LICENSE file at the path: '.../openjdk/legal/java.base/LICENSE'.
I believe the issue is same for ALL binaries of all types, whether java or nodejs, and from all github projects/vendors.
Additional trials details:
I also tried the following ideas, but they didnt work:
I went through this syft source code go class 'syft/internal/licenses/list.go', and according to its list, I kept copies of the LICENSE file with renamed versions hoping that some name will get picked up by syft i nsome folder, and at all folders such as:
'.../openjdk/legal/java.base/LICENSE'
'.../openjdk/bin/LICENSE'
'.../openjdk/LICENSE'
These trials did not succeed.
What you expected to happen:
License value GPLv2+ should have been picked up and included in json SBOM files. But it did not happen. SPDX fields for license show as 'NOASSERTION'.
Steps to reproduce the issue:
create a simple linux image by downloading the openjdk tar binaries from github adoptium. then run syft scan on it, generating SPDX or cyclonedx json output format. check the license field values for that component in generated outptu SBOM file.
Anything else we need to know?:
I believe the issue is same for ALL binaries of all types, whether java or nodejs, and from all github projects/vendors.
Environment:
syft version
:Application: syft
Version: 0.99.0
BuildDate: 2023-12-21T16:18:46Z
GitCommit: 3cffa0b
GitDescription: v0.99.0
Platform: linux/amd64
GoVersion: go1.21.5
Compiler: gc
cat /etc/os-release
or similar): RHEL 8.9 / UBI minimal - series 8 or 9 - any.The text was updated successfully, but these errors were encountered: