You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/BuildOutput.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -316,6 +316,14 @@ Unassociated types are displayed when certain types (such as classes, interfaces
316
316
If these types contain vulnerabilities, SBOM scanning will not detect them.
317
317
To fix this, ensure that proper GAV coordinates (Group ID, Artifact ID, and Version) are defined in the project POM's properties or in _MANIFEST.MF_ using standard formats.
318
318
319
+
Hashes are computed for JAR inputs and GraalVM internal components if the `hashes` option is used.
320
+
Hashes are not computed for directories.
321
+
If `hashes` is enabled and hashes cannot be computed, the number of components without hashes is displayed.
GraalVM Native Image assembles a Software Bill of Materials (SBOM) at build time to detect any libraries that may be susceptible to known security vulnerabilities (only available in Oracle GraalVM).
11
11
Pass the `--enable-sbom` option to the `native-image` command to configure the SBOM feature.
12
-
The SBOM feature is enabled by default and defaults to the `embed` option which embeds an SBOM into the native executable.
12
+
The SBOM feature is enabled by default and defaults to the `embed` option which embeds an SBOM into the native executable.
13
13
In addition to being embedded, the SBOM can be added to the classpath or exported as a JSON file by using `--enable-sbom=classpath,export`.
14
14
15
15
The CycloneDX format is supported and is the default.
@@ -40,6 +40,7 @@ It outputs the contents in the JSON format:
You can leverage the generated SBOM to integrate with security scanning solutions.
115
125
There are a variety of tools to help detect and mitigate security vulnerabilities in your application dependencies.
116
126
@@ -137,12 +147,43 @@ The generated report can then be used to update any vulnerable dependencies in y
137
147
138
148
Integrating security scanning into your CI/CD workflows has never been easier.
139
149
With SBOM support available in the [GraalVM GitHub Action](https://github.com/marketplace/actions/github-action-for-graalvm){:target="_blank"}, your generated SBOM can be automatically submitted and analyzed using [GitHub’s dependency submission API](https://docs.github.com/en/rest/dependency-graph/dependency-submission){:target="_blank"}.
140
-
It enables:
150
+
It enables:
141
151
- Vulnerability tracking with GitHub's Dependabot.
142
152
- Dependency tracking with GitHub's Dependency Graph.
143
153
144
154
This integration helps ensure that your application is continuously monitored for vulnerabilities throughout the development lifecycle.
145
155
156
+
## Verifying Component Integrity with Hashes
157
+
158
+
Use `--enable-sbom=hashes` to associate each component with SHA-256 and SHA-512 hashes.
159
+
The hash can be verified against trusted sources such as Maven Central.
160
+
Verifying the component hashes can detect malicious tampering or substitutions in your native image builds.
161
+
If a compromised dependency poses as a legitimate library, a hash mismatch against the trusted source would reveal tampering.
162
+
163
+
> Verifying component hashes strengthens integrity verification, but does not provide complete end‑to‑end supply chain security. Use cryptographic signing and SLSA provenances to guarantee authenticity and integrity.
164
+
165
+
Hashes are computed for applications JARs and GraalVM components, but not for classpath directories.
166
+
The GraalVM components are associated with the hash of the runtime image file.
167
+
These GraalVM components include for example `org.graalvm.nativeimage/svm`, `org.graalvm.sdk/nativeimage`, and `Oracle GraalVM`.
| Application JARs | Yes | Download the JAR from a trusted source, hash it, and compare with the component hash. |
172
+
| GraalVM components | Yes | Hash `$GRAALVM_HOME/lib/modules` from the same GraalVM distribution used to build the image and compare with the component hash. |
173
+
| Classpath directories | No | - |
174
+
175
+
If you use a fat (or shaded) JAR, the hash is computed from the fat JAR, which will not match individual component hashes published on Maven Central.
176
+
177
+
Pair this with `--enable-sbom=hashes,strict`.
178
+
The `strict` flag enforces completeness by ensuring every class in the image is mapped to a component.
179
+
When using `strict`, the `native-image` builder will throw an exception if one or more components cannot be associated with a hash.
180
+
181
+
The Security Report in the build output indicates whether any components could not be associated with a hash.
182
+
Run the following command to find these components:
@@ -331,4 +373,4 @@ When this happens, all unresolved metadata gets collected in a placeholder compo
331
373
332
374
-[Using GraalVM Native Image SBOM Support for Vulnerability Scanning](https://medium.com/graalvm/using-graalvm-native-image-sbom-support-for-vulnerability-scanning-4211c747376)
333
375
-[Embed an SBOM in a Native Executable to Identify Its Dependencies](../reference-manual/native-image/guides/use-sbom-support.md)
0 commit comments