velero-plugin-for-vsphere icon indicating copy to clipboard operation
velero-plugin-for-vsphere copied to clipboard

Is it possible to remove the dependency for glibc inside the Velero image

Open ywk253100 opened this issue 2 years ago • 12 comments

Velero uses the gcr.io/distroless/base-debian11 as the base image while the base-debian contains several CVEs introduced by glibc and some other packages.

Currently, only vSphere plugin needs the glibc inside the Velero image, so is it possible to remove the dependency for glibc inside Velero image so that Velero can use gcr.io/distroless/static-debian11 instead? e.g. resolve the dependency in vSphere plugin side?

The gcr.io/distroless/static-debian11 contains fewer packages and that means it contains fewer CVEs and we don't need to release patches to fix them, that will save us a lot of time.

ywk253100 avatar Apr 27 '22 09:04 ywk253100

The reason why vsphere plugin needs glibc is because the VDDK dependency requires it.

Ideally, velero-plugin-for-vsphere, init container running inside velero pod, should be able to get rid of glibc, as the consumption of VDDK has been offloaded to data-manager-for-plugin image.

But, before making it seamlessly working, we might need to make some changes in Makefile and Dockerfiles and verify it seriously. Overall, it is a non-trivial task. We should consider working on it next @xing-yang

lintongj avatar Apr 28 '22 20:04 lintongj

@xinyanw409 Can you take a look?

xing-yang avatar May 09 '22 02:05 xing-yang

@ywk253100 Can you provide links to the CVEs? We want to see what they are and the severity of them.

xing-yang avatar Jun 10 '22 16:06 xing-yang

Here is the scan result of velero main image

ywk253100 avatar Jun 10 '22 23:06 ywk253100

Hi, are there any progress on this ticket?

yanji09 avatar Oct 17 '22 10:10 yanji09

@xinyanw409 I saw a new PR is submitted, but seems it contains no change for removing the VDDK dependency from vsphere-plugin itself, please see my comment cc @xing-yang

ywk253100 avatar Nov 16 '22 01:11 ywk253100

For 1.4.1 we have changed our dockerfile to use photon-4.0 with which reduces the vulnerability. For the pending PR we're going to split our datamgr into two parts so eventually the velero plugin and backup-driver can get rid of the vddk. I'm scan and evaluate the current plugin image first to see if there's any high CVE issues. If yes we'll consider using a separate go.mod for datamgr, thanks.

xinyanw409 avatar Nov 16 '22 01:11 xinyanw409

@ywk253100 As Xinyan said, we'll move datamgr into a separate go module if her current PR does not resolve the CVEs.

xing-yang avatar Nov 16 '22 02:11 xing-yang

Let me explain it in more detail to make sure we understand the issue clearly, correct me if I'm wrong.

When installing Velero, the vSphere-plugin(which contains three parts: velero-plugin, data-manager, backup-driver), let's call it vSphere plugin to distinguish from velero-plugin, runs as an init container of Velero pod.

The init container does two works:

  1. Copy the velero-plugin binary into a volume shared with the velero container, so after this step, the velero binary and velero-plugin binary are in the same container.
  2. Start data-manager and backup-driver.

The current init container works well and has nothing to do with which base image the Velero uses.

When doing the backup/restore, the velero binary starts the velero-plugin binary and calls its functions via gRPC, this is the part that needs the Velero base image contain glibc because the velero-plugin itself dependents the VDDK library.

The key of the issue is that velero-plugin runs inside the Velero container and it needs glibc, so the fix should remove the dependency from velero-plugin. But seems there are no changes for this part in the PR.

ywk253100 avatar Nov 16 '22 02:11 ywk253100

So we need to test backup/restore after making this change. @ywk253100 What Velero image can we test with? You don't have a Velero image that does not use base-debian yet, right?

xing-yang avatar Nov 16 '22 02:11 xing-yang

We can provide one Velero image which uses the static distroless as the base image

ywk253100 avatar Nov 16 '22 03:11 ywk253100

@xing-yang @xinyanw409 You can use redenval/velero:v1.9.3-distroless-static to do the test

ywk253100 avatar Nov 16 '22 07:11 ywk253100