Skip to content

How to Implement Socks5 EC2

0

I had to implement a docker container with a socks5 that I use in one of my systems to avoid the Rate Limit Exceed of an API that I have but I see that it is prohibited by Amazon's terms, what would be the correct way to implement a SOCKS5 without affecting the terms and AWS conditions?

As I understand it, I should make it private or implement it with auth for that to be legal or how I can achieve it without affecting the terms of AWS

asked 2 years ago764 views

8 Answers
2
Accepted Answer

Does the system making the calls from outside AWS have a static public IP address or IP address range? If you configure the security group of the AWS-hosted proxy to permit traffic only from a small handful of IP addresses of your servers/containers hosted on premises or elsewhere outside AWS, and combine that with authentication at the SOCKS5 protocol layer using a randomly generated, long password, that would make your proxy reasonably secure and not reachable by the vast numbers of opportunists and criminals probing the internet all the time. I believe AWS would also accept strict IP restrictions as sufficient, even though the traffic runs over the public internet.

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

0

Do you mean that you've exposed a SOCKS5 proxy to the public internet, and it can be used to proxy requests going to any destination, including the public internet and AWS service endpoints, instead of only being limited to your own, custom API as a destination?

Where is your API located that you are meaning to be accessed through the proxy? And is it meant to be called by any arbitrary user anywhere on the public internet, or is it only meant for your internal users or named customers, for example?

EXPERT

answered 2 years ago

0

The api I use accesses a scrap on Twitter, but due to new Twitter limitations now x, they limit the frequency by IP instead of by account, so I use ips from my servers to avoid the annoying "rate limit" that It gives me IP, currently it is a program that is in charge of making the requests, it is exclusively private use, but I think the issue is that Amazon believes that the proxy, by not having auth, is exposed to everyone, if I add auth to the proxy then there shouldn't be a problem?

answered 2 years ago

0

Is it the SOCKS5 protocol port that is accessible from everywhere on the internet? Or is the SOCKS5 proxy only used by your own custom code, and that custom code can be accessed from everywhere on the internet to trigger requests to be made to Twitter/X?

EXPERT

answered 2 years ago

0

SOCKS5 was, past tense because I was already notified that AWS was open to the public, but that does not mean that "everyone" used it, which is why I received alerts from Amazon saying that it could be an abusive practice, the script that uses the proxy socks5 runs privately and individually through cronjobs, so no one other than the system itself makes exclusive use of the proxy. The issue is that many requests are made per day per hour and would that fall into abuse? The question is, if I add AUTH protection to the socks5, I won't violate the rules? Or is it due to the number of requests since I emphasize that the use of SOCKS5 is exclusively for personal use for my system

answered 2 years ago

0

If the cron jobs are running inside the same VPC where the SOCKS5 proxy would be running; you configure the EC2 security group(s) attached to the proxy only to permit inbound access from the private IPs and/or other security groups inside your VPC; and requests to Twitter cannot be triggered by an outsider but only by your system's crontab schedule or you personally, then it wouldn't be publicly accessible in the way AWS or other service providers mean.

Simple username/password authentication configured on a publicly accessible SOCKS5 proxy very well might not suffice, and I wouldn't recommend it either, when security groups provide 20x-100x more powerful defence at no extra cost or management effort. Proxy ports, publicly accessible SSH endpoints, etc. are massively popular targets for countless opportunists scanning the internet and trying to brute-force them or exploit vulnerabilities 24/7.

EXPERT

answered 2 years ago

0

I understand, I can use sock5 all via private IP and this way there would be no possible abuse, but I have another issue, the API designed in PYTHON is on another server outside of Amazon's VPC because it uses multiple connections and high usage . of CPU/RAM, then I could create some kind of private tunnel from my external amazon aws server so that I can use the SOCKS5 proxy, since you tell me that the AUTH issue cannot be 100% secure, what I am looking for is that amazon Please do not consider my proxies as abuse.

It is worth clarifying that I have never suffered any type of abuse of my SOCKS5 and I open this thread only because AWS support asked me to find a solution since the way I used it seemed to be "abuse" when it was public

answered 2 years ago

0

Excellent great idea, I'm going to implement it like this or I'll see if I move the app to AWS, thank you very much for the guidance, I'll come back if it doesn't work. luck

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.