Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve tier 1 image CVEs that are identified by security team #4194

Closed
caroline-suse-rancher opened this issue May 9, 2023 · 21 comments
Closed
Assignees

Comments

@caroline-suse-rancher
Copy link
Contributor

Refer to Jira ticket for more detail: https://jira.suse.com/browse/SURE-6236

@matttrach
Copy link
Contributor

from the JIRA issue:
Resolve all the applicable CVEs flagged by image-scanning in tier 1 images that belong to team/rke2-k3s:

rancher/k3s-upgrade
rancher/rke2-cloud-provider
rancher/rke2-runtime
rancher/rke2-upgrade
rancher/system-agent-installer-k3s
rancher/system-agent-installer-rke2
rancher/system-upgrade-controller
The tier 1 images can be checked in image-scanning's dashboard - https://github.com/rancherlabs/image-scanning/issues/2062. Based on the image name, the issues can be filtered in https://github.com/rancherlabs/image-scanning/issues?q=is%3Aopen by adding the labels "team/rke2-k3s" and "cve/release/v2.7-head".

We are not listing the exact issues here, because new versions of the above images might be flagged by image-scanning in the meantime.

Upstream CVEs are outside the scope of this work, giving that we can't control when they are patched.

Please consult with the Security team in case of questions.

@matttrach matttrach self-assigned this May 10, 2023
@matttrach
Copy link
Contributor

matttrach commented May 10, 2023

Our Team CVEs

@matttrach
Copy link
Contributor

Just RKE2 CVEs

@matttrach
Copy link
Contributor

matttrach commented May 31, 2023

Not Mirrored: 82
Only Mirrors: 91

@matttrach
Copy link
Contributor

I have noticed some duplication of information across the issues I have worked, so in order to work more efficiently, I have decided to compile a list of all the images, and the binaries that are in them. Once this is done, I can take that a level further and find all of the dependencies for the binaries that have CVEs. In the end I hope to have a list of the CVEs for dependencies of binaries that we build, and what images those binaries exist in. This should give us an understanding of the scope of a CVE based on number of images it affects. We can then choose to resolve/ignore a CVE and understand what affect that has on the system as a whole.

@matttrach
Copy link
Contributor

matttrach commented Jun 2, 2023

Image Xref Part 1

rancher/rke2-runtime

rancher/hardened-runc

rancher/hardened-crictl

rancher/hardened-containerd

rancher/hardened-kubernetes

rancher/rke2-upgrade

@matttrach
Copy link
Contributor

The most prevalent problem is the duplicate/overlapping CVEs

new plan!

  1. build a list of binaries and what images they are on
  2. build a list of CVE dependencies and what binaries they are on
  3. create a cross reference list of dependencies with CVEs to what images they affect

@matttrach
Copy link
Contributor

Image Xref part 2

@matttrach
Copy link
Contributor

Image Xref part 3

@matttrach
Copy link
Contributor

Image Xref part 4

@matttrach
Copy link
Contributor

Image Xref part 5

@matttrach
Copy link
Contributor

Image Xref part 6

@matttrach
Copy link
Contributor

That is the last of them, now to compile it from the bin point of view and cross reference with dependency CVEs.

@caroline-suse-rancher
Copy link
Contributor Author

@matttrach Can you give me a status update on this one and why it was moved to the Backlog? Thank you!

@matttrach
Copy link
Contributor

yeah, sorry. I should have updated this earlier.

I pulled the csv of the image scans from https://github.com/rancher/image-scanning/tree/main/docs/_data, imported the data to Google sheets and used the QUERY function to aggregate the data a little better. This essentially made the sheet a mini database with the ability to use sql queries against it.
With that I found all of the packages that have CVEs and the count of images that we produce which contain those CVEs. We are not in control of theses packages, they are dependencies of upstream code bases that we build.

packages image_count
golang.org/x/net 527
golang.org/x/crypto 229
golang.org/x/text 216
github.com/emicklei/go-restful 74
github.com/docker/distribution 53
github.com/prometheus/client_golang 43
gopkg.in/yaml.v3 27
github.com/containernetworking/cni 20
k8s.io/kubernetes 20
github.com/buger/jsonparser 12
github.com/docker/docker 10
github.com/gogo/protobuf 10
github.com/opencontainers/runc 9
github.com/caddyserver/caddy 6
github.com/containerd/containerd 6
github.com/dgrijalva/jwt-go 6
github.com/distribution/distribution 6
gopkg.in/yaml.v2 4
libcrypto3 4
libssl3 4
github.com/Masterminds/goutils 3
github.com/rancher/wrangler 2
k8s.io/apimachinery 2
ncurses-libs 1
ncurses-terminfo-base 1

@matttrach
Copy link
Contributor

The data I have gathered and the processes I have used should give the team tools to more quickly discover false positives in the CVE scanning tools and quickly address any CVEs that are under our control.

@matttrach
Copy link
Contributor

There is more that can be done with this, but I believe this resolves the immediate concerns.

@matttrach
Copy link
Contributor

I moved this to the backlog because I was not actively working on it anymore and I am unaware of anyone else picking it up.

@matttrach
Copy link
Contributor

sorry, I meant to also mention #4365 where I am adding the image data I collected to the RKE2 repo.

@caroline-suse-rancher
Copy link
Contributor Author

We have resolved all CVEs that are within our direct control (in our codebase), and now we'll created a new issue for follow-on work that has more to do with dependencies.

@macedogm
Copy link
Member

@matttrach thanks for the amazing work 👏🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants