Skip to content

Commit dfad518

Browse files
committed
FSPT-342 - Add nginx sidecars to pre-prod envs for basic auth
Adding basic auth to Form Runner helps mitigate the security risks of disabling JWT authentication. To implement basic auth, we can copy what we already do in Pre-Award and Post-Award and use nginx sidecars, isolated from the application code. We set up sidecars on all pre-prod environments.
1 parent 43fcd56 commit dfad518

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

copilot/fsd-form-runner-adapter/manifest.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ variables:
6666
COPILOT_ENV: ${COPILOT_ENVIRONMENT_NAME}
6767
AWS_BUCKET_NAME:
6868
from_cfn: ${COPILOT_APPLICATION_NAME}-${COPILOT_ENVIRONMENT_NAME}-FormUploadsBucket
69-
BASIC_AUTH_ON: false
7069
NODE_CONFIG: '{"safelist": ["fsd-application-store", "fsd-pre-award-stores", "fsd-pre-award", "fsd-pre-award.${COPILOT_ENVIRONMENT_NAME}.pre-award.local"]}'
7170
NODE_ENV: production
7271
SINGLE_REDIS: true
@@ -84,14 +83,47 @@ environments:
8483
dev:
8584
variables:
8685
PREVIEW_MODE: true
87-
8886
count:
8987
spot: 2
88+
sidecars:
89+
nginx:
90+
port: 8087
91+
image:
92+
location: xscys/nginx-sidecar-basic-auth
93+
variables:
94+
FORWARD_PORT: 3009
95+
CLIENT_MAX_BODY_SIZE: 10m
96+
secrets:
97+
BASIC_AUTH_USERNAME: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/BASIC_AUTH_USERNAME
98+
BASIC_AUTH_PASSWORD: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/BASIC_AUTH_PASSWORD
99+
http:
100+
target_container: nginx
101+
healthcheck:
102+
path: /health-check
103+
port: 3009
104+
90105
test:
91106
variables:
92107
PREVIEW_MODE: true
93108
count:
94109
spot: 2
110+
sidecars:
111+
nginx:
112+
port: 8087
113+
image:
114+
location: xscys/nginx-sidecar-basic-auth
115+
variables:
116+
FORWARD_PORT: 3009
117+
CLIENT_MAX_BODY_SIZE: 10m
118+
secrets:
119+
BASIC_AUTH_USERNAME: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/BASIC_AUTH_USERNAME
120+
BASIC_AUTH_PASSWORD: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/BASIC_AUTH_PASSWORD
121+
http:
122+
target_container: nginx
123+
healthcheck:
124+
path: /health-check
125+
port: 3009
126+
95127
uat:
96128
variables:
97129
PREVIEW_MODE: true
@@ -106,12 +138,28 @@ environments:
106138
value: 80
107139
requests: 30
108140
response_time: 2s
141+
sidecars:
142+
nginx:
143+
port: 8087
144+
image:
145+
location: xscys/nginx-sidecar-basic-auth
146+
variables:
147+
FORWARD_PORT: 3009
148+
CLIENT_MAX_BODY_SIZE: 10m
149+
secrets:
150+
BASIC_AUTH_USERNAME: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/BASIC_AUTH_USERNAME
151+
BASIC_AUTH_PASSWORD: /copilot/${COPILOT_APPLICATION_NAME}/${COPILOT_ENVIRONMENT_NAME}/secrets/BASIC_AUTH_PASSWORD
152+
http:
153+
target_container: nginx
154+
healthcheck:
155+
path: /health-check
156+
port: 3009
157+
109158
prod:
110159
http:
111160
alias: ['forms.access-funding.levellingup.gov.uk', 'application-questions.access-funding.communities.gov.uk']
112161
variables:
113162
ACCESSIBILITY_STATEMENT_URL: "https://apply.access-funding.communities.gov.uk/accessibility_statement"
114-
BASIC_AUTH_ON: false
115163
CONTACT_US_URL: "https://apply.access-funding.communities.gov.uk/contact_us"
116164
COOKIE_POLICY_URL: "https://apply.access-funding.communities.gov.uk/cookie_policy"
117165
FEEDBACK_LINK: "https://apply.access-funding.communities.gov.uk/feedback"

0 commit comments

Comments
 (0)