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

Add Kubernetes ecosystem #319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Kubernetes ecosystem #319

wants to merge 1 commit into from

Conversation

knqyf263
Copy link

@knqyf263 knqyf263 commented Dec 4, 2024

Adding Kubernetes ecosystem according to the discussion here.

This PR does not specify how to handle Kubernetes distributions by cloud vendors like EKS and GKE. We can talk about it here if needed, or merge it once and discuss it separately.

Signed-off-by: knqyf263 <knqyf263@gmail.com>
Copy link
Contributor

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you so much for this PR @knqyf263 !

@@ -706,6 +717,7 @@ The defined ecosystems are:
| `Go` | The Go ecosystem; the `name` field is a Go module path. |
| `Hackage` | The Haskell package ecosystem. The `name` field is a Haskell package name as published on Hackage. |
| `Hex` | The package manager for the Erlang ecosystem; the `name` is a Hex package name. |
| `Kubernetes` | The Kubernetes ecosystem; the `name` field is a Kubernetes component name. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some documentation we can point to as an authoritative reference for what a component name is and how to format it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify this comment a bit more using your example in kubernetes-sigs/cve-feed-osv#9 (comment):

It's unclear if the name should be "kube-apiserver", or "k8s.io/apiserver". Is there some clarification we can make here on the expected naming scheme?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @oliverchang, sorry for the late reply. I had been on vacation, and I've missed your comment in accumulated tasks.

Actually, I would like to discuss this point: I thought it would be difficult to distinguish apiserver from non-upstream apiserver if we use apiserver, so I adapted it to Go's module name, like k8s.io/apiserver to clarify it's upstream, but it is not yet strictly defined. How can we distinguish between different flavors within the same ecosystem in the OSV schema?

Copy link
Contributor

@oliverchang oliverchang Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have the convention of having a ":SUFFIX" qualifier for ecosystem names.

For example, for Debian:

The Debian package ecosystem; the name is the name of the source package. The ecosystem string might optionally have a :<RELEASE> suffix to scope the package to a particular Debian release. <RELEASE> is a numeric version specified in the Debian distro-info-data. For example, the ecosystem string “Debian:7” refers to the Debian 7 (wheezy) release.

Would something similar make sense for Kubernetes?

"Kubernetes" refers to upstream
"Kubernetes:<distribution>" refers to a specific distribution?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds reasonable. Should we define a list of <distribution> here? It seems difficult to list all the K8s distributions, so can we simply show an example, like “Kubernetes:<distribution>”, e.g. “Kubernetes:GKE” or something like that?

Copy link
Author

@knqyf263 knqyf263 Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found only two distributions publishing advisories. Do you know any other ones?

AKS seems to discuss vulnerability fixes on GitHub, but it doesn't look like security advisories.

Copy link
Contributor

@oliverchang oliverchang Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I'm unfamiliar with GKE advisories, so I don't know any other ones unfortunately. For GKE, Rancher, do they have machine readable ways to refer to specific Kubernetes components? The closest machine readable feed I've found is https://cloud.google.com/feeds/gke-security-bulletins.xml which is just an Atom feed with human readable data.

If these don't exist, maybe we should just start with plain "Kubernetes" to refer to upstream for now, and clarify it in the schema text?

We still need to have clearly defined rules for what "name" is though... Would having the name be the Go module name (i.e. k8s.io/apiserver) be the best way to encode upstream Kubernetes vulnerabilities (with the caveat that version numbers are different from the Go module as you pointed out here)? Or, is there some other authoritative list on how to name upstream Kubernetes components?

Then later, perhaps we can work with other GKE feeds to see if they can provide more machine readable feeds and get their agreement on how to format their distro feeds in OSV?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, there are no machine-readable feeds. That's why we started https://github.com/kubernetes-sigs/cve-feed-osv with its definition.

If these don't exist, maybe we should just start with plain "Kubernetes" to refer to upstream for now, and clarify it in the schema text?

I agree.

Would having the name be the Go module name (i.e. k8s.io/apiserver) be the best way to encode upstream Kubernetes vulnerabilities (with the caveat that version numbers are different from the Go module as you pointed out kubernetes-sigs/cve-feed-osv#9 (comment))?

Another problem with Go module names is that the component not written in Go will not fit. We may want to take a list from the official document.

  • kube-apiserver
  • etcd
  • kube-scheduler
  • kube-controller-manager
  • cloud-controller-manager
  • kubelet
  • kube-proxy

However, it's inconsistent with module names, kube-apiserver vs k8s.io/apiserver, and kube-scheduler vs k8s.io/kube-scheduler. I'm not sure which is better.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the official document doesn't seem to list all the possible components from past Kubernetes CVEs.

e.g.

I couldn't find any other document that comprehensively lists this either. It seems better to me to use the Go module names since they already exist and are consistent.

e.g. k8s.io/ingress-nginx, sigs.k8s.io/azurefile-csi-driver, k8s.io/kubectl

WDYT?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems better to me to use the Go module names since they already exist and are consistent.

Yes, that's the conclusion we also made when we started cve-feed-osv.

Another problem with Go module names is that the component not written in Go will not fit.

What do you think about this problem? We also considered it but didn't develop a better solution than Go module names. Then, we decided to go with module names. I think it's a good time to discuss it with the OSV team.

Copy link
Contributor

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy new year @knqyf263 !

Just following up on your PR once more :)

@@ -706,6 +717,7 @@ The defined ecosystems are:
| `Go` | The Go ecosystem; the `name` field is a Go module path. |
| `Hackage` | The Haskell package ecosystem. The `name` field is a Haskell package name as published on Hackage. |
| `Hex` | The package manager for the Erlang ecosystem; the `name` is a Hex package name. |
| `Kubernetes` | The Kubernetes ecosystem; the `name` field is a Kubernetes component name. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify this comment a bit more using your example in kubernetes-sigs/cve-feed-osv#9 (comment):

It's unclear if the name should be "kube-apiserver", or "k8s.io/apiserver". Is there some clarification we can make here on the expected naming scheme?

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

Successfully merging this pull request may close these issues.

2 participants