Reputation: 12718
I have an app that is storing AWS secret keys in a private repo on Github.
It was recommended because if one of our computers "blows up", we will not have access to the keys.
Instead of storing in Github, we could just pass our computers around to share the secret key, or send them through private company slack.
These all seem like bad ways to manage keys.
Is there a good repository/vault or method that is better for secret key storage and sharing with team members?
Upvotes: 2
Views: 1254
Reputation: 310
You could use an S3 bucket that only stores keys and only allow specific users to have access to this bucket via IAM Groups and Users. This seems reasonable at the start of a project.
If you need something more hardcore, I know some larger tech companies use:
https://github.com/hashicorp/vault
Upvotes: 0
Reputation: 533
The number one rule of key management is to minimize the number of locations the key is stored. So, for something like AWS keys, developers should have their own keys stored on their machines. For keys needed by an app server, those keys should only be stored on the app server.
It was recommended because if one of our computers "blows up", we will not have access to the keys.
The best way to solve this problem is just to rotate the keys. Ideally, you should always be in a place where you can quickly/easily generate new keys if you need to, such as in the case of a security event. If there's some master key that you're totally screwed if you lose it, store it in a secure storage app like 1Password, where your vault is encrypted with an additional password.
Instead of storing in Github, we could just pass our computers around to share the secret key, or send them through private company slack.
These all seem like bad ways to manage keys.
As a general rule, never store AWS keys (or any other sensitive keys or passwords) in Github or on the company Slack. Anything you share in slack lives forever in the logs, so if your company slack is compromised -- or if Slack is compromised, which has happened several times -- anything lying around in your logs is available to potential attackers.
Is there a good repository/vault or method that is better for secret key storage and sharing with team members?
For storing keys (long-term storage) use something like 1 Password. For sharing keys (short-term storage) use something like ShareSecret (disclaimer, I'm the founder of ShareSecret).
Upvotes: 0
Reputation: 36073
Keys, like many secrets, should not be shared whenever possible.
In the case of AWS users:
There are many benefits to this system:
And avoid saving anything like this in source control (git or any other).
Upvotes: 0
Reputation: 13501
Avoid storing credentials with code, they get quite vulnerable and consequences may be irreversible. It would be much better to use IAM Roles to grant access and use keys only for development, preferably a different one per developer so they can be rotated as needed.
Check the AWS Security Best Practices whitepaper for further details.
Upvotes: 3
Reputation: 9837
You could use 1Password for Teams which allows you to share secrets in encrypted, password-protected vaults.
As a side-note, the risk of locking a AWS User out of his account if a computer blows up is very low. In any case, the account owner can regenerate a new set of AWS keys for any IAM User in the account. As long as the account owner can connect to the AWS account, you are safe.
Upvotes: 1