Skip to content

security: don't install ca-certificates in the driver image - #2067

Open
chris-altamimi wants to merge 1 commit into
kubernetes-sigs:mainfrom
chris-altamimi:drop-ca-certificates-from-driver-image
Open

security: don't install ca-certificates in the driver image#2067
chris-altamimi wants to merge 1 commit into
kubernetes-sigs:mainfrom
chris-altamimi:drop-ca-certificates-from-driver-image

Conversation

@chris-altamimi

Copy link
Copy Markdown

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

The driver image installs ca-certificates, which pulls openssl and libssl3 back into the final image — undoing something the base image goes out of its way to avoid.

registry.k8s.io/build-image/debian-base deliberately ships /etc/ssl/certs/ca-certificates.crt copied in from a separate stage without the ca-certificates package, precisely so that openssl is not a dependency (see images/build/debian-base/*/Dockerfile.build in kubernetes/release). clean-install ca-certificates mount in docker/Dockerfile reverses that, because ca-certificates hard-Depends on openssl (>= 1.1.1).

Neither package is reachable from the driver. It is built with CGO_ENABLED=0, so it reads the trust bundle as a file through crypto/x509 — it never links libssl3 and never execs the openssl CLI.

mount is already present in debian-base, so that half of the install is a no-op; I've kept it so the runtime dependency stays explicit.

Why it's worth doing: openssl and libssl3 are a recurring source of CVEs in image scans, and here they are entirely unused. In a recent scan of a cluster running v1.5.0, these two packages accounted for 11 findings on the driver image — 6 of which had no fixed Debian package available at any version, so they could not be resolved by patching, only by not shipping the packages. This change removes that surface permanently rather than waiting on Debian.

Note that this repo's scan_vulns workflow currently runs govulncheck only, so OS-package findings like these don't surface in CI.

Verification: built the image before and after the change.

  • openssl and libssl3 are no longer installed (82 → 79 packages)
  • /etc/ssl/certs/ca-certificates.crt is still present (142 certs)
  • a statically linked Go TLS probe run inside the image still completes a verified TLS 1.3 handshake to a public endpoint (2 verified chains), identically to the unmodified image
  • /usr/bin/mount is still present and the driver binary still starts

Special notes for your reviewer:

There is a related, larger issue I'm raising separately against kubernetes/release: perl-base is inherited as Essential: yes from debian:bookworm-slim and is absent from debian-base's existing purge list, which affects every image built on that base. This PR is scoped only to what the driver image itself controls.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

The driver image is built FROM registry.k8s.io/build-image/debian-base, which
deliberately ships /etc/ssl/certs/ca-certificates.crt copied in from a separate
stage *without* the ca-certificates package, precisely so that openssl is not
pulled in as a dependency (see images/build/debian-base/*/Dockerfile.build in
kubernetes/release).

`clean-install ca-certificates mount` undoes that: ca-certificates hard-Depends
on openssl (>= 1.1.1), so installing it puts openssl and libssl3 back into the
final image. Neither is reachable from the driver, which is built with
CGO_ENABLED=0 and therefore reads the trust bundle as a file through
crypto/x509 -- it never links libssl3 and never execs the openssl CLI.

`mount` is likewise already present in debian-base, so the install is a no-op
for it; it is kept to keep the runtime dependency explicit.

Verified by building the image before and after:

  - openssl and libssl3 are no longer installed (82 -> 79 packages)
  - /etc/ssl/certs/ca-certificates.crt is still present (142 certs)
  - a statically linked Go TLS probe run inside the image still completes a
    verified TLS 1.3 handshake to a public endpoint (2 verified chains),
    identically to the unmodified image
  - /usr/bin/mount is still present and the driver binary still starts

Signed-off-by: Chris Altamimi <chris.altamimi@epsilonasi.com>
@kubernetes-prow kubernetes-prow Bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Aug 31, 2026
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Missing ID

  • ❌ The email address for the commit (40b5246) is not linked to the GitHub account, preventing the EasyCLA check. Consult this Help Article and GitHub Help to resolve. (To view the commit's email address, add .patch at the end of this PR page's URL.) For further assistance with EasyCLA, please visit our EasyCLA portal and chat with our support bot.

@kubernetes-prow
kubernetes-prow Bot requested a review from aramase August 31, 2026 23:57
@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: chris-altamimi
Once this PR has been reviewed and has the lgtm label, please assign aramase for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow
kubernetes-prow Bot requested a review from enj August 31, 2026 23:57
@kubernetes-prow kubernetes-prow Bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 31, 2026
@kubernetes-prow

Copy link
Copy Markdown

This issue is currently awaiting triage.

If secrets-store-csi-driver contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow

Copy link
Copy Markdown

Welcome @chris-altamimi!

It looks like this is your first PR to kubernetes-sigs/secrets-store-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/secrets-store-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 31, 2026
@kubernetes-prow

Copy link
Copy Markdown

Hi @chris-altamimi. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubernetes-prow kubernetes-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant