AWS从API网关恢复已删除的API键

发布于 2025-02-05 14:39:22 字数 715 浏览 1 评论 0原文

遇到错误的是,我已经从API网关中删除了一个API键。

我知道我可以从API网关中恢复过一种方法,例如,您删除了方法或获取方法,然后重新部署了您的舞台会回来的。

但是,是否可以恢复已删除的API密钥?,如果是,如何执行恢复?干杯。

更新1:

检查AWS CloudTrail的日志后,我可以在错误时发现事件“ Deleteapikey”,但是在那些日志中没有“ API键名”或“字符串值”帮助您确定API密钥的详细信息,否则您将能够重建API密钥。

更新2:

与AWS支持联系,通过了CloudTrail日志,希望他们可以提取我需要重建API键所需的所有信息,但是他们说,因为此资源“在外面在90天的历史中,“他们没有其他信息,与我拥有的日志相同的信息。

更新3:

我可以从某些数据库中恢复API键字符串。我从AWS配置匹配CloudTrail日志时间的AWS恢复的API键的名称(不知道名称)。最终,API键被重建。

结论:

  • 如果删除API键,则无法恢复。
  • 如果资源更多,AWS支持将不会比您更多的信息 超过90天大。
  • 如果您将API键字符串硬编码在某个地方,例如:代码本身或数据库,则可以重建它。

It happens that by mistake I have deleted an API KEY from API GATEWAY.

I know that I can recover from API GATEWAY a method, let's say you delete a method POST or GET, and you Redeploy the stage you will have it back.

But, Is it possible to recover a deleted API KEY?, if yes, How to perform a recovery?. Cheers.

UPDATE 1:

After checking logs from AWS CloudTrail, I could find the event "DeleteApiKey" around the time of the mistake, however there is no "API KEY name" nor "String value" in those logs that help you identify the details of the API KEY, otherwise you would be able to rebuild the API KEY.

UPDATE 2:

Contacted AWS Support, passed the CloudTrail log hoping they could pull all the info I needed to rebuild the API KEY, however they said that because this resource “was outside of the 90 day history“, they didn't has any other info, just the same info from the log I have.

UPDATE 3:

I could recover the API KEY string from some Database. The name of the API KEY (didn't know the name) I recovered from AWS Config matching the CloudTrail log time. Finally the API KEY was rebuilt.

CONCLUSIONS:

  • If you delete an API KEY it is not recoverable.
  • AWS Support won't have much more info than you if the resource if more
    than 90 days old.
  • If you have the API KEY string hard-coded somewhere like: code itself or a Database, you will be able to rebuild it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

汐鸠 2025-02-12 14:39:23

出于安全目的,无法恢复删除API密钥。您可以创建一个新的,删除另一个或更新现有密钥,但我自己恢复了已删除的密钥,这是不可能的。

您只需使用新的API键使用已删除的键来更新所有应用程序。

For security purpose, there is no way to recover a delete API Key. You can Create a New one, Delete an other, or Update an existing key, but recover a deleted key, in my own, it's impossible.

You can just make a new one and update all you app using the deleted key with the new API Key.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文