使用AWS KMS在应用程序级别加密Postgres列
问题
我需要将加密数据存储在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论