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

Merged
merged 4 commits into from
Jan 30, 2025
Merged

Add Kubernetes ecosystem #319

merged 4 commits into from
Jan 30, 2025

Conversation

knqyf263
Copy link
Contributor

@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.

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 !

docs/schema.md Outdated
@@ -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
Contributor 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
Contributor 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
Contributor 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 non-Go projects under the Kubernetes organization. However, I just went through the Kubernetes SIGs organization and found some non-Go projects.

I didn't find a document on which organizations the K8s maintainers are responsible, but given that a vulnerability in kubernetes-sigs/azure-file-csi-driver is announced, I presume SIGs projects can issue advisories.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, then it seems then the common denominator is just a git repo? i.e.

{
  "package": {
    "ecosystem": "Kubernetes",
    "name": "https://github.com/kubernetes-sigs/blixt"
}

{
  "package": {
    "ecosystem": "Kubernetes",
    "name": "https://github.com/kubernetes/apiserver"
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Their primary languages are not Go, but they have go.mod with Go module names.

And there are 184 repositories under kubernetes-sigs, but I found only three non-Go ones. Therefore, it's a very rare case.

"If the component has a Go module name, then the package name is the Go module name. Otherwise, use a git repo."

Copy link
Contributor

Choose a reason for hiding this comment

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

Their primary languages are not Go, but they have go.mod with Go module names.

Interesting..

"If the component has a Go module name, then the package name is the Go module name. Otherwise, use a git repo."

In the case of these 3 exceptions, since a go.mod exists, it sounds like should also use the Go module name under this definition?

Since there is no case where there is a no go.mod today, I'd suggest just keeping this simple for now. We can always add additional cases later to the schema when we need them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the case of these 3 exceptions, since a go.mod exists, it sounds like should also use the Go module name under this definition?

Exactly. That's what I wanted to express in the description.

Since there is no case where there is a no go.mod today, I'd suggest just keeping this simple for now. We can always add additional cases later to the schema when we need them.

It sounds reasonable to me. Updated in 01721af.

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 :)

docs/schema.md Outdated
@@ -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?

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.

thanks! just a suggested rewording to make this a bit simpler

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.

(not sure where my suggestion went. reapplying)

knqyf263 and others added 2 commits January 29, 2025 12:44
Co-authored-by: Oliver Chang <[email protected]>
Signed-off-by: Teppei Fukuda <[email protected]>
@oliverchang oliverchang merged commit d868137 into ossf:main Jan 30, 2025
1 check passed
@knqyf263 knqyf263 deleted the add_k8s branch January 30, 2025 05:48
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