Reduce image CVEs by switching to minimal base and cleanup build chain #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the build reproducibility and mitigates potential risk from upstream CVEs by switching the base build image from gcc:latest to gcc:13.
Background
The previous Dockerfile used gcc:latest as the base image for building DRBD utilities. Using a floating tag can inadvertently introduce new vulnerabilities over time and lead to unpredictable build behavior. Pinning the image to gcc:13 ensures a stable, auditable, and more secure build environment.
Testing Performed
Rebuilt the image locally with gcc:13.
Scanned using grype: 0 Critical CVEs and 9 High CVEs, all originating from libxml2 and python3 in the UBI 9 runtime base image.
Functional verification:
drbd-shutdown-guard --help displays usage correctly.
drbd-shutdown-guard's initcontainer at satellite-node pod is completing well.