My Amazon S3 Mistake
There are a few lessons here:<p>1. Use IAM roles. AWS keys should only have access to the specific functionality they need. Best practice is to <i>never</i> use your root credentials for <i>anything</i>; always use IAM users and use unique keys for each use case, so that you can invalidate and replace them easily. Every time documentation or a tutorial asks you to insert AWS keys, your response should be "let me go create a role for that" rather than "let me go look those up".<p>2. More importantly, if you ever accidentally publish or leak credentials, don't try to clean it up by deleting those commits. <i>Invalidate the credentials immediately</i> and re-issue them.<p>3. Always, <i>always</i> `git diff HEAD` before committing. Know what you're about to push up. This isn't just a security concern - the number of small, stupid things you'll catch that you'd otherwise end up fixing 15 seconds later is substantial. As a bonus, this incentivizes you to keep your commits small and atomic.<p>You might talk to Amazon directly - they've been known to forgive debts like these in these kinds of circumstances.