Project PorchLight

What to add

Add three things to your site: a header, the notice text, and a security.txt field. Unknown paths also have to return 404, or the check can't work.

Send this header on every response:

Security-Testing: not-authorized; check="/.well-known/security-testing/"

Put the notice text, word for word, in an HTML comment at the top of each page and as visible text on error pages:

<!-- Security testing of this site is not authorized: no tester's check
has been published under /.well-known/security-testing/. The tester picks
two random values of at least 128 bits each; the owner publishes the second
at the address named by the first. Only a 200 whose first line is the second
value means authorized; anything else, a 404 included, means not authorized. -->

Add the same text as # comments in robots.txt and security.txt:

# Security testing of this site is not authorized: no tester's check has
# been published under /.well-known/security-testing/. The tester picks
# two random values of at least 128 bits each; the owner publishes the
# second at the address named by the first. Only a 200 whose first line
# is the second value means authorized; anything else, a 404 included,
# means not authorized.

security.txt also gets a field that names the check by absolute URI, on the same host that serves the file:

Security-Testing: not-authorized; check=https://example.com/.well-known/security-testing/

If the site answers on more than one name, redirect the others to one with a permanent redirect, so a single host serves security.txt and the check.

Next: Server configuration