zalando-stups / mint-worker

The secret rotator and distributor for the STUPS ecosystem
http://stups.readthedocs.org/en/latest/components/mint.html
Other
9 stars 3 forks source link

Must not attempt to set credentials if no S3 bucket is configured #5

Closed vetinari closed 9 years ago

vetinari commented 9 years ago

Without a configured S3 bucket to store the credentials, mint should not attempt to create a password, it would be unusable anyway (and the way it works now the passwords accumulate).

prayerslayer commented 9 years ago

Accumulated passwords only happen when we can’t write to any configured bucket (because it doesn’t exist or permissions are not set correctly).

Proposed solution: We try to write to S3 n times max. When a write was successful, we reset the counter to 0. After n tries client and password rotation is paused until manually unpaused via YOUR TURN.

vetinari commented 9 years ago

what about checking the writeability of the bucket before attempting to call? if that fails, just do something if there are changes to that user (or unpaused via yourturn)

sarnowski commented 9 years ago

The only check that we can do to really validate if the future write will work is to write to both, user.json and client.json. And as we don't store passwords, we have no way of regenerating the same files again. Every other write check will not be perfectly safe and so we should choose the other strategy as this works always, in any case.

prayerslayer commented 9 years ago

This implements both strategies: