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 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序