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

Render a page for each known K8s vulnerability using a content adapter #46623

Open
Tracked by #1
sftim opened this issue Jun 2, 2024 · 14 comments
Open
Tracked by #1

Render a page for each known K8s vulnerability using a content adapter #46623

sftim opened this issue Jun 2, 2024 · 14 comments
Assignees
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes kind/feature Categorizes issue or PR as related to a new feature. sig/security Categorizes an issue or PR as relevant to SIG Security. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@sftim
Copy link
Contributor

sftim commented Jun 2, 2024

This is a Feature Request

What would you like to be added
Revise https://kubernetes.io/docs/reference/issues-security/official-cve-feed/ to have a page about each vulnerability, rendered using a content adapter.

Ideally, allow contributors to provide dedicated and specialized content for a subset of vulnerabilities, falling back to auto rendering for the remainder.

For example:

Why is this needed
We can provide permalinks in our comms around vulnerabilities.

Comments
/area web-development
/sig security

We would need to be using Hugo v0.126 or later.

Relevant to kubernetes/sig-security#1
Prompted by #46426 (comment)

@sftim sftim added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 2, 2024
@k8s-ci-robot k8s-ci-robot added area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes sig/security Categorizes an issue or PR as relevant to SIG Security. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 2, 2024
@PushkarJ
Copy link
Member

Included this as a feature in beta -> GA work as a graduation criteria.

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 28, 2024
@PushkarJ
Copy link
Member

Some ideas on how to implement this:

This repo https://github.com/aquasecurity/vuln-list-k8s is being migrated to k-sigs org: kubernetes/org#4873 as a community owned repo. But for the purposes of discussion let's use the repo in its current location.

Step 1: As input to content adapter we get a list of OSV JSON files from Github API: https://api.github.com/repos/aquasecurity/vuln-list-k8s/contents/upstream

Sample output:

  {
    "name": "CVE-2017-1002102.json",
    "path": "upstream/CVE-2017-1002102.json",
    "sha": "fb991a6b68caac15879c2eefebf1a72249d3ccfe",
    "size": 1466,
    "url": "https://api.github.com/repos/aquasecurity/vuln-list-k8s/contents/upstream/CVE-2017-1002102.json?ref=main",
    "html_url": "https://github.com/aquasecurity/vuln-list-k8s/blob/main/upstream/CVE-2017-1002102.json",
    "git_url": "https://api.github.com/repos/aquasecurity/vuln-list-k8s/git/blobs/fb991a6b68caac15879c2eefebf1a72249d3ccfe",
    "download_url": "https://raw.githubusercontent.com/aquasecurity/vuln-list-k8s/main/upstream/CVE-2017-1002102.json",
    "type": "file",
    "_links": {
      "self": "https://api.github.com/repos/aquasecurity/vuln-list-k8s/contents/upstream/CVE-2017-1002102.json?ref=main",
      "git": "https://api.github.com/repos/aquasecurity/vuln-list-k8s/git/blobs/fb991a6b68caac15879c2eefebf1a72249d3ccfe",
      "html": "https://github.com/aquasecurity/vuln-list-k8s/blob/main/upstream/CVE-2017-1002102.json"
    }
  }

Step 2: Iterate each file name with absolute path using the key download_url and create a new dynamic page for each CVE
Step 3: https://kubernetes.io/example/security/CVE-2021-25749.json points to the OSV format json file
Step 4: https://kubernetes.io/example/security/CVE-2021-25749 points to an auto-generated page that can be customized depending on for example whether a CVE is unfixed or not.

@jbiers
Copy link
Contributor

jbiers commented Jun 30, 2024

I'm willing to dig into this this issue if no one else is meant to take it @PushkarJ @sftim

@sftim
Copy link
Contributor Author

sftim commented Jun 30, 2024

Help is welcome @jbiers!

@sftim
Copy link
Contributor Author

sftim commented Jun 30, 2024

Step 1: As input to content adapter we get a list of OSV JSON files from Github API: https://api.github.com/repos/aquasecurity/vuln-list-k8s/contents/upstream

It's much easier if the machine readable feed is one file, rather than lots. If there are lots of files, we first need a single file with a list of the individual files to pull.

We can add the OSV data in a follow-up PR.

@sftim
Copy link
Contributor Author

sftim commented Jun 30, 2024

Also, we'd prefer to avoid needing API tokens for GitHub as part of the site build; it adds extra friction for new contributors.

@sftim
Copy link
Contributor Author

sftim commented Jun 30, 2024

@jbiers
Copy link
Contributor

jbiers commented Jul 1, 2024

/assign

@PushkarJ
Copy link
Member

PushkarJ commented Jul 9, 2024

The repository with OSV files is now migrated within k8s-sigs org: https://github.com/kubernetes-sigs/cve-feed-osv

@jbiers
Copy link
Contributor

jbiers commented Jul 17, 2024

@sftim I have a question regarding the path where the CVE files should be created. Your suggestion was https://kubernetes.io/example/security/CVE-2019-11254, but as I understand currently the examples directory only contains example manifests in the form of yaml files.

My question is if it makes semantic sense to have the CVEs in this path and not somewhere like https://kubernetes.io/docs/reference/issues-security/cves/cve-2017-1002101/ or similar. If done this way, we could simply use the layouts currently used in other documentation pages, while in the /examples/ path a new one would have to be created.

Let me know if I did not make myself clear enough here 😄

@sftim
Copy link
Contributor Author

sftim commented Jul 19, 2024

Oh, the string example was just an example! You should pick an actual URL path that makes sense to SIG Security.

The directory you use does not not need to exist in the Git source code.

@sftim
Copy link
Contributor Author

sftim commented Jul 19, 2024

If you find you want a new layout, SIG Docs can help out with that.

@sftim
Copy link
Contributor Author

sftim commented Aug 13, 2024

@jbiers did you decide on what path you'd like the pages to have? You could pick some actual CVE IDs and document the URL that you'd like them to have, to illustrate the pattern you have in mind.

@sftim
Copy link
Contributor Author

sftim commented Dec 13, 2024

Help with this issue is very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-development Issues or PRs related to the kubernetes.io's infrastructure, design, or build processes kind/feature Categorizes issue or PR as related to a new feature. sig/security Categorizes an issue or PR as relevant to SIG Security. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants