Support Windows MDM secrets for GCP#228
Open
robbiet480 wants to merge 5 commits intofleetdm:mainfrom
Open
Conversation
11fdca3 to
041abfc
Compare
Creates Secret Manager secrets for FLEET_MDM_WINDOWS_WSTEP_IDENTITY_CERT_BYTES and FLEET_MDM_WINDOWS_WSTEP_IDENTITY_KEY_BYTES, populated via sensitive Terraform variables. Wires them into the fleet module via extra_secret_env_vars. Also adds terraform.tfvars and *.key/*.crt to .gitignore to prevent secret leakage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids storing secret content in Terraform state. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces two hardcoded IAM bindings with a single for_each over fleet_secrets_env_vars, so any secret passed via extra_secret_env_vars (including the new Windows MDM WSTEP secrets) automatically gets the correct IAM grant. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rotates to PKCS#1 RSA key format (BEGIN RSA PRIVATE KEY) required by Fleet's WSTEP parser. Previous version used PKCS#8 which Fleet rejects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
041abfc to
fd64963
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds GCP Secret Manager support for the Windows MDM WSTEP identity certificate and key, enabling the GCP Terraform module to provision and expose these secrets to Fleet via Cloud Run's secret environment variable injection.
Changes
gcp/main.tffleet-mdm-wstep-identity-certandfleet-mdm-wstep-identity-keysecret_data_wo(write-only) for secret versions to avoid storing sensitive values in Terraform stateFLEET_MDM_WINDOWS_WSTEP_IDENTITY_CERT_BYTESandFLEET_MDM_WINDOWS_WSTEP_IDENTITY_KEY_BYTESviaextra_secret_env_varsgcp/variables.tfwindows_mdm_wstep_identity_certandwindows_mdm_wstep_identity_keyinput variables (sensitive strings, PEM-encoded)gcp/byo-project/iam.tfgoogle_secret_manager_secret_iam_memberresources into a singlefor_each-based resource that iterates over all secrets inlocal.fleet_secrets_env_vars— this ensures the Fleet Cloud Run service account automatically gets Secret Accessor access to any secrets added viaextra_secret_env_vars, including the new WSTEP secrets.gitignore.DS_Store,terraform.tfvars,*.key, and*.crtto prevent accidental commits of local state and key materialUsage
Provide the WSTEP cert and key via
terraform.tfvarsor a secrets manager pipeline:These map directly to the
FLEET_MDM_WINDOWS_WSTEP_IDENTITY_CERT_BYTESandFLEET_MDM_WINDOWS_WSTEP_IDENTITY_KEY_BYTESenvironment variables required by Fleet for Windows MDM enrollment.PR description drafted with Claude (claude.ai/claude-code), reviewed by author.