generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 63
Add documentation for the official CVE feed #136
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
Open
mtardy
wants to merge
1
commit into
kubernetes:main
Choose a base branch
from
mtardy:pr/mtardy/docs-cve-feed
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+48
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Official CVE Feed | ||
|
||
The official CVE feed is separated into two main components: | ||
1. The scripts, that update a cloud bucket containing the feed. | ||
2. The website, rendering and serving the feed in various formats. | ||
|
||
## Scripts | ||
|
||
A script in the [kubernetes/sig-security](https://github.com/kubernetes/sig-security) | ||
repository under the [sig-security-tooling/cve-feed/hack](https://github.com/kubernetes/sig-security/tree/main/sig-security-tooling/cve-feed/hack) | ||
folder. This script is | ||
a bash script named `fetch-cve-feed.sh` that: | ||
- sets up the python3 environment; | ||
- generates the CVE feed file with `fetch-official-cve-feed.py`; | ||
- compares the sha256 of the newly generated file with the existing one; | ||
- if the sha256 changed, uploads the newly generated CVE feed file to the bucket. | ||
|
||
The `fetch-official-cve-feed.py` file executed by the `fetch-cve-feed.sh` is a | ||
python3 script that: | ||
- queries the GitHub API to fetch all the issues with the `official-cve-feed` | ||
label in the [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes/issues?q=is%3Aissue%20label%3Aofficial-cve-feed%20) | ||
repository; | ||
- formats the result with the appropriate JSON schema to be JSON feed | ||
compliant; | ||
- prints the output to stdout. | ||
|
||
These scripts are run regularly as a CronJob on the k8s infrastructure. | ||
|
||
In short, these scripts take the GitHub [kubernetes/kubernetes issues | ||
labeled with `official-cve-feed`](https://github.com/kubernetes/kubernetes/issues?q=is%3Aissue%20label%3Aofficial-cve-feed%20) | ||
as the input and generate a JSON feed file as an output in a cloud bucket. The | ||
output can be publicly fetched at [gs://k8s-cve-feed/](https://console.cloud.google.com/storage/browser/k8s-cve-feed) or [storage.googleapis.com/k8s-cve-feed](https://storage.googleapis.com/k8s-cve-feed/). | ||
mtardy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Website | ||
|
||
The main output of the official CVE feed is the HTML website page available on | ||
[k8s.io/docs/reference/issues-security/official-cve-feed](https://kubernetes.io/docs/reference/issues-security/official-cve-feed/) | ||
where you can also find links to the JSON and RSS feed formats. | ||
|
||
The corresponding HTML page is generated from the [official-cve-feed.md](https://github.com/kubernetes/website/blob/main/content/en/docs/reference/issues-security/official-cve-feed.md?plain=1) | ||
file from the [kubernetes/website](https://github.com/kubernetes/website) | ||
repository. It mainly calls the `cve-feed` shortcode that is defined in | ||
[website/layouts/shortcodes/cve-feed.html](https://github.com/kubernetes/website/blob/main/layouts/shortcodes/cve-feed.html) | ||
which consumes the JSON format by fetching the URL from the | ||
[`.Site.Params.cveFeedBucket`](https://github.com/kubernetes/website/blob/75f19fc9675d07fdbc724d02953d905ef7ca8619/hugo.toml#L168) | ||
and translating it to an HTML table. | ||
|
||
This page is thus updated every time the website is built. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a quick introduction on what the CVE feed is and who uses it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make an issue for this suggestion, and then get the PR merged; I think it'll be helpful to have something in, and then we can iterate on improving it.