Skip to content

Commit 8a6f1b8

Browse files
chore(security.txt): make compliant by adding an Expires field (#9005)
Co-Authored-By: Aviv Keller <me@aviv.sh> Signed-off-by: Kobi Hikri <kobi.hikri@gmail.com>
1 parent b42f4e0 commit 8a6f1b8

2 files changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Security Notes
2+
# Only selected Actions are allowed within this repository. Please refer to (https://github.com/nodejs/nodejs.org/settings/actions)
3+
# for the full list of available actions. If you want to add a new one, please reach out a maintainer with Admin permissions.
4+
# REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!!
5+
# AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags.
6+
7+
name: Bump security.txt Expiry
8+
9+
on:
10+
workflow_dispatch:
11+
schedule:
12+
- cron: '0 8 1 1 *' # once a year, Jan 1 at 08:00 UTC
13+
14+
permissions: {}
15+
16+
jobs:
17+
bump-expiry:
18+
runs-on: ubuntu-latest
19+
if: github.repository_owner == 'nodejs'
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: false
28+
29+
- name: Bump the Expires year
30+
id: update-expiry
31+
env:
32+
SECURITY_TXT: apps/site/public/.well-known/security.txt
33+
run: |
34+
set -euo pipefail
35+
old=$(sed -n 's/^Expires: *//p' "$SECURITY_TXT")
36+
year=${old%%-*}
37+
new="$((year + 1))${old#"$year"}"
38+
sed -i "s|^Expires: .*|Expires: ${new}|" "$SECURITY_TXT"
39+
{
40+
echo "old=${old}"
41+
echo "new=${new}"
42+
} >> "$GITHUB_OUTPUT"
43+
44+
- name: Open pull request
45+
uses: gr2m/create-or-update-pull-request-action@b65137ca591da0b9f43bad7b24df13050ea45d1b # v1.10.1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
with:
49+
update-pull-request-title-and-body: true
50+
branch: chore/update-security-txt
51+
body: |
52+
Updates the `Expiry` on our [`security.txt`](https://nodejs.org/.well-known/security.txt) from ${{ steps.update-expiry.outputs.old }} to ${{ steps.update-expiry.outputs.new }}
53+
54+
Before merging, please explicitly confirm that:
55+
- The security contact listed is still correct and actively monitored
56+
- The linked security policy is still accurate
57+
- The project's preferred vulnerability disclosure path has not changed
58+
59+
cc @nodejs/security-wg
60+
61+
Check this workflow's logs at ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}.
62+
commit-message: 'meta: update security `Expiry` from ${{ steps.update-expiry.outputs.old }} to ${{ steps.update-expiry.outputs.new }}'
63+
title: 'meta: update security `Expiry` from ${{ steps.update-expiry.outputs.old }} to ${{ steps.update-expiry.outputs.new }}'
64+
draft: true
65+
labels: security
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Contact: https://hackerone.com/nodejs
2+
Expires: 2027-06-30T23:59:59.000Z
23
Policy: https://github.com/nodejs/node/security/policy#security

0 commit comments

Comments
 (0)