How can I restrict IP addresses dynamically and release them after 24hrs?

0

I want to restrict the IP address for some hours(say 24 hrs), for those who query to my AWS s3 bucket(public read only) for more than 100/second. As they might be spam and wanted to harm my business by increasing traffic and raising my AWS costing. So far I have not found any policy example to perform this. How can I restrict these type of IP addresses dynamically and release them after 24hrs?

질문됨 일 년 전322회 조회
2개 답변
1

Unfortunately there isn't an easy one click option afaik - One way I can think of this could be achieved is you would need to enable server access logs for your s3 bucket - this would contain the source request information you require.

You would then need to process these logs. You could use lambda to send the data to a log aggregation service like Opensearch where you can perform the processing and take action - see this blog. Another option is have a step function run on a schedule to use Athena to query the logs and take action (update your bucket policy to block). The main difference between these two options is how real time you need to process the logs and put the block in place

AWS
전문가
Peter_G
답변함 일 년 전
0

Another approach is to front the bucket with CloudFront and dynamically update a WAF ACL with a deny list. You could send the CloudFront logs to S3 and use Athena to query. This has the added benefit of not having a public bucket.

profile pictureAWS
전문가
kentrad
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠