使用AWS KMS在应用程序级别加密Postgres列

发布于 2025-02-10 06:00:18 字数 779 浏览 2 评论 0原文

问题

我需要将加密数据存储在Postgres列中。

我知道 pgcrypto ,但是我以前没有使用过,我没有使用过''' T有很多时间来研究和理解它(考虑到我将存储在列中的数据,我想这是我想要的)。

但是,我确实对 aws kms kms

我的阻力最小的直接路径是在应用级别处理加密。

建议的解决方案

  • 使用KMS SDK加密纯文本数据。
  • 通过ORM将加密数据保存到列中。
  • 通过ORM从数据库中检索加密的数据。
  • 使用KMS SDK解密加密数据。

钥匙将使用EC2 IAM角色在KWS中固定。

很高兴知道:

  • 这个特定表不经常查询,因此在这种情况下,性能并不是我最大的关注点。
  • 我的需求比简单地使用RDS使用加密更具体。

问题:

  • 以这种方式处理数据库数据的加密有潜在的缺陷吗?

Problem

I need to store encrypted data in a Postgres column.

I know of pgcrypto, however I haven't used it before and don't have a lot of time to research and understand it (which I'd like to, given the data I will be storing in the column).

However, I do have a fairly solid and practical understanding of AWS KMS.

My immediate path of least resistance is to handle the encryption at the application level.

Proposed Solution

  • Encrypt the plain text data using the KMS SDK.
  • Save the encrypted data into the column via the ORM.
  • Retrieve the encrypted data from the database via the ORM.
  • Decrypt the encrypted data using the KMS SDK.

The key would be secured in KWS using EC2 IAM roles.

Good to know:

  • This particular table is not queried often, so performance is not my biggest concern in this instance.
  • My needs are more particular than simply using Encryption at Rest with RDS.

Question:

  • Are there any potential flaws in handling the encryption of database data in this manner?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文