-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement key rotation module for password management
- Loading branch information
Showing
43 changed files
with
492 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Terraform Key Replace | ||
description: Build and push Docker image to the registry | ||
inputs: | ||
azure_creds: | ||
description: Azure credentials | ||
required: true | ||
deploy_env: | ||
description: The environment to deploy to | ||
required: true | ||
terraform_arm_client_id: | ||
description: Terraform ARM client ID | ||
required: true | ||
terraform_arm_client_secret: | ||
description: Terraform ARM client secret | ||
required: true | ||
terraform_arm_subscription_id: | ||
description: Terraform ARM subscription ID | ||
required: true | ||
terraform_arm_tenant_id: | ||
description: Terraform ARM tenant ID | ||
required: true | ||
okta_api_token: | ||
description: Okta API token | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: azure/login@v1 | ||
with: | ||
creds: ${{ inputs.azure_creds }} | ||
- uses: hashicorp/[email protected] | ||
with: | ||
terraform_version: 1.3.3 | ||
- name: Terraform Init | ||
working-directory: ./ops | ||
env: # all Azure interaction is through Terraform | ||
ARM_CLIENT_ID: ${{ inputs.terraform_arm_client_id }} | ||
ARM_CLIENT_SECRET: ${{ inputs.terraform_arm_client_secret }} | ||
ARM_SUBSCRIPTION_ID: ${{ inputs.terraform_arm_subscription_id }} | ||
ARM_TENANT_ID: ${{ inputs.terraform_arm_tenant_id }} | ||
OKTA_API_TOKEN: ${{ inputs.okta_api_token }} | ||
shell: bash | ||
run: make init-${{ inputs.deploy_env }} | ||
- name: Terraform Key Rotation | ||
working-directory: ./ops | ||
env: # all Azure interaction is through Terraform | ||
ARM_CLIENT_ID: ${{ inputs.terraform_arm_client_id }} | ||
ARM_CLIENT_SECRET: ${{ inputs.terraform_arm_client_secret }} | ||
ARM_SUBSCRIPTION_ID: ${{ inputs.terraform_arm_subscription_id }} | ||
ARM_TENANT_ID: ${{ inputs.terraform_arm_tenant_id }} | ||
OKTA_API_TOKEN: ${{ inputs.okta_api_token }} | ||
shell: bash | ||
run: terraform -chdir=${{ inputs.deploy_env }}/persistent apply -auto-approve -lock-timeout=30m -replace="module.keys.random_password.db_administrator_password" -target="module.keys.random_password.db_administrator_password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,20 @@ locals { | |
environment = local.env | ||
resource_group = "${local.project}-${local.name}-${local.env}" | ||
} | ||
cdc_tags = { | ||
business_steward = "[email protected]" | ||
center = "DDPHSS" | ||
environment = local.env | ||
escid = "3205" | ||
funding_source = "TBD" | ||
pii_data = "false" | ||
security_compliance = "moderate" | ||
security_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
support_group = "OMHS" | ||
system = "prim" | ||
technical_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
zone = "EXTRANET" | ||
} | ||
} | ||
|
||
# Frontend React App | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,20 @@ locals { | |
environment = local.env | ||
resource_group = "${local.project}-${local.name}-${local.env}" | ||
} | ||
cdc_tags = { | ||
business_steward = "[email protected]" | ||
center = "DDPHSS" | ||
environment = local.env | ||
escid = "3205" | ||
funding_source = "TBD" | ||
pii_data = "false" | ||
security_compliance = "moderate" | ||
security_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
support_group = "OMHS" | ||
system = "prim" | ||
technical_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
zone = "EXTRANET" | ||
} | ||
} | ||
|
||
module "monitoring" { | ||
|
@@ -34,10 +48,8 @@ resource "random_password" "random_nophi_password" { | |
override_special = "!#$%&*()-_=+[]{}<>:?" | ||
} | ||
|
||
resource "random_password" "administrator_password" { | ||
length = 30 | ||
special = false | ||
override_special = "!#$%&*()-_=+[]{}<>:?" | ||
module "keys" { | ||
source = "../../services/keys" | ||
} | ||
|
||
module "db" { | ||
|
@@ -53,7 +65,7 @@ module "db" { | |
log_workspace_id = module.monitoring.log_analytics_workspace_id | ||
private_dns_zone_id = module.vnet.private_dns_zone_id | ||
|
||
administrator_password = random_password.administrator_password.result | ||
administrator_password = module.keys.db_administrator_password | ||
nophi_user_password = random_password.random_nophi_password.result | ||
|
||
tags = local.management_tags | ||
|
@@ -67,6 +79,7 @@ module "db_alerting" { | |
action_group_ids = [ | ||
data.terraform_remote_state.global.outputs.pagerduty_non_prod_action_id | ||
] | ||
cdc_tags = local.cdc_tags | ||
} | ||
|
||
module "vnet" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,10 @@ locals { | |
environment = local.env | ||
resource_group = "${local.project}-${local.name}-${local.env}" | ||
} | ||
# a list of tags that the cdc requires | ||
cdc_tags = { | ||
business_steward = "[email protected]" | ||
center = "DDPHSS" | ||
environment = "dev" | ||
environment = local.env | ||
escid = "3205" | ||
funding_source = "TBD" | ||
pii_data = "false" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,10 @@ locals { | |
environment = local.env | ||
resource_group = "${local.project}-${local.name}-${local.env_level}" | ||
} | ||
# a list of tags that the cdc requires | ||
cdc_tags = { | ||
business_steward = "[email protected]" | ||
center = "DDPHSS" | ||
environment = "dev" | ||
environment = local.env | ||
escid = "3205" | ||
funding_source = "TBD" | ||
pii_data = "false" | ||
|
@@ -47,9 +46,8 @@ resource "random_password" "random_nophi_password" { | |
override_special = "!#$%&*()-_=+[]{}<>:?" | ||
} | ||
|
||
resource "random_password" "administrator_password" { | ||
length = 30 | ||
special = true | ||
module "keys" { | ||
source = "../../services/keys" | ||
} | ||
|
||
module "db" { | ||
|
@@ -65,7 +63,7 @@ module "db" { | |
log_workspace_id = module.monitoring.log_analytics_workspace_id | ||
private_dns_zone_id = module.vnet.private_dns_zone_id | ||
|
||
administrator_password = random_password.administrator_password.result | ||
administrator_password = module.keys.db_administrator_password | ||
nophi_user_password = random_password.random_nophi_password.result | ||
|
||
tags = local.management_tags | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,20 @@ locals { | |
# environments should use the "local.env_level" convention where possible. | ||
resource_group = "${local.project}-${local.name}-${local.env_level}" | ||
} | ||
cdc_tags = { | ||
business_steward = "[email protected]" | ||
center = "DDPHSS" | ||
environment = local.env | ||
escid = "3205" | ||
funding_source = "TBD" | ||
pii_data = "false" | ||
security_compliance = "moderate" | ||
security_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
support_group = "OMHS" | ||
system = "prim" | ||
technical_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
zone = "EXTRANET" | ||
} | ||
} | ||
|
||
# Frontend React App | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ module "metabase_service" { | |
depends_on = [ | ||
module.metabase_database | ||
] | ||
cdc_tags = local.cdc_tags | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,20 @@ locals { | |
# environments should use the "local.env_level" convention where possible. | ||
resource_group = "${local.project}-${local.name}-${local.env_level}" | ||
} | ||
cdc_tags = { | ||
business_steward = "[email protected]" | ||
center = "DDPHSS" | ||
environment = local.env | ||
escid = "3205" | ||
funding_source = "TBD" | ||
pii_data = "false" | ||
security_compliance = "moderate" | ||
security_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
support_group = "OMHS" | ||
system = "prim" | ||
technical_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
zone = "EXTRANET" | ||
} | ||
} | ||
|
||
module "monitoring" { | ||
|
@@ -34,10 +48,8 @@ resource "random_password" "random_nophi_password" { | |
override_special = "!#$%&*()-_=+[]{}<>:?" | ||
} | ||
|
||
resource "random_password" "administrator_password" { | ||
length = 30 | ||
special = false | ||
override_special = "!#$%&*()-_=+[]{}<>:?" | ||
module "keys" { | ||
source = "../../services/keys" | ||
} | ||
|
||
module "db" { | ||
|
@@ -53,7 +65,7 @@ module "db" { | |
log_workspace_id = module.monitoring.log_analytics_workspace_id | ||
private_dns_zone_id = module.vnet.private_dns_zone_id | ||
|
||
administrator_password = random_password.administrator_password.result | ||
administrator_password = module.keys.db_administrator_password | ||
nophi_user_password = random_password.random_nophi_password.result | ||
|
||
tags = local.management_tags | ||
|
@@ -67,6 +79,7 @@ module "db_alerting" { | |
action_group_ids = [ | ||
data.terraform_remote_state.global.outputs.pagerduty_non_prod_action_id | ||
] | ||
cdc_tags = local.cdc_tags | ||
} | ||
|
||
module "vnet" { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,20 @@ locals { | |
# environments should use the "local.env_level" convention where possible. | ||
resource_group = "${local.project}-${local.name}-${local.env_level}" | ||
} | ||
cdc_tags = { | ||
business_steward = "[email protected]" | ||
center = "DDPHSS" | ||
environment = local.env | ||
escid = "3205" | ||
funding_source = "TBD" | ||
pii_data = "false" | ||
security_compliance = "moderate" | ||
security_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
support_group = "OMHS" | ||
system = "prim" | ||
technical_steward = "[email protected],[email protected],[email protected],[email protected]" | ||
zone = "EXTRANET" | ||
} | ||
} | ||
|
||
# Frontend React App | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,4 +34,5 @@ module "metabase_service" { | |
depends_on = [ | ||
module.metabase_database | ||
] | ||
cdc_tags = local.cdc_tags | ||
} |
Oops, something went wrong.