Skip to content

Commit

Permalink
GH-157: Document vulnerability disclosure mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparrow0hawk authored and markhobson committed Sep 25, 2024
1 parent fde8602 commit e4a3860
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion schemes/views/legal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask import Blueprint, render_template
from flask import Blueprint, Response, render_template, send_from_directory

from schemes.views.auth.basic import basic_auth

Expand All @@ -21,3 +21,8 @@ def accessibility() -> str:
@basic_auth
def cookies() -> str:
return render_template("legal/cookies.html")


@bp.get("/.well-known/security.txt")
def security() -> Response:
return send_from_directory(directory="views/templates/legal", path="security.txt")
3 changes: 3 additions & 0 deletions schemes/views/templates/legal/security.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Contact: https://vulnerability-reporting.service.security.gov.uk/

Expires: 2025-01-31T00:00:00Z
5 changes: 5 additions & 0 deletions tests/integration/test_legal.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ def test_cookies(self, client: FlaskClient) -> None:

assert cookies_page.is_visible
assert cookies_page.title == "Cookies - Update your capital schemes - Active Travel England - GOV.UK"

def test_security(self, client: FlaskClient) -> None:
response = client.get("/.well-known/security.txt")

assert response.status_code == 200 and response.content_type == "text/plain; charset=utf-8"

0 comments on commit e4a3860

Please sign in to comment.