duanfan1965 2017-12-22 08:02
浏览 33
已采纳

在Go Web应用程序中加载密钥的最佳实践是什么? [关闭]

I usually worry about memory corruption with leaving my public and private keys in memory for access throughout my applications. I'm very new to Go and I'm wondering what the best practice is for making these keys available.

Is Go safe enough that I should be able to store these in memory, no problem. Or should I only keep my public key in memory for validation and load my private key every time I need to sign a token?

  • 写回答

1条回答 默认 最新

  • doubei8168 2017-12-22 17:24
    关注

    What you're probably looking for is called a Hardware Security Module (HSM). With AWS and Google Cloud the HSM is wrapped and access is provided via a Key Management Service API.

    This essentially separates your keys from your server in a similar way a Yubikey affords protection for laptop/desktop encryption keys.

    AWS provides both "CloudHSM" and "KMS";

    Google Cloud provides "Cloud KMS"

    If you use these services it means you submit raw data to the API and receive back encrypted data or to decrypt submit the encrypted data. In practise this limits the ability of an attacker to steal your keys, offsite the data, and decrypt in bulk. Access Control is managed through IAM. If your sites compromised they can still decrypt the data on the compromised servers which requires that you monitor "normal" behaviour for KMS requests. It doesn't eliminate the threat but it can help minimise the impact.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟