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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ aside:
show_edit_on_github: true
---

**Version 1.6.7 (Sep 16, 2024)**
**Version 1.6.8 (Dec 4, 2024)**

Original authors:
- Oliver Chang ([email protected])
Expand Down Expand Up @@ -288,6 +288,17 @@ The defined database prefixes and their "home" databases are:
</ul>
</td>
</tr>
<tr>
<td><code>KUBE</code></td>
<td><a href="https://github.com/kubernetes-sigs/cve-feed-osv">Kubernetes Official CVE Feed</a></td>
<td>
<ul>
<li>How to contribute: <a href="https://github.com/kubernetes-sigs/cve-feed-osv/blob/main/CONTRIBUTING.md">https://github.com/kubernetes-sigs/cve-feed-osv/blob/main/CONTRIBUTING.md</a></li>
<li>Source URL: <code>https://kubernetes.io/docs/reference/issues-security/official-cve-feed/index.json</code></li>
<li>OSV Formatted URL: <code>https://raw.githubusercontent.com/kubernetes-sigs/cve-feed-osv/blob/main/vulns/&lt;ID&gt;.json</code></li>
</ul>
</td>
</tr>
<tr>
<td><code>LBSEC</code></td>
<td><a href="https://github.com/loopbackio/security/tree/main/advisories">LoopBack Advisory Database</a></td>
Expand Down Expand Up @@ -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
Contributor

Choose a reason for hiding this comment

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

I think we should define them, at least for the ones where we know there is a vulnerability database published. OSV's goal is to make vulnerability advisories machine readable and consistent.

| `Linux` | The Linux kernel. The only supported `name` is `Kernel`. |
| `Mageia` | The Mageia Linux package ecosystem; the `name` is the name of the source package. The ecosystem string must have a `:<RELEASE-NUMBER>` suffix to scope the package to a particular Mageia release. Eg `Mageia:9`. |
| `Maven` | The Maven Java package ecosystem. The `name` field is a Maven package name in the format `groupId:artifactId`. The ecosystem string might optionally have a `:<REMOTE-REPO-URL>` suffix to denote the remote repository URL that best represents the source of truth for this package, without a trailing slash (e.g. `Maven:https://maven.google.com`). If this is omitted, this is assumed to be the Maven Central repository (`https://repo.maven.apache.org/maven2`). |
Expand Down
2 changes: 2 additions & 0 deletions tools/osv-linter/internal/pkgchecker/ecosystems.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ func ExistsInEcosystem(pkg string, ecosystem string) bool {
return true
case "Hex":
return true
case "Kubernetes":
return true
case "Linux":
return true
case "Maven":
Expand Down
3 changes: 2 additions & 1 deletion validation/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@
"Go",
"Hackage",
"Hex",
"Kubernetes",
"Linux",
"Mageia",
"Maven",
Expand Down Expand Up @@ -350,7 +351,7 @@
"type": "string",
"title": "Currently supported home database identifier prefixes",
"description": "These home databases are also documented at https://ossf.github.io/osv-schema/#id-modified-fields",
"pattern": "^(ASB-A|PUB-A|ALSA|ALBA|ALEA|BIT|CGA|CURL|CVE|DSA|DLA|ELA|DTSA|GHSA|GO|GSD|HSEC|LBSEC|MAL|OSV|openSUSE-SU|PHSA|PSF|PYSEC|RHBA|RHEA|RHSA|RLSA|RXSA|RSEC|RUSTSEC|SUSE-[SRFO]U|UBUNTU|USN)-"
"pattern": "^(ASB-A|PUB-A|ALSA|ALBA|ALEA|BIT|CGA|CURL|CVE|DSA|DLA|ELA|DTSA|GHSA|GO|GSD|HSEC|KUBE|LBSEC|MAL|OSV|openSUSE-SU|PHSA|PSF|PYSEC|RHBA|RHEA|RHSA|RLSA|RXSA|RSEC|RUSTSEC|SUSE-[SRFO]U|UBUNTU|USN)-"
},
"severity": {
"type": [
Expand Down