-
Notifications
You must be signed in to change notification settings - Fork 4
Rotating secrets
David McDonald edited this page Mar 4, 2020
·
10 revisions
- API key for our apps to talk to our API
- API key for our apps to talk to document download API
- API key for our apps to talk to template preview
For our applications to talk our API they must use one of the API keys found in API_INTERNAL_SECRETS
in credentials/<env>/paas/environment_variables
. If you want to rotate these keys then you should:
- Add the new secret to
API_INTERNAL_SECRETS
incredentials/<env>/paas/environment_variables
- Deploy the API so it now allows apps to auth with the new secret
- Change
ADMIN_CLIENT_SECRET
incredentials/<env>/paas/environment_variables
andcredentials/<env>/document-download/paas-environment
to be the new secret - Deploy document-download-frontend and the admin app
- Remove the old secret from
API_INTERNAL_SECRETS
incredentials/<env>/paas/environment_variables
- Deploy the API to preview and then run functional tests for all the other apps (antivirus, document download etc) to check they can still talk to the API. If so, you can then continue to deploy the API to production
For our applications to talk to the document download API they must use one of the API keys found in AUTH_TOKENS
in credentials/<env>/document-download/paas-environment
. If you want to rotate these keys then you should:
- Add the new secret to
AUTH_TOKENS
incredentials/<env>/document-download/paas-environment
using a:
separated list, for examplesecret1:secret2
- Deploy the document download API so it now allows apps to auth with the new secret
- Change
DOCUMENT_DOWNLOAD_API_KEY
incredentials/<env>/paas/environment_variables
andcredentials/functional-tests/<env>-functional
to be the new secret - Deploy the API
- Remove the old secret from
AUTH_TOKENS
incredentials/<env>/document-download/paas-environment
- Deploy the document download API to preview and then run functional tests for all the other apps (admin, api, document download, antivirus) to check they can still talk to the document download API. If so, you can then continue to deploy the document download API to production
For our applications to talk to the template preview they must use one of the API keys found in TEMPLATE_PREVIEW_INTERNAL_SECRETS
in credentials/<env>/paas/environment_variables
. If you want to rotate these keys then you should:
- Add the new secret to
TEMPLATE_PREVIEW_INTERNAL_SECRETS
incredentials/<env>/paas/environment_variables
- Deploy template preview so it now allows apps to auth with the new secret
- Change
TEMPLATE_PREVIEW_API_KEY
incredentials/<env>/paas/environment_variables
- Deploy the API and the admin apps
- Remove the old secret from
TEMPLATE_PREVIEW_INTERNAL_SECRETS
incredentials/<env>/paas/environment_variables
- Deploy template preview to preview and then run functional tests for the admin app and api to check they can still talk to template preview. If so, you can then continue to deploy template preview to production