Skip to content

Commit 65a8c70

Browse files
authored
Add instructions for updating security.txt in web-php (#12316)
[ci skip]
1 parent 3a4091c commit 65a8c70

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

docs/release-process.md

+19
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,25 @@ feature development that cannot go into the new version.
904904
there is only a single section about PHP X.Y.0, instead of individual
905905
sections for each pre-release.
906906
907+
4. On the announcement day for the initial stable version (or shortly before),
908+
update the `Expires` field in the <https://www.php.net/.well-known/security.txt>
909+
file. The `Expires` field should be set to the expected date of the next X.Y.0
910+
release (following the one currently being prepared), which is usually the
911+
fourth Thursday of November in the next year.
912+
913+
Following the recommendation of [RFC 9116](https://www.rfc-editor.org/rfc/rfc9116),
914+
we maintain an `Expires` time of about a year for our security policies. This
915+
provides security researchers with confidence they are using our most
916+
up-to-date reporting policies.
917+
918+
The `security.txt` file is located in the [web-php repository](https://github.com/php/web-php)
919+
under the `.well-known/` directory. We may make changes to this file at other
920+
times, as needed, but we will always advance the `Expires` timestamp on a
921+
yearly cadence, coinciding with our X.Y.0 releases.
922+
923+
Please see the instructions for
924+
[making changes to security.txt](security-policies.md#making-changes-to-securitytxt).
925+
907926
908927
## Prime the selection of release managers for the next version
909928

docs/security-policies.md

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# PHP Security Policies and Process
2+
3+
> [!IMPORTANT]
4+
> This is a meta document discussing PHP security policies and processes. For the actual
5+
> PHP security policy, see the PHP [Vulnerability Disclosure Policy][] document.
6+
7+
## PHP.net security.txt file
8+
9+
PHP.net includes a [security.txt][] file that complements the
10+
[Vulnerability Disclosure Policy][], aiding security vulnerability disclosure.
11+
This file implements the standard defined in [RFC 9116][], and more information
12+
is available at <https://securitytxt.org>.
13+
14+
RFC 9116 requires an `Expires` field in `security.txt`, and its recommendation
15+
is for the `Expires` field to be less than a year in the future. This provides
16+
security researchers with confidence they are using our most up-to-date
17+
reporting policies. To facilitate yearly updates to the `Expires` field and
18+
ensure freshness of the information in `security.txt`, the PHP release managers
19+
[update the `Expires` field as part of the X.Y.0 GA release][expires-update].
20+
21+
From time-to-time, we may update `security.txt` with new information, outside
22+
of the yearly changes to the `Expires` field.
23+
24+
### Making changes to security.txt
25+
26+
All changes to `security.txt` must be signed by a PHP release manager for a
27+
[currently supported version of PHP][supported-versions] (at the time of the
28+
changes). Release managers are the most logical choice for signing this file,
29+
since we already [publish their PGP keys][rm-pgp-keys].
30+
31+
To make changes to `security.txt`:
32+
33+
1. Go to your local clone of [web-php][].
34+
35+
```bash
36+
cd /path/to/web-php/.well-known
37+
```
38+
39+
2. Remove the PGP signature that wraps the body of `security.txt`:
40+
41+
```bash
42+
gpg --decrypt --output security.txt security.txt
43+
```
44+
45+
> [!NOTE]
46+
> To "decrypt" `security.txt`, you will need the public key of the release
47+
> manager who last signed it in your GPG keychain.
48+
49+
3. Make and save your changes to this file, e.g., update the `Expires` timestamp.
50+
51+
There should be a "Signed by" comment in the file that looks similar to this:
52+
53+
```
54+
# Signed by Ben Ramsey <ramsey@php.net> on 2023-09-28.
55+
```
56+
57+
Update this line with your name, the email address associated with the key
58+
you're using to sign the file, and the current date.
59+
60+
4. Sign your changes:
61+
62+
```bash
63+
gpg --clearsign --local-user YOU@php.net --output security.txt.asc security.txt
64+
```
65+
66+
> [!WARNING]
67+
> You cannot use `--output` to output the signature to the same file as the
68+
> input file or `gpg` will result in a signature wrapped around empty content.
69+
70+
5. Last, replace `security.txt` with `security.txt.asc` and commit your changes:
71+
72+
```bash
73+
mv security.txt.asc security.txt
74+
git commit security.txt
75+
```
76+
77+
> [!NOTE]
78+
> You may verify the signature with the following command:
79+
>
80+
> ```bash
81+
> gpg --verify security.txt
82+
> ```
83+
84+
[security.txt]: https://www.php.net/.well-known/security.txt
85+
[vulnerability disclosure policy]: https://github.com/php/php-src/security/policy
86+
[rfc 9116]: https://www.rfc-editor.org/rfc/rfc9116
87+
[expires-update]: release-process.md#preparing-for-the-initial-stable-version-php-xy0
88+
[supported-versions]: https://www.php.net/supported-versions.php
89+
[rm-pgp-keys]: https://www.php.net/gpg-keys.php
90+
[web-php]: https://github.com/php/web-php

0 commit comments

Comments
 (0)