-
Notifications
You must be signed in to change notification settings - Fork 95
Add RFC 9116 security.txt to static/.well-known/ #599
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,4 @@ _data/modules.json | |
| .idea/* | ||
| tmp/* | ||
| static/debug | ||
| static/.well-known/security.txt | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||
| #!/bin/bash | ||||||
| # See README for usage | ||||||
| # This file will generate static/.well-known/security.txt (RFC 9116). | ||||||
| # | ||||||
| # The Expires field is derived from the build date rather than committed, so it | ||||||
| # always sits one year past the last site build and cannot silently go stale. | ||||||
|
|
||||||
| # first check to make sure there are arguments | ||||||
| if [ -z "$1" ]; then | ||||||
| echo "You must supply a path to the site root as the first argument" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| # check for validity of this argument as a path | ||||||
| if [ ! -d "$1" ]; then | ||||||
| echo "The site root must exist and be a valid path" | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| SITE_ROOT="$1" | ||||||
| WELL_KNOWN="${SITE_ROOT}/static/.well-known" | ||||||
|
|
||||||
| # one year past this build, in the RFC 3339 form RFC 9116 requires | ||||||
| if date -u -d '+1 year' >/dev/null 2>&1; then | ||||||
| EXPIRES=$(date -u -d '+1 year' +%Y-%m-%dT%H:%M:%SZ) # GNU date | ||||||
| else | ||||||
| EXPIRES=$(date -u -v+1y +%Y-%m-%dT%H:%M:%SZ) # BSD date | ||||||
| fi | ||||||
|
|
||||||
| mkdir -p "$WELL_KNOWN" | ||||||
|
|
||||||
| cat > "${WELL_KNOWN}/security.txt" <<EOF | ||||||
| # Valkey security contact — see https://github.com/valkey-io/valkey/security/policy | ||||||
| # Generated at build time by build/init-security-txt.sh — do not edit by hand. | ||||||
| Contact: mailto:security@lists.valkey.io | ||||||
| Expires: ${EXPIRES} | ||||||
| Preferred-Languages: en | ||||||
| Canonical: https://valkey.io/.well-known/security.txt | ||||||
| Policy: https://github.com/valkey-io/valkey/security/policy | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The generated
Suggested change
ArtifactsRepro: security.txt generation output showing indirect Policy line
Repro: Policy line verification script
Repro: Policy line assertion output
Repro: HTTP comparison script for generated and concrete policy URLs
Repro: HTTP status and response trace for generated and concrete policy URLs
|
||||||
| EOF | ||||||
|
Comment on lines
+24
to
+40
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Fail the build when generation fails. Without Add 🤖 Prompt for AI Agents |
||||||
|
|
||||||
| echo "Wrote ${WELL_KNOWN}/security.txt (Expires: ${EXPIRES})" | ||||||
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.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: valkey-io/valkey-io.github.io
Length of output: 2976
🌐 Web query:
RFC 9116 security.txt Expires field recommended expiration less than one year💡 Result:
RFC 9116 explicitly recommends that the "Expires" field in a security.txt file be set to a date and time less than one year in the future [1][2]. This recommendation is intended to help prevent the use of stale information [1][2]. Because inaccurate or outdated security contact information can result in security reports being lost or misdirected—potentially leaving vulnerabilities exposed—the standard emphasizes the importance of keeping the information current [2]. The "Expires" field serves as a mechanism to signal to security researchers when the information in the file is no longer considered valid [1][2]. The field is mandatory and must appear exactly once in the file [1][2].
Citations:
Keep
Expiresstrictly below one year.RFC 9116 recommends security.txt expirations less than one year in the future.
+1 yearcan be 366 days across a leap year; use a fixed interval such as+364 daysinstead of a calendar year shift.🤖 Prompt for AI Agents
Source: MCP tools