Run commands with secrets fetched from AWS Systems Manager Parameter Store.
Sesame fetches parameters by path recursively and by explicit name, injects them as environment variables, then executes the target command. No secrets written to disk, no scripts to maintain.
# sesame.toml
prefix = "/myapp/production"
secrets = [
"/myapp/production/DB_PASSWORD",
"/myapp/production/API_KEY",
]sesame -c sesame.toml -- python main.pyThe application main.py will have API_KEY and DB_PASSWORD available as
environment variables.
prefix = "/myapp/staging"
secrets = [
"/myapp/staging/DB_USER",
"/myapp/staging/DB_PASSWORD",
]prefix: SSM path. Sesame will fetch all parameters under this path recursively.secrets: explicit list of full parameter names. This is a limitation of the AWS APIs.
Configuration supports $VAR and ${VAR} syntax for both parameter prefix and
secret names:
prefix = "$PROJECT/$ENV/$SERVICE"
secrets = [
"$PROJECT/$ENV/$SERVICE/DB_PASSWORD",
]NOTE: If any variable is unset it expands to an empty string.
Sesame uses AWS's SDK default authentication chain.
The executing principal (via instance role, ECS task role, or explicit keys) requires:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ssm:GetParametersByPath",
"ssm:GetParameters"
],
"Resource": "arn:aws:ssm:*:*:parameter/myapp/*"
}
]
}GetParametersByPath requires WithDecryption if parameters are
SecureStrings. The policy above works for both encrypted and unencrypted
parameters.
IMPORTANT: The application also requires kms:Decrypt on the right key to
decrypt secrets and parameters.
sesame [flags] -- <CMD> [ARGS...]
Flags:
-V, --version print version and exit
-v, --verbose debug output (JSON)
-H, --human human-readable logs (text)
-c, --config FILE config file path (default: sesame.toml)
Important
--separates sesame flags from the command. Everything after--is passed toexecveunchanged.
- Read and parse the configuration. Expand environment variables in secret/parameters keys.
- Call
GetParametersByPathrecursively underprefix. - Call
GetParametersfor each item insecrets(requests are performed in batches of 10 secrets). - Expose the values of parameters and secrets as environment variables.
- Call
syscall.Execto execute and handover the environment to the application.
Sesame dies when calling the application freeing used resources and giving control to the child application.
- Secrets travel from AWS to the process env, never to disk.
- The parent process is replaced by the child.
- Access is controlled by IAM alone, applications should have
- If the config file is user-controlled,
$VARexpansion lets them override any env var present at startup. Restrict file permissions onsesame.toml.