diff --git a/byo-vpc/example/README.md b/byo-vpc/example/README.md index 40925db..00235ec 100644 --- a/byo-vpc/example/README.md +++ b/byo-vpc/example/README.md @@ -9,17 +9,17 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | 5.88.0 | -| [random](#provider\_random) | 3.6.3 | +| [aws](#provider\_aws) | 5.92.0 | +| [random](#provider\_random) | 3.7.1 | ## Modules | Name | Source | Version | |------|--------|---------| | [acm](#module\_acm) | terraform-aws-modules/acm/aws | 4.3.1 | -| [byo-vpc](#module\_byo-vpc) | github.com/fleetdm/fleet-terraform//byo-vpc | tf-mod-byo-vpc-v1.13.0 | -| [firehose-logging](#module\_firehose-logging) | github.com/fleetdm/fleet-terraform//addons/logging-destination-firehose | tf-mod-addon-logging-destination-firehose-v1.1.1 | -| [migrations](#module\_migrations) | github.com/fleetdm/fleet-terraform//addons/migrations | tf-mod-addon-migrations-v2.0.1 | +| [byo-vpc](#module\_byo-vpc) | github.com/fleetdm/fleet-terraform//byo-vpc?depth=1&ref=tf-mod-byo-vpc-v1.15.0 | n/a | +| [firehose-logging](#module\_firehose-logging) | github.com/fleetdm/fleet-terraform//addons/logging-destination-firehose?depth=1&ref=tf-mod-addon-logging-destination-firehose-v1.1.1 | n/a | +| [migrations](#module\_migrations) | github.com/fleetdm/fleet-terraform/addons/migrations?depth=1&ref=tf-mod-addon-migrations-v2.0.1 | n/a | | [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | 5.1.2 | ## Resources diff --git a/byo-vpc/example/main.tf b/byo-vpc/example/main.tf index f8d370a..7ecd1d9 100644 --- a/byo-vpc/example/main.tf +++ b/byo-vpc/example/main.tf @@ -92,7 +92,7 @@ module "vpc" { } module "byo-vpc" { - source = "github.com/fleetdm/fleet-terraform//byo-vpc?depth=1&ref=tf-mod-byo-vpc-v1.13.0" + source = "github.com/fleetdm/fleet-terraform//byo-vpc?depth=1&ref=tf-mod-byo-vpc-v1.15.0" vpc_config = { vpc_id = module.vpc.vpc_id networking = { @@ -103,6 +103,7 @@ module "byo-vpc" { name = random_pet.main.id instance_class = "db.t4g.large" subnets = module.vpc.database_subnets + replicas = 2 } redis_config = { instance_size = "cache.m6g.large" diff --git a/example/.header.md b/example/.header.md index 98148e6..ecd313e 100644 --- a/example/.header.md +++ b/example/.header.md @@ -18,16 +18,11 @@ Due to Terraform issues, this code requires 3 applies "from scratch": 6. `terraform apply` 7. If enabling mdm do the following: - Record the KMS key from step 5 output. - - Use `fleetctl` to obtain all of the mdm certs. Use https://fleetdm.com/docs/using-fleet/mdm-setup#apple-push-notification-service-apns and https://fleetdm.com/docs/using-fleet/mdm-setup#apple-business-manager-abm for reference. + - Create the Windows MDM cert via the document at https://fleetdm.com/guides/windows-mdm-setup#step-1-generate-your-certificate-and-key, but name them as scep.key and scep.crt to follow a legacy convention of the mdm module. - Place the certificates in the `resources` folder with the following names based upon their function: ``` scep.crt scep.key -apns.crt -apns.key -abm.crt -abm.key -abm_token.p7m ``` - Using the `encrypt.sh` script, KMS encrypt all of these secrets as follows: ``` diff --git a/example/README.md b/example/README.md index c9ba03c..b88cf5a 100644 --- a/example/README.md +++ b/example/README.md @@ -18,16 +18,11 @@ Due to Terraform issues, this code requires 3 applies "from scratch": 6. `terraform apply` 7. If enabling mdm do the following: - Record the KMS key from step 5 output. - - Use `fleetctl` to obtain all of the mdm certs. Use https://fleetdm.com/docs/using-fleet/mdm-setup#apple-push-notification-service-apns and https://fleetdm.com/docs/using-fleet/mdm-setup#apple-business-manager-abm for reference. + - Create the Windows MDM cert via the document at https://fleetdm.com/guides/windows-mdm-setup#step-1-generate-your-certificate-and-key, but name them as scep.key and scep.crt to follow a legacy convention of the mdm module. - Place the certificates in the `resources` folder with the following names based upon their function: ``` scep.crt scep.key -apns.crt -apns.key -abm.crt -abm.key -abm_token.p7m ``` - Using the `encrypt.sh` script, KMS encrypt all of these secrets as follows: ``` @@ -58,10 +53,8 @@ This will encrypt all of the mdm secrets and add the .encrypted extension to the | Name | Source | Version | |------|--------|---------| | [acm](#module\_acm) | terraform-aws-modules/acm/aws | 4.3.1 | -| [firehose-logging](#module\_firehose-logging) | github.com/fleetdm/fleet-terraform/addons/logging-destination-firehose | tf-mod-addon-logging-destination-firehose-v1.1.1 | -| [fleet](#module\_fleet) | github.com/fleetdm/fleet-terraform | tf-mod-root-v1.12.0 | -| [migrations](#module\_migrations) | github.com/fleetdm/fleet-terraform/addons/migrations | tf-mod-addon-migrations-v2.0.1 | -| [osquery-carve](#module\_osquery-carve) | github.com/fleetdm/fleet-terraform/addons/osquery-carve | tf-mod-addon-osquery-carve-v1.1.0 | +| [fleet](#module\_fleet) | github.com/fleetdm/fleet-terraform?depth=1&ref=tf-mod-root-v1.14.0 | n/a | +| [migrations](#module\_migrations) | github.com/fleetdm/fleet-terraform/addons/migrations?depth=1&ref=tf-mod-addon-migrations-v2.0.1 | n/a | ## Resources diff --git a/example/main.tf b/example/main.tf index e8b4739..f563937 100644 --- a/example/main.tf +++ b/example/main.tf @@ -52,7 +52,7 @@ locals { } module "fleet" { - source = "github.com/fleetdm/fleet-terraform?depth=1&ref=tf-mod-root-v1.13.0" + source = "github.com/fleetdm/fleet-terraform?depth=1&ref=tf-mod-root-v1.14.0" certificate_arn = module.acm.acm_certificate_arn vpc = { @@ -103,6 +103,8 @@ module "fleet" { } # Uncomment to specify the RDS engine version # engine_version = "8.0.mysql_aurora.3.07.1" + # Uncomment to use more or fewer replicas + # replicas = 2 } redis_config = { # See https://fleetdm.com/docs/deploy/reference-architectures#aws for instance types. @@ -167,18 +169,19 @@ module "migrations" { ## MDM Secret payload -# See https://github.com/fleetdm/fleet/blob/tf-mod-addon-mdm-v2.0.0/terraform/addons/mdm/README.md#abm -# Per that document, both Windows and Mac will use the same SCEP secret under the hood. +# See https://github.com/fleetdm/fleet-terraform/blob/tf-mod-addon-mdm-v2.0.0/addons/mdm/README.md#abm +# Per that document, both Windows and Mac will use the same SCEP secret under the hood. Currently only +# the Windows MDM secrets still use this as the all Mac MDM is managed via the Fleet UI and is therefore +# disabled in the module. # module "mdm" { # source = "github.com/fleetdm/fleet-terraform/addons/mdm?depth=1&ref=tf-mod-addon-mdm-v2.0.0" -# # Set apn_secret_name = null if not using mac mdm -# apn_secret_name = "fleet-apn" +# apn_secret_name = null # scep_secret_name = "fleet-scep" # # Set abm_secret_name = null if customer is not using dep -# abm_secret_name = "fleet-dep" -# enable_apple_mdm = true +# abm_secret_name = null +# enable_apple_mdm = false # enable_windows_mdm = true # } diff --git a/example/mdm-secrets.tf b/example/mdm-secrets.tf index c41effc..2e76511 100644 --- a/example/mdm-secrets.tf +++ b/example/mdm-secrets.tf @@ -8,11 +8,6 @@ locals { mdm_resource_path = "${path.module}/resources" scep_cert = "${local.mdm_resource_path}/scep.crt.encrypted" scep_key = "${local.mdm_resource_path}/scep.key.encrypted" - apns_cert = "${local.mdm_resource_path}/apns.crt.encrypted" - apns_key = "${local.mdm_resource_path}/apns.key.encrypted" - abm_cert = "${local.mdm_resource_path}/abm.crt.encrypted" - abm_key = "${local.mdm_resource_path}/abm.key.encrypted" - abm_token = "${local.mdm_resource_path}/abm_token.p7m.encrypted" } # To ease the process of encrypting and decrypting secrets, see @@ -27,7 +22,10 @@ locals { # The SCEP challenge will be randomly generated by terraform. We do not # need to know what it is. For troubleshooting, it can always be found -# in the SCEP secret in AWS. +# in the SCEP secret in AWS. The SCEP cert is primarily used as the +# Windows WSTEP cert at this point as the MAC scep is generated +# automatically in the applicaton. The other MAC MDM secrets can now be +# manged via the Fleet UI # resource "random_password" "challenge" { # length = 12 @@ -61,64 +59,4 @@ locals { # payload = file(local.scep_key) # } # } -# -# resource "aws_secretsmanager_secret_version" "apn" { -# secret_id = module.mdm.apn.id -# secret_string = jsonencode( -# { -# FLEET_MDM_APPLE_APNS_CERT_BYTES = data.aws_kms_secrets.apns_cert.plaintext["FLEET_MDM_APPLE_APNS_CERT_BYTES"] -# FLEET_MDM_APPLE_APNS_KEY_BYTES = data.aws_kms_secrets.apns_key.plaintext["FLEET_MDM_APPLE_APNS_KEY_BYTES"] -# } -# ) -# } -# -# data "aws_kms_secrets" "apns_cert" { -# secret { -# name = "FLEET_MDM_APPLE_APNS_CERT_BYTES" -# key_id = aws_kms_key.fleet_data_key.id -# payload = file(local.apns_cert) -# } -# } -# -# data "aws_kms_secrets" "apns_key" { -# secret { -# name = "FLEET_MDM_APPLE_APNS_KEY_BYTES" -# key_id = aws_kms_key.fleet_data_key.id -# payload = file(local.apns_key) -# } -# } -# -# resource "aws_secretsmanager_secret_version" "abm" { -# secret_id = module.mdm.abm.id -# secret_string = jsonencode( -# { -# FLEET_MDM_APPLE_BM_CERT_BYTES = data.aws_kms_secrets.abm_cert.plaintext["FLEET_MDM_APPLE_BM_CERT_BYTES"] -# FLEET_MDM_APPLE_BM_KEY_BYTES = data.aws_kms_secrets.abm_key.plaintext["FLEET_MDM_APPLE_BM_KEY_BYTES"] -# FLEET_MDM_APPLE_BM_SERVER_TOKEN_BYTES = data.aws_kms_secrets.token.plaintext["FLEET_MDM_APPLE_BM_SERVER_TOKEN_BYTES"] -# } -# ) -# } -# -# data "aws_kms_secrets" "abm_cert" { -# secret { -# name = "FLEET_MDM_APPLE_BM_CERT_BYTES" -# key_id = aws_kms_key.fleet_data_key.id -# payload = file(local.abm_cert) -# } -# } -# -# data "aws_kms_secrets" "abm_key" { -# secret { -# name = "FLEET_MDM_APPLE_BM_KEY_BYTES" -# key_id = aws_kms_key.fleet_data_key.id -# payload = file(local.abm_key) -# } -# } -# -# data "aws_kms_secrets" "token" { -# secret { -# name = "FLEET_MDM_APPLE_BM_SERVER_TOKEN_BYTES" -# key_id = aws_kms_key.fleet_data_key.id -# payload = file(local.abm_token) -# } -# } +