This repository was archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Security and Maintenance
David An edited this page Jun 2, 2022
·
17 revisions
Every three months, for security purposes, we must rotate the keys for the deployer and import-service service accounts.
- the
deployerSA is used by Jenkins during a release to deploy Import Service to App Engine. - the
import-serviceSA is used to run Import Service inside FiaBs. TODO: does prod actually need a key??
The steps below describe the process for rotating keys:
- Having logged in with your
@firecloud.orgaccount, go to Google Cloud Console's IAM & Admin > Service Accounts page for projectterra-importservice-prod. - Click on the service account (
deployerorimport-service) in question. - Click on the 'KEYS' tab.
- Click on the
ADD KEYbutton. - Select
Create new key. - Make sure
JSONis selected as key type, and click onCREATE. - Make sure the
.jsonfile was downloaded onto your computer.
- TODO: should we back up the existing Vault entry prior to overwriting it, so we don't lose the old key?
- Add the new
.jsonkey file (that you just downloaded) toVault(e.g.vault write secret/dsde/firecloud/prod/import-service/<sa-name>.json @/Users/<your username>/Downloads/<new sa file name>.json).-
deployer:vault write secret/dsde/firecloud/prod/import-service/deployer.json @~/Downloads/deployer.json -
import-service:vault write secret/dsde/firecloud/prod/import-service/import-service-account.json @~/Downloads/import-service.json
-
- To verify the new
deployerkey, manually trigger a deployment of Import Service to production by running theimport-service-manual-deployjob in prod Jenkins. If the deployment succeeds, thedeployerkey rotation worked. - To verify the new
import-servicekey … TODO
- Now you can disable the old key(s). It's not possible to disable a SA key on the GCP console. You will need to use
gcloudon your local system (e.g.Terminalon MacOS). After making sure you're authenticated with your@firecloud.orgaccount on your local system, rungcloud iam service-accounts keys disable <service_account_key_name> --iam-account=<sa_name> --project terra-importservice-prod. Substitute into that command, the key obtained fromKeycolumn on the GCP console page listing keys for the target service account. More details on disabling service account keys can be found here. Verify on the GCP console page that the key'sStatusis nowDisabled(as opposed toActive). - To be sure, rerun the prod deploy job and verify that everything still works.
- Assuming everything is still working, you can now safely delete the old key using the trash can icon in the UI.
- Now that you are done with the locally-downloaded .json file, and its contents are stored securely in Vault, delete your local .json file. Leaving it on your local computer is a security hazard.
- Set a Slack reminder on
#dsp-analysis-journeyschannel for the next rotation by typing something like/remind :alert_red_light: Reminder to rotate the service account key for Import Service by following these (https://github.com/broadinstitute/import-service/wiki/Security-and-Maintenance) instructions in 85 days.