HTTP header improvements #294
6 changed files with 0 additions and 7 deletions
|
@ -27,7 +27,6 @@ This will send additional HTTP security headers to the clients, including:
|
||||||
* `X-Permitted-Cross-Domain-Policies: "none"`
|
* `X-Permitted-Cross-Domain-Policies: "none"`
|
||||||
* `X-Frame-Options: "DENY"`
|
* `X-Frame-Options: "DENY"`
|
||||||
* `X-Content-Type-Options: "nosniff"`
|
* `X-Content-Type-Options: "nosniff"`
|
||||||
* `X-Download-Options: "noopen"`
|
|
||||||
|
|
||||||
A content security policy (CSP) will also be set:
|
A content security policy (CSP) will also be set:
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,6 @@ server {
|
||||||
add_header X-Frame-Options DENY;
|
add_header X-Frame-Options DENY;
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff;
|
||||||
add_header Referrer-Policy same-origin;
|
add_header Referrer-Policy same-origin;
|
||||||
add_header X-Download-Options noopen;
|
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
|
|
@ -104,7 +104,6 @@ server {
|
||||||
add_header X-Frame-Options DENY;
|
add_header X-Frame-Options DENY;
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff;
|
||||||
add_header Referrer-Policy same-origin;
|
add_header Referrer-Policy same-origin;
|
||||||
add_header X-Download-Options noopen;
|
|
||||||
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
|
|
@ -165,7 +165,6 @@ http protocol plerup { # Protocol for upstream akkoma server
|
||||||
match response header append "X-Frame-Options" value "DENY"
|
match response header append "X-Frame-Options" value "DENY"
|
||||||
match response header append "X-Content-Type-Options" value "nosniff"
|
match response header append "X-Content-Type-Options" value "nosniff"
|
||||||
match response header append "Referrer-Policy" value "same-origin"
|
match response header append "Referrer-Policy" value "same-origin"
|
||||||
match response header append "X-Download-Options" value "noopen"
|
|
||||||
match response header append "Content-Security-Policy" value "default-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://CHANGEME.tld; upgrade-insecure-requests;" # Modify "CHANGEME.tld" and set your instance's domain here
|
match response header append "Content-Security-Policy" value "default-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://CHANGEME.tld; upgrade-insecure-requests;" # Modify "CHANGEME.tld" and set your instance's domain here
|
||||||
match request header append "Connection" value "upgrade"
|
match request header append "Connection" value "upgrade"
|
||||||
#match response header append "Strict-Transport-Security" value "max-age=31536000; includeSubDomains" # Uncomment this only after you get HTTPS working.
|
#match response header append "Strict-Transport-Security" value "max-age=31536000; includeSubDomains" # Uncomment this only after you get HTTPS working.
|
||||||
|
|
|
@ -47,7 +47,6 @@ def headers do
|
||||||
{"x-frame-options", "DENY"},
|
{"x-frame-options", "DENY"},
|
||||||
{"x-content-type-options", "nosniff"},
|
{"x-content-type-options", "nosniff"},
|
||||||
{"referrer-policy", referrer_policy},
|
{"referrer-policy", referrer_policy},
|
||||||
{"x-download-options", "noopen"},
|
|
||||||
{"content-security-policy", csp_string()},
|
{"content-security-policy", csp_string()},
|
||||||
{"permissions-policy", "interest-cohort=()"}
|
{"permissions-policy", "interest-cohort=()"}
|
||||||
]
|
]
|
||||||
|
|
|
@ -17,7 +17,6 @@ test "it sends CSP headers when enabled", %{conn: conn} do
|
||||||
refute Conn.get_resp_header(conn, "x-permitted-cross-domain-policies") == []
|
refute Conn.get_resp_header(conn, "x-permitted-cross-domain-policies") == []
|
||||||
refute Conn.get_resp_header(conn, "x-frame-options") == []
|
refute Conn.get_resp_header(conn, "x-frame-options") == []
|
||||||
refute Conn.get_resp_header(conn, "x-content-type-options") == []
|
refute Conn.get_resp_header(conn, "x-content-type-options") == []
|
||||||
refute Conn.get_resp_header(conn, "x-download-options") == []
|
|
||||||
refute Conn.get_resp_header(conn, "referrer-policy") == []
|
refute Conn.get_resp_header(conn, "referrer-policy") == []
|
||||||
refute Conn.get_resp_header(conn, "content-security-policy") == []
|
refute Conn.get_resp_header(conn, "content-security-policy") == []
|
||||||
end
|
end
|
||||||
|
@ -155,7 +154,6 @@ test "it does not send CSP headers when disabled", %{conn: conn} do
|
||||||
assert Conn.get_resp_header(conn, "x-permitted-cross-domain-policies") == []
|
assert Conn.get_resp_header(conn, "x-permitted-cross-domain-policies") == []
|
||||||
assert Conn.get_resp_header(conn, "x-frame-options") == []
|
assert Conn.get_resp_header(conn, "x-frame-options") == []
|
||||||
assert Conn.get_resp_header(conn, "x-content-type-options") == []
|
assert Conn.get_resp_header(conn, "x-content-type-options") == []
|
||||||
assert Conn.get_resp_header(conn, "x-download-options") == []
|
|
||||||
assert Conn.get_resp_header(conn, "referrer-policy") == []
|
assert Conn.get_resp_header(conn, "referrer-policy") == []
|
||||||
assert Conn.get_resp_header(conn, "content-security-policy") == []
|
assert Conn.get_resp_header(conn, "content-security-policy") == []
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue