by WatchDog · 2y ago · 0 comments
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.
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?
https://aws.amazon.com/blogs/security/access-aws-using-a-goo...
Just simply pass it a credential and it will provide you the necessary credentials to access the Credentials for AWS Credentials Service
> 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.
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.