Skip to content

Add self-updating expiry field to security.txt#28740

Merged
NovemberTang merged 9 commits into
mainfrom
nt/update-expiry
May 28, 2026
Merged

Add self-updating expiry field to security.txt#28740
NovemberTang merged 9 commits into
mainfrom
nt/update-expiry

Conversation

@NovemberTang
Copy link
Copy Markdown
Contributor

@NovemberTang NovemberTang commented Apr 20, 2026

What is the value of this and can you measure success?

Following up to #28706, a security.txt requires two fields to be valid. Contact: and Expires: Maintaining the Expires: field isn't much work, but it is one additional thing to remember to do, so this PR (along with introducing it), adds a cron job to update that field annually, reducing the burden on dev teams. It sets the expiry date 13 months into the future. Typically people recommend updating this every 12 months, I've added a month just in case reviews are slow.

What does this change?

  1. Runs a small script once a year, setting the expiry date of the security.txt file to a year in the future. For example, on the 30th April 2027, the expiry date will be set to 1st June 2028.

This has been written in JS for maintainability reasons - it's a lot shorter and more readable than the bash alternative. This doesn't really pose a security risk as I am using standard library (which is already installed on GitHub runners) with no dependencies, and accept no user input.

  1. Assigns infosec & security as co-owners of the relevant files so that those teams can approve and merge these PRs, without burdening the frontend maintainers.

In order for this PR to be valid, the codeowner teams would require explicit write access to the repo, which doesn't represent a significant expansion of anyone's permissions. I can do this after the PR is approved, or we can talk about alternatives.

Screenshots

You can see an example of the change made by the bot in this PR commit

Checklist

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

@NovemberTang NovemberTang added the feature Departmental tracking: work on a new feature label Apr 20, 2026
@NovemberTang NovemberTang marked this pull request as ready for review April 21, 2026 07:19
@NovemberTang NovemberTang requested a review from a team as a code owner April 21, 2026 07:19
Comment thread security-txt.py Outdated
Comment thread security-txt.py Outdated
Copy link
Copy Markdown
Contributor Author

@NovemberTang NovemberTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After moving the file and migrating to JS, you can see the output here

@NovemberTang NovemberTang requested a review from SiAdcock May 15, 2026 09:03
Comment thread .github/workflows/security-txt.yaml
Copy link
Copy Markdown
Contributor

@SiAdcock SiAdcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! One small question around dates.

@NovemberTang NovemberTang merged commit 9dba306 into main May 28, 2026
11 checks passed
@NovemberTang NovemberTang deleted the nt/update-expiry branch May 28, 2026 15:56
@gu-prout
Copy link
Copy Markdown

gu-prout Bot commented May 28, 2026

Seen on ADMIN-PROD (merged by @NovemberTang 9 minutes and 7 seconds ago)

@gu-prout
Copy link
Copy Markdown

gu-prout Bot commented May 28, 2026

Seen on FRONTS-PROD (merged by @NovemberTang 9 minutes and 15 seconds ago)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature Seen-on-ADMIN-PROD Seen-on-FRONTS-PROD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants