Skip to content

Commit

Permalink
Allow to configure private extra vcl_recv for DGU
Browse files Browse the repository at this point in the history
We want to be able to temporarily alter request by adding private (stored in
govuk-fastly-secrets) rules to the subroutine.  This may be helpful when
handling with incidents.
  • Loading branch information
AgaDufrat committed Apr 9, 2024
1 parent 79770b4 commit 7e108f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/datagovuk/datagovuk.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ sub vcl_recv {
if (!req.http.Fastly-SSL) {
error 801 "Force SSL";
}

%{ if private_extra_vcl_recv != "" ~}
${private_extra_vcl_recv}
%{ endif ~}

${indent(2, file("${module_path}/../shared/_security_txt_request.vcl"))}

Expand Down
2 changes: 2 additions & 0 deletions modules/datagovuk/service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ locals {
gcs_mirror_prefix = null
gcs_mirror_probe = null
gcs_mirror_port = 443

private_extra_vcl_recv = ""
},
{ # computed values
formatted_allowed_ip_addresses = local.formatted_allowed_ips
Expand Down

0 comments on commit 7e108f8

Please sign in to comment.