Skip to content

Commit

Permalink
Forbid connections from non-production environments unless on IP allo…
Browse files Browse the repository at this point in the history
…wlist
  • Loading branch information
kentsanggds committed Sep 12, 2024
1 parent fa87013 commit 443fd1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions datagovuk/datagovuk.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ acl allowed_ip_addresses {
sub vcl_recv {
${indent(2, file("${module_path}/../shared/_boundary_headers.vcl.tftpl"))}

%{ if environment != "production" ~}
# Only allow connections from allowed IP addresses in non production environments
if (! (req.http.True-Client-IP ~ allowed_ip_addresses)) {
error 403 "Forbidden";
}
%{ endif ~}


if (fastly.ff.visits_this_service == 0 && req.restarts == 0) {
set req.http.Client-JA3 = tls.client.ja3_md5;

Expand Down

0 comments on commit 443fd1f

Please sign in to comment.