Support for internal load balancer and deletion protection, iam policy attachment processing, osquery perf fix, and cloudfront software installers (#105)
# Main terraform - Modified iam `resource "aws_iam_role_policy_attachment" "extras"` from `for_each` to `count`, which allows terraform to apply even if roles are not yet created. In cases where role is not yet created, a second terraform apply is required for the resource to attach the policy. - Modified iam `resource "aws_iam_role_policy_attachment" "execution_extras"`, which allows terraform to apply even if roles are not yet created. In cases where role is not yet created, a second terraform apply is required for the resource to attach the policy. - Added support for internal load balancers to be provisioned. - Added support for toggling deletion protection on and off on the load balancer resource. # Example Module - Updated example module with changes alb changes. # Module: Cloudfront Software Installers - Added a count & tertiary to cloudfront software installer kms key policy, as it's fed in as an input. In cases where the key had not yet been created, apply would fail. - Modified `variable "s3_kms_key_id"` to allow default value `null` # Module: Logging Destination Firehose - Added prefix variable to support use-cases where multiple environments are deployed in the same account # Module: Osquery Perf - Added dependency on `data.aws_secretsmanager_secret_version.enroll_secret` to fix race condition.
This commit is contained in:
1 parent
1d8bd3007d
commit
ae8863ce64
22 files changed
+167
-191
No files matched your search
+5
-28
@@ -4,35 +4,12 @@ This code provides some example usage of the Fleet Terraform module, including h
|
||||
- domain name
|
||||
- route53 zone name (may match the domain name)
|
||||
- license key (if premium)
|
||||
- uncommenting the mdm module if mdm is desired
|
||||
- any extra settings to be passed to Fleet via ENV var.
|
||||
|
||||
Due to Terraform issues, this code requires 3 applies "from scratch":
|
||||
1. `terraform apply -target module.fleet.module.vpc`
|
||||
2. `terraform apply -target module.osquery-carve -target module.firehose-logging`
|
||||
3. If using a new route53 zone:
|
||||
- `terraform apply -target aws_route53_zone.main`
|
||||
- From the output, obtain the NS records created for the zone and add them to the parent DNS zone
|
||||
4. If enabling mdm: `terraform apply -target module.mdm`. It will need to be uncommented as well as the KMS section below it.
|
||||
5. `terraform apply -target module.fleet`
|
||||
6. `terraform apply`
|
||||
7. If enabling mdm do the following:
|
||||
- Record the KMS key from step 5 output.
|
||||
- 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
|
||||
```
|
||||
- Using the `encrypt.sh` script, KMS encrypt all of these secrets as follows:
|
||||
```
|
||||
cd resources
|
||||
for i in *; do ../scripts/encrypt.sh <kms-key-id-from-terraform-output> $i $i.encrypted; done
|
||||
for i in *.encrypted; do rm ${i/.encrypted/}; done
|
||||
```
|
||||
This will encrypt all of the mdm secrets and add the .encrypted extension to them. It will also remove the non-encrypted version of the secrets so that they are encrypted at rest even locally.
|
||||
To deploy:
|
||||
|
||||
- Uncomment all of the resources and data sources in `mdm-secrets.tf`.
|
||||
- Re-run `terraform apply` to populate the Secrets Manager secrets.
|
||||
- Uncomment the sections in the `fleet_config` portion of `main.tf` for mdm and run a final `terraform apply`. Services will restart with mdm enabled.
|
||||
1. `terraform apply`
|
||||
|
||||
If using a new route53 zone:
|
||||
|
||||
- From the output, obtain the NS records created for the zone and add them to the parent DNS zone
|
||||
Reference in new issue
Block a user