Secret manager env#3800
Open
ntner wants to merge 2 commits into
Open
Conversation
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
Adds optional AWS Secrets Manager integration for injecting environment variables into ECS tasks via native
secretsblocks, replacing runtime S3 fetch and KMS decrypt for env vars.ReleasePromotesecretsinjection usesARN:key::format to pull individual keys from a single per-app JSON secret ({rack}/{app})CONVOX_ENV_KEY/URL/VARSare suppressed from task definitions, disabling the S3 fetch path inconvox-envconvox run) also get SM injection when enabled, with graceful S3 fallback if SM lookup failsSecretsManagerEnvparameter silently default toNoConfiguration levels
convox rack params set SecretsManagerEnv=Yesconvox apps params set SecretsManagerEnv=Yes -a myappparams: { SecretsManagerEnv: "Yes" }App-level setting is opt-in only: setting
SecretsManagerEnv=Yeson an app enables SM even if the rack default isNo, but settingNodoes not disable SM when the rack default isYes. Use convox.ymlparamsto explicitly disable SM for a specific app when the rack default isYes.Changes
provider/aws/secrets.goprovider/aws/releases.goprovider/aws/processes.goprovider/aws/apps.goprovider/aws/formation/rack.jsonSecretsManagerEnvparameter + IAM policy for rack API roleprovider/aws/formation/app.json.tmplSecretsManagerEnvparameter, ExecutionRole SM policy (exact ARN), ExecutionRole outputprovider/aws/formation/service.json.tmplprovider/aws/formation/timer.json.tmplHow env injection works
convox-envfetches from S3, decrypts with KMSSuppressing
CONVOX_ENV_KEY/URL/VARScauses theconvox-envwrapper to short-circuit (it checksCONVOX_ENV_URLat startup). Without this suppression,convox-envwould fetch from S3 and overwrite SM-injected values viamergeEnv().CloudFormation Impact
SecretsManagerEnvparameter (DefaultNo), new inline IAM policy on ApiRole. No resource renames, no output changes.SecretsManagerEnv=Yesis set.No, Go template guards produce no output when ARN is empty.IAM Policy Scoping
{rack}/*(all secrets under rack prefix)GetSecretValueonlyGetSecretValueonly