如何通过AWS S3安全地共享文件?

时间:2018-01-04 10:54:34

标签: amazon-web-services amazon-s3

我希望每个提供该文件链接的人都可以访问它。但没有人能找到我的链接。

有没有一种安全的方法可以做到这一点?

1 个答案:

答案 0 :(得分:0)

假设您在aws中有一个存储桶,并且您希望隐藏来自访问它的人的链接,那么您可以使用CNAME方法。

Example CNAME Method

This example uses www.johnsmith.net as the bucket name and homepage.html as the key name. To use this method, you must configure your DNS name as a CNAME alias for bucketname.s3.amazonaws.com.

The URL is as follows:

http://www.johnsmith.net/homepage.html

The example is as follows:

GET /homepage.html HTTP/1.1
Host: www.johnsmith.net

但是,此方法存在一些限制。存储桶名称必须符合dns。

The CNAME DNS record should alias your domain name to the appropriate virtual hosted–style host name. For example, if your bucket name and domain name are images.johnsmith.net, the CNAME record should alias to images.johnsmith.net.s3.amazonaws.com.

images.johnsmith.net CNAME          images.johnsmith.net.s3.amazonaws.com.

SSL CASE

When using virtual hosted–style buckets with SSL, the SSL wild card certificate only matches buckets that do not contain periods. To work around this, use HTTP or write your own certificate verification logic. 

更多内容可以在这里阅读

https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html

如果它能解决您的问题,请告诉我。