Skip to content

Commit 9104079

Browse files
feat: security post release blogpost (#785)
* feat: post-release blogpost * fix: appending on existing pre-release * fix: reworded to post release * feat: update vulnerabilities.json * fix: if no changes dont update * fix: comments from release * fix: improved strcture * fix: download section --------- Co-authored-by: Rafael Gonzaga <[email protected]>
1 parent 723cd7f commit 9104079

File tree

5 files changed

+258
-29
lines changed

5 files changed

+258
-29
lines changed

components/git/security.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ const securityOptions = {
3939
'request-cve': {
4040
describe: 'Request CVEs for a security release',
4141
type: 'boolean'
42+
},
43+
'post-release': {
44+
describe: 'Create the post-release announcement',
45+
type: 'boolean'
4246
}
4347
};
4448

@@ -49,34 +53,34 @@ export function builder(yargs) {
4953
return yargs.options(securityOptions)
5054
.example(
5155
'git node security --start',
52-
'Prepare a security release of Node.js')
56+
'Prepare a security release of Node.js'
57+
)
5358
.example(
5459
'git node security --sync',
5560
'Synchronize an ongoing security release with HackerOne'
5661
)
5762
.example(
5863
'git node security --update-date=YYYY/MM/DD',
5964
'Updates the target date of the security release'
60-
)
61-
.example(
65+
).example(
6266
'git node security --add-report=H1-ID',
6367
'Fetches HackerOne report based on ID provided and adds it into vulnerabilities.json'
64-
)
65-
.example(
68+
).example(
6669
'git node security --remove-report=H1-ID',
6770
'Removes the Hackerone report based on ID provided from vulnerabilities.json'
68-
)
69-
.example(
71+
).example(
7072
'git node security --pre-release',
7173
'Create the pre-release announcement on the Nodejs.org repo'
7274
).example(
7375
'git node security --notify-pre-release',
7476
'Notifies the community about the security release'
75-
)
76-
.example(
77+
).example(
7778
'git node security --request-cve',
7879
'Request CVEs for a security release of Node.js based on' +
7980
' the next-security-release/vulnerabilities.json'
81+
).example(
82+
'git node security --post-release' +
83+
'Create the post-release announcement on the Nodejs.org repo'
8084
);
8185
}
8286

@@ -105,6 +109,9 @@ export function handler(argv) {
105109
if (argv['request-cve']) {
106110
return requestCVEs(argv);
107111
}
112+
if (argv['post-release']) {
113+
return createPostRelease(argv);
114+
}
108115
yargsInstance.showHelp();
109116
}
110117

@@ -146,7 +153,14 @@ async function requestCVEs() {
146153
return hackerOneCve.requestCVEs();
147154
}
148155

149-
async function startSecurityRelease(argv) {
156+
async function createPostRelease() {
157+
const logStream = process.stdout.isTTY ? process.stdout : process.stderr;
158+
const cli = new CLI(logStream);
159+
const blog = new SecurityBlog(cli);
160+
return blog.createPostRelease();
161+
}
162+
163+
async function startSecurityRelease() {
150164
const logStream = process.stdout.isTTY ? process.stdout : process.stderr;
151165
const cli = new CLI(logStream);
152166
const release = new PrepareSecurityRelease(cli);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
date: %ANNOUNCEMENT_DATE%
3+
category: vulnerability
4+
title: %RELEASE_DATE% Security Releases
5+
slug: %SLUG%
6+
layout: blog-post
7+
author: %AUTHOR%
8+
---
9+
10+
## Security releases available
11+
12+
Updates are now available for the %AFFECTED_VERSIONS% Node.js release lines for the
13+
following issues.
14+
%DEPENDENCY_UPDATES%
15+
%REPORTS%
16+
## Downloads and release details
17+
18+
%DOWNLOADS%

lib/github/templates/security-pre-release.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The Node.js project will release new versions of the %AFFECTED_VERSIONS%
1313
releases lines on or shortly after, %RELEASE_DATE% in order to address:
1414

1515
%VULNERABILITIES%
16-
%OPENSSL_UPDATES%
16+
1717
## Impact
1818

1919
%IMPACT%
@@ -28,7 +28,7 @@ Releases will be available on, or shortly after, %RELEASE_DATE%.
2828

2929
## Contact and future updates
3030

31-
The current Node.js security policy can be found at https://nodejs.org/en/security/.
32-
Please follow the process outlined in https://github.com/nodejs/node/blob/master/SECURITY.md if you wish to report a vulnerability in Node.js.
31+
The current Node.js security policy can be found at <https://nodejs.org/en/security/>.
32+
Please follow the process outlined in <https://github.com/nodejs/node/blob/master/SECURITY.md> if you wish to report a vulnerability in Node.js.
3333

34-
Subscribe to the low-volume announcement-only nodejs-sec mailing list at https://groups.google.com/forum/#!forum/nodejs-sec to stay up to date on security vulnerabilities and security-related releases of Node.js and the projects maintained in the nodejs GitHub organization.
34+
Subscribe to the low-volume announcement-only nodejs-sec mailing list at <https://groups.google.com/forum/#!forum/nodejs-sec> to stay up to date on security vulnerabilities and security-related releases of Node.js and the projects maintained in the nodejs GitHub organization.

lib/security-release/security-release.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ export const PLACEHOLDERS = {
2020
annoucementDate: '%ANNOUNCEMENT_DATE%',
2121
slug: '%SLUG%',
2222
affectedVersions: '%AFFECTED_VERSIONS%',
23-
openSSLUpdate: '%OPENSSL_UPDATES%',
2423
impact: '%IMPACT%',
25-
vulnerabilities: '%VULNERABILITIES%'
24+
vulnerabilities: '%VULNERABILITIES%',
25+
reports: '%REPORTS%',
26+
author: '%AUTHOR%',
27+
dependencyUpdates: '%DEPENDENCY_UPDATES%',
28+
downloads: '%DOWNLOADS%'
2629
};
2730

2831
export function checkRemote(cli, repository) {

0 commit comments

Comments
 (0)