简体   繁体   English

如何在 Amazon S3 上安全地存储图像

[英]How to securely store images on Amazon S3

I want to securely store images on Amazon S3, or elsewhere in AWS.我想将图像安全地存储在 Amazon S3 或 AWS 的其他位置。

I'm looking for a solution similar to FireBase'sUser Security我正在寻找类似于 FireBase 的用户安全的解决方案

In firebase what i want to achieve would work something like this:在 firebase 中,我想要实现的是这样的:

// Only a user or admin can read and write their passport
match /users/{userId}/passport.png {
  allow read: if request.auth != null && request.auth.uid == userId || request.auth.admin == true ;
  allow write: if request.auth != null && request.auth.uid == userId || request.auth.admin == true;
}

Thank you!谢谢!

There are many avenues to explore with S3 and I have broken them down below.使用 S3 可以探索许多途径,我在下面对它们进行了细分。

Authorization授权

Permissions in AWS are primarily controlled via IAM . AWS 中的权限主要通过IAM控制。 You would create a policy with the permission set, then attach this to either a user, group or role within AWS.您将创建具有权限集的策略,然后将其附加到 AWS 中的用户、组或角色。 Your application would use the user or role to communicate with the S3 APIs.您的应用程序将使用用户或角色与 S3 API 进行通信。

S3 also support bucket policies that allow further conditional based requirements such as source (VPC endpoint, IP address etc) to lock down the maximum permissions another principal (such as your IAM user or even another account) can use. S3 还支持允许进一步基于条件的要求的存储桶策略,例如源(VPC 端点、IP 地址等)来锁定另一个主体(例如您的 IAM 用户甚至另一个帐户)可以使用的最大权限。

If you need to lock down specific objects, you can make use of S3 ACLs to apply permissions.如果您需要锁定特定对象,您可以使用 S3 ACL 来应用权限。

Encryption in Transit传输中的加密

S3 supports encryption in transit. S3 支持传输中的加密。 Using S3's HTTPs endpoint you can ensure that your data will be encrypted whilst it traverses the internet.使用 S3 的 HTTPs 端点,您可以确保您的数据在通过互联网时被加密。 If you want to keep this communication private you can enhance this process by using a VPC endpoint to keep all communication within the AWS backbone.如果您想保持此通信的私密性,您可以通过使用VPC 终端节点将所有通信保持在 AWS 主干中来增强此过程。

Encryption at Rest Rest 加密

S3 has many methods of encrypting data at rest. S3 在 rest 有多种加密数据的方法。 The options are as follows:选项如下:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM