Skip to content

Commit ad7b108

Browse files
committed
CVE feed: add RSS feed format
Add tabs to display the various feeds thanks to sftim!
1 parent 1d514a5 commit ad7b108

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

content/en/docs/reference/issues-security/official-cve-feed.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
title: Official CVE Feed
3+
linkTitle: CVE feed
34
weight: 25
45
outputs:
56
- json
6-
- html
7+
- html
8+
- rss
79
layout: cve-feed
810
---
911

@@ -14,19 +16,25 @@ the Kubernetes Security Response Committee. See
1416
[Kubernetes Security and Disclosure Information](/docs/reference/issues-security/security/)
1517
for more details.
1618

17-
The Kubernetes project publishes a programmatically accessible
18-
[JSON Feed](/docs/reference/issues-security/official-cve-feed/index.json) of
19-
published security issues. You can access it by executing the following command:
20-
21-
{{< comment >}}
22-
`replace` is used to bypass known issue with rendering ">"
23-
: https://github.com/gohugoio/hugo/issues/7229 in JSON layouts template
24-
`layouts/_default/cve-feed.json`
25-
{{< /comment >}}
19+
The Kubernetes project publishes a programmatically accessible feed of published
20+
security issues in [JSON feed](/docs/reference/issues-security/official-cve-feed/index.json)
21+
and [RSS feed](/docs/reference/issues-security/official-cve-feed/feed.xml)
22+
formats. You can access it by executing the following commands:
2623

24+
{{< tabs name="CVE feeds" >}}
25+
{{% tab name="JSON feed" %}}
26+
[Link to JSON format](/docs/reference/issues-security/official-cve-feed/index.json)
2727
```shell
2828
curl -Lv https://k8s.io/docs/reference/issues-security/official-cve-feed/index.json
2929
```
30+
{{% /tab %}}
31+
{{% tab name="RSS feed" %}}
32+
[Link to RSS format](/docs/reference/issues-security/official-cve-feed/feed.xml)
33+
```shell
34+
curl -Lv https://k8s.io/docs/reference/issues-security/official-cve-feed/feed.xml
35+
```
36+
{{% /tab %}}
37+
{{< /tabs >}}
3038

3139
{{< cve-feed >}}
3240

layouts/_default/cve-feed.rss.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{ $feed := getJSON .Site.Params.cveFeedBucket -}}
2+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
3+
<channel>
4+
<title>{{ $feed.title }}</title>
5+
<link>{{ .Site.BaseURL }}docs/reference/issues-security/official-cve-feed/</link>
6+
<description>{{ $feed.description }}</description>
7+
<generator>Hugo -- gohugo.io</generator>
8+
<language>en-US</language>
9+
<copyright>{{ .Site.Params.Copyright_k8s }}</copyright>
10+
<lastBuildDate>{{ time.Format "Mon, 02 Jan 2006 15:04:05 -0700" $feed._kubernetes_io.updated_at | safeHTML }}</lastBuildDate>
11+
{{ with .OutputFormats.Get "RSS" -}}
12+
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
13+
{{ end -}}
14+
{{ range $feed.items -}}
15+
<item>
16+
<title>{{ .id }}</title>
17+
<link>{{ .url }}</link>
18+
<pubDate>{{ time.Format "Mon, 02 Jan 2006 15:04:05 -0700" .date_published | safeHTML }}</pubDate>
19+
<guid>{{ .external_url }}</guid>
20+
<description>{{ htmlEscape .summary }}</description>
21+
</item>
22+
{{ end -}}
23+
</channel>
24+
</rss>
25+

0 commit comments

Comments
 (0)