Files
fleet-terraform/addons/osquery-carve/.header.md
T
Jorge Falcon 7b381e0bbb Enforce DENY non-HTTPS requests to s3 buckets (#250)
- Enforces access over HTTPS to all Fleet-terraform created buckets.
- Fixes vpc-flow-logs log retention; now allows configuring the
retention in days.
2026-06-08 18:37:48 -04:00

1.7 KiB

Osquery Carve Bucket Addon

This addon provides a S3 bucket for Osquery Carve results.

KMS considerations

If osquery_carve_s3_bucket.kms.create_kms_key = true, this module now creates the KMS key first and manages the custom key policy through a separate attachment resource. If fleet_role_name is omitted, the module still creates the key but leaves the default KMS key policy in place and does not attach a custom policy.

When a module-created customer-managed key must trust the Fleet IAM role, Terraform needs to resolve that role through data.aws_iam_role in order to build the KMS key policy. Because that data source cannot read a role that is being created in the same apply, this is a technical limitation that requires a two-stage apply:

  1. Apply once without osquery_carve_s3_bucket.kms.fleet_role_name so the Fleet IAM role and the KMS key are created.
  2. Set osquery_carve_s3_bucket.kms.fleet_role_name to the existing Fleet role name and apply again so the module can resolve the role ARN and attach the KMS key policy.

The IAM policy exported by this addon is intentionally S3-only. KMS authorization is handled in the KMS key policy for module-created keys. If osquery_carve_s3_bucket.kms.kms_key_arn is set, this module does not manage the referenced key policy and does not export a generic KMS IAM policy for it.

When bringing your own KMS key, it is your responsibility to ensure that key policy and any separately managed IAM permissions allow the Fleet role to perform the required KMS actions for S3 object encryption and decryption.

S3 Bucket Policy: Deny Non-HTTPS

This module automatically attaches a bucket policy that denies any requests made over plain HTTP. No configuration is required.