how to block a bot from causing high data downloads

0

Hi,
I have noticed excessive downloads of our mp3 files which are stored on Amazon s3

  • it seems that a Russian search engine bot Yandex (https://myip.ms/info/whois/141.8.144.47 ) is downloading our mp3 files causing excessive data traffic.
    Is it possible to block this IP address, while keeping the files public, or how should be prevent Yandex downloading so much? Is a robots.txt file something to consider? (which I know nothing about!)

Many thanks

IrishCM
已提問 5 年前檢視次數 190 次
4 個答案
0

Hello
The robots.txt file is an agreement which is not mandatory so it may help but it does not stop Yandex from keep doing it.
You can create a bucket policy to denie access to an IP address or IP address range.

here is an example
https://aws.amazon.com/premiumsupport/knowledge-center/block-s3-traffic-vpc-ip/

hope this helps
Rt

rtt
已回答 5 年前
0

Thank you so much.
However, the example you give is for blocking all access and giving permission to specific IP addresses. I wish to do the opposite - to give public access, but block specific IP addresses.

Is there JSON code you know of which does this please?
thanks again

IrishCM
已回答 5 年前
0

Hello
Sorry, this link should have a bit more info.

https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-3

a little modification to the other example and you have it.

{
  "Version": "2012-10-17",
  "Id": "S3PolicyId1",
  "Statement": [
    {
      "Sid": "IPAllow",
      "Effect": "Deny",
      "Principal": "*",
      "Action": "s3:*",
      "Resource": "arn:aws:s3:::examplebucket/*",
      "Condition": {
         "IpAddress": {"aws:SourceIp": "54.240.143.24/32"}
      } 
    } 
  ]
}

RT

rtt
已回答 5 年前
0

Thank you so much - have it sorted. Really appreciate your time.

IrishCM
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南