AWS Secrets Manager Agent
github.com
github.com
Seems like kinda a niche threat model, if your app is already compromised to the point where it's secret cache can be read, it seems likely that the attacker could also pivot to just read from the cache, or use the instance credentials to read from secrets manager itself.
Just simply pass it a credential and it will provide you the necessary credentials to access the Credentials for AWS Credentials Service
https://aws.amazon.com/blogs/security/access-aws-using-a-goo...
A much better solution would be for AWS to offer a domain socket or device inside VMs that will sign requests, such that the private material isn't even available to leak.
> The Secrets Manager Agent provides compatibility for legacy applications that access secrets through an existing agent or that need caching for langages not supported through other solutions.
This does not appear to be an interesting, state of the art, purported best practices way to access Secrets Manager; its just a shim for legacy apps. And that does make sense, as there are many languages which do not have SDKs available, but do have an HTTP client library; though I question how much of the demand for something like this comes from how insanely complex authenticating with the AWS API is.
Given that services like Lambda and ECS are already setup to be able to pull from secret manager natively and provide it as an environment variable.
What is the threat model that this is actually going to solve? At best it seems like security through obscurity, it removes the low hanging fruit of looking at ENV but if your application has the rights to use this than if someone gets into your container they can still get your secret.
What am I missing about the big advantage of this and why it was made?
The tl;dr is that this is for legacy software where you can make HTTP calls to retrieve a secret, but for some reason cannot use the AWS SDK. If you can use the SDK, you should use that instead of this proxy.
To use secret manager "properly", in most cases you're gonna need to pull in the entire AWS SDK, maybe authenticate it, make your requests to secret manager, cache values for some sort of lifetime before refreshing, etc.
To use it "less properly", you can just inject the values in environment variables but then there's no way to pick up changes and rotating secrets becomes a _project_.
Or just spin this up and that's all handled. It's so simple you can even use it from your shell scripts.
The purist in me thinks restarts are a hack, but the pragmatist has been around long enough to embrace the simplicity.
Adding another dependency/moving piece that AWS could drop support or it could just break also steers me away from this.
For Lambda, processes should be getting swapped fast enough and you also normally load during a cold start only. I could see some argument there around improving cold start performance, but would need some testing.
So, maybe this is to save a few cents?
> Per 10,000 API calls
> $0.05 per 10,000 API calls.
So imagine you have some number of cron jobs which require a bunch of secrets and these things fire every minute or 30 seconds or what have you. You could save as much as $0.25 a month!
> or use the instance credentials to read from secrets manager itself
Usually apps don't actually have instance credentials like this, but rather the thing deploying the app does, and that thing then injects just the secrets the app actually needs into the app's sandbox.
• AWS secrets, GCP secrets, Azure secrets... each has its own API
• secrets in a HashiCorp Vault install
• secrets from whatever cloud password manager
• "ambient" secrets from env-vars, or the local .netrc, or the local macOS Keychain
• k8s Secrets resources (when you're a k8s CRD controller)
• secrets stored in SOPS files, in turn encrypted by keys held in any of the above
Why haven't we seen a generic "secrets client" library, with pluggable adapters for handling all of these cases through the same library API / CLI tooling?
Or better yet, why not a generic stub secrets client, that speaks to an also-generic "caching middleware proxy" like this AWS one — where the proxy has the pluggable backend adapters + connection config for them?
Pointing this out here, because big evil companies generally don’t get praise when it’s due: godaddy built this!
Also, the "stub" client wouldn't really be a stub, as all the "ambient environment" secrets adapters would necessarily be local to the client rather than to the proxy. The client library would be a bit like using dnsmasq(1) as a local "stub" DNS resolver — where it reads your /etc/hosts and so forth, but for most things is deferring to a configured upstream DNS server.
Even this secrets manager proxy that the OP is about is explicitly to be used in legacy situations where you can’t use the AWS SDK, which is preferred because it does all of the stuff you mentioned for you.
However, this is Hacker News! If you think you see a problem that can be solved that other people don’t, why don’t you build it?
Also, at any project with a sane architecture, you're using 1 vault and maybe 1-2 ambient strategies to pass the data. You won't use all the vaults at the same time anyway
You're assuming the secrets here are managed by infra+glue added by a DevOps team when deploying an app.
I'm talking about use-cases where the secret-handling is designed into e.g. a cluster-scale deployable virtual appliance, where you configure the app through its UI or deployment-time config files to access your "secrets provider" of choice. (Think "deployable PaaS.")
SOPS does already work this way, right? You don't have to use local GPG keys or whatever with SOPS, you can use keys from AWS KMS or stored in HashiCorp Vault or whatever
"Spring" has that. You can define a property that can be populated from pluggable sources, like vaults, yaml, environment variables and others.
You just add an annotation @Value("${foo.bar}") to a field or constructor parameter, and it will be filled from the appropriate source automatically.
What are the advantages to a configuration like this? Seems the HTTP interface with non-encrypted cache and separate agent situation isn’t something secure enough to satisfy most companies these days.
> The Secrets Manager Agent provides compatibility for legacy applications that access secrets through an existing agent or that need caching for languages not supported through other solutions.
Chamber uses SSM Parameter Store, which for many cases is similar, but some people might have a preference for Secrets Manager. For example, a team might like the automatic RDS password rotation for Secrets Manager and decide to put everything there for consistency.
For Doppler, well maybe someone doesn't want to pay for it, or they'd rather control access to their secrets via IAM instead of through a separate tool.
https://github.com/Kralizek/AWSSecretsManagerConfigurationEx...
Normally Boto uses the current account context to get secrets, but if we run a lambda as a local build, it uses this library to pull secrets from the actual dev AWS account.
This makes it easier to onboard new developers, reduces problems of figuring out what secrets to get for each lambda, etc.
Also if secrets are rotated in dev, local stacks get them automatically.
I am curious to see if this tool is remarkably different.
That's a pretty thorough misunderstanding of the value that secrets management services provide. We can start with the idea of never storing secrets in files.
I think most companies also understand the difference between plain HTTP localhost loopback and transmitting secrets in plaintext over the network. There are many services that rely on localhost loopbacks for handling all kinds of sensitive data.
Chamber is great but generally relies on transmitting secrets via environment variables to the enclosed process and assumes that they will remain valid for the lifetime of that process. Part of the point of this tool is to provide a secrets cache with a TTL.
https://github.com/chrissav/consul-template-plugin-secretsma...
I didn't realize consul-template supported plugins.
Another consideration is operation; imagine that there are 10 different libraries maintained for this purpose, and if there is a new feature, say, you need all logs going to one place, making sure it is available in all languages would require a team with different programming skills to do so. Secrets agent, being language agnostic, you only need to change at one place, and someone else may have already done it for it or ready to do it, as it is open source project.
When it comes to cost saving, imagine scenarios where a junior developer improperly implements secret retrieval in a Lambda function, with retrieval occurring at every function invocation and each function handling 100 transactions per second. Such a single oversight can cost $1,000 a month, and if left unnoticed for a year—a common occurrence when the function appears to work—people often overlook further scrutiny as long as it functions.
https://aws.amazon.com/blogs/compute/using-the-aws-parameter...
For example you spin up nginx and setup HTTP basic auth quickly and don't bother writing your own script to periodically update user list from SSM.
Moved all our secrets to S3 a long time ago and haven't looked back.