Building Golang packages using Spring Boot 3 bootBuildImage?
I am using spring boot v3.1.5 and using bootBuildImage to build my image. After scanning my images, I found a lot of CVEs related to golang. As far as I understand, multiple golang build packages are used during the image building process.
Is there a way to solve this problem? Can I configure spring to avoid using these packages?
I tried configuring the used buildpack without success. I want to have zero golang related files in the image I create.
Correct answer
Very good!
No, that's incorrect. When you build a Java application, it uses only Java-related build packages. It doesn't use any Go buildpacks. You can see the list of build packages it uses in the build's output. It looks like this. The buildpacks listed in the instrumentation are the only ones called.
===> DETECTING 6 of 26 buildpacks participating paketo-buildpacks/ca-certificates 3.6.6 paketo-buildpacks/bellsoft-liberica 10.4.2 paketo-buildpacks/syft 1.39.0 paketo-buildpacks/executable-jar 6.8.2 paketo-buildpacks/dist-zip 5.6.7 paketo-buildpacks/spring-boot 5.27.5
What may confuse you is that All Paketo buildpacks themselves are written in Golang. So if you were to select a buildpack image such as gcr.io/paketo-buildpacks/bellsoft-liberica
, you would see /cnb/buildpacks/paketo-buildpacks_bellsoft-liberica/10.4. There is a Go binary at 2/bin /main
. This is what is called during instrumentation and building, and what actually does the work of building the package.
Additionally, the buildpack performs some operations before the application runtime is started, such as configuring JVM settings, which are performed by a separate binary named helper
(in the same directory as the buildpack image). Unlike main
, this binary is copied into the final image, so your scanner correctly thinks that the Go binary is present in the image. It is the helper
binary. If you view the application image using dive
you can see the layer adding the helper
binary and confirm this.
Your scanner will see this binary and scan it like anything else. It's able to tell from a binary which version of Golang created that binary, and from there it tells you that the binary may be vulnerable to any known CVEs for that version of Go or higher. The scanner has zero knowledge about the purpose of the binary or whether it is actually vulnerable to any CVEs. I don't know what CVEs you are referring to, but I can tell you that given the context of the Paketo buildpack
helper binary, most of the CVEs will not apply. For example, anything related to servers, networking, or HTTP is irrelevant.
helper The binary is a CLI that runs and usually reads arguments/environment variables and then prints out some structured text. That's it, usually no server, network, or HTTP required.
specific questions about CVEs and their impact, you can ask on the Paketo Slack, but don't just dump the CVE list in the scanner there and expect someone to double check everything. you. Please note that this project is an OSS project and people respond in good faith and as time permits. If you need more help or want a guaranteed response time, then you'll want to consider contracting with a commercial build package provider.
Golang files cannot be deleted, they are essentially build packages.what can you do:
- Keep your builders and buildpacks updated. The Paketo project cuts new releases every week, and we actively keep Go up to date so that new releases contain all the latest fixes.
- Check for reported CVEs, if you keep up to date there shouldn't be many. Given the context in which the package binaries are built (see above), they are most likely irrelevant, and you can then tell the scanner to ignore them. They should be leaving soon because 1. )
- Since you are using the Spring Boot build tools, please make sure you have seen
this announcement and have applied the required changes. If you don't do this, you will definitely get a lot of CVEs because you will have very old build packages.
The above is the detailed content of Building Golang packages using Spring Boot 3 bootBuildImage?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Yes, H5 page production is an important implementation method for front-end development, involving core technologies such as HTML, CSS and JavaScript. Developers build dynamic and powerful H5 pages by cleverly combining these technologies, such as using the <canvas> tag to draw graphics or using JavaScript to control interaction behavior.

The method of customizing resize symbols in CSS is unified with background colors. In daily development, we often encounter situations where we need to customize user interface details, such as adjusting...

Regarding the reasons and solutions for misaligned display of inline-block elements. When writing web page layout, we often encounter some seemingly strange display problems. Compare...

How to achieve the 45-degree curve effect of segmenter? In the process of implementing the segmenter, how to make the right border turn into a 45-degree curve when clicking the left button, and the point...

How to use JavaScript or CSS to control the top and end of the page in the browser's printing settings. In the browser's printing settings, there is an option to control whether the display is...

Real-time Bitcoin USD Price Factors that affect Bitcoin price Indicators for predicting future Bitcoin prices Here are some key information about the price of Bitcoin in 2018-2024:

Tips for Implementing Segmenter Effects In user interface design, segmenter is a common navigation element, especially in mobile applications and responsive web pages. ...

Compatibility issues of multi-row overflow on mobile terminal omitted on different devices When developing mobile applications using Vue 2.0, you often encounter the need to overflow text...
