简体   繁体   English

几次 cmmits 后,我的 aws 密钥对在 github 上

[英]My aws key pair is on github after several cmmits

I have sensitive key information probably on several branches in multiple commits.我在多次提交的几个分支上可能有敏感的关键信息。 I am stupid.我很蠢。 When I was first learning about aws and setting it up with fog and carrierwave it hadn't even occured to me that my secret keys were being published to github every commit.当我第一次学习 aws 并用雾和载波设置它时,我什至没有想到我的秘密密钥会在每次提交时发布到 github。 Even after I tried to add the files to the gitignore.即使在我尝试将文件添加到 gitignore 之后。 The problem is, how do I undo many many commits that publish this information and implement a gem like figaro to keep that info secret from github?问题是,我如何撤消许多发布此信息的提交并实现像 figaro 这样的 gem 以对 github 保密该信息? I almost have to delete my repo...我几乎要删除我的回购...

Don't touch your github repo.不要动你的 github 仓库。 Simply connect to AWS, go to IAM->Users and find the username.只需连接到 AWS,转到 IAM->Users 并找到用户名。 Now, go to the 'Security Credentials' tab, and scroll down to 'Access Keys'.现在,转到“安全凭据”选项卡,然后向下滚动到“访问密钥”。 Click 'Create Access Key' button.单击“创建访问密钥”按钮。 Make a note of the new access key (but not on GitHub!) and replace the compromised keys with the new keys.记下新的访问密钥(但不在 GitHub 上!)并用新密钥替换已泄露的密钥。

Once you're done, click 'Make Inactive' under 'Status' for the old keys.完成后,为旧密钥单击“状态”下的“设为非活动”。 Once you've had new keys in place for a few days or a week, with no problems, simply delete the old keys.一旦您将新密钥放置了几天或一周,没有问题,只需删除旧密钥即可。

You can leave the old keys in GitHub, as, once you click 'Make Inactive', they are useless anyways.您可以将旧密钥留在 GitHub 中,因为一旦您单击“设为非活动”,它们无论如何都无用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM