How can i use my EC2 Elastic IP address as proxy server? - amazon-web-services

Please i need help in using elastic IP(assigned to instance) from AWS as proxy server, the first picture shows how other people are doing it. Users on my website will use it to login to another website that requires static IP(Doesn't change). I want to know how to authenticate EC2 elastic IP and use it as proxy server, all i have so far is i need to assign elastic IP to my instance on AWS, but i don't know how to authenticate the IPs once created. And i don't want to buy static IP from other company like brightdata or smartproxy.
This picture shows how other people are doing it, and the IP is from amazon:

Does your Public IP change that often? Can you just have them give you their 'IP Chicken' address and just use that?
I think based on what you are describing you want to whitelist IPs via an ACL. Here are some steps you can use:
https://www.purevpn.com/blog/whitelist-ip-addresses-on-aws/
If you do not want to use their Public IP from wherever they are, here is another workflow:
VPN to a Bastion Host (Jump Host)
Put the Public IP you whitelist to your application on the Jump host
Require your users access the Jump Host to access the website.
You can Use Amazon Elastic IPs without issue. It is a good idea.

Public IP addresses from AWS can only be used on AWS services (eg Amazon EC2 instances). They cannot be used on external services outside of AWS.
In your picture, the IP address is assigned to an Amazon EC2 instance.

Related

Aws - acm certificate bind to ec2 instance

I have an application and api running/hosted in same aws ec2 instance . I have enabled ssl cert using acm via load balancer for application domain . However , my api is exposing via ec2 public ip i.e http://ec2ip. In such scenario how can I bind ssl cert in IP address i.e https://ec2ip ?
You ideally don't want to have a public IP on your load-balanced EC2. You can achieve this by placing the EC2s in a private subnet. This will need bastion server in order to SSH though.
If you absolutely want HTTPS on an IP address, this SO page is the answer. If you do set that up, make sure that it is an elastic IP address.
If you have load balance you shouldn't directly access your instance using public IP. As per AWS documentation you shouldn't even have a public IP address for your instance.
someday if you run security assessment to your aws environment, AWS Foundational Security Best Practices v1.0.0 will be failed because of public IP.
EC2 instances should not have a public IPv4 address
This all about security concerns. Typically, only a Load Balancer is exposed to the Internet.
Back to Basics: Protecting Your Network in the Cloud

I want to prevent access to my website through EC2 Elastic IP and Public DNS. How do i do that?

The EC2 is configured correctly, Elastic Ip is attached and the domain is pointing to EC2 linux machine.
Everything is working perfectly fine. But the problem is that all 3 Elastic IP, The Public DNS provided by EC2 and the domain that I pointed to EC2 machine are all displaying the same content and i don't want that. I only want the website or the domain to display the contents and both elastic IP and the public dns should be inaccessible to public or the internet. How do i do that can someone please help?
I want this to work like for instance you bought a dedicated vps package from hostpapa or from a similar hosting provider. The dedicated IP's that they provide you are only accessible until you've connected a domain. The moment you configure the domain and assign one of the dedicated Ip to that domain. The connection from that ip address when ran on a browser gives you either a webmaster error or server not found. I am looking for that kind of solution

AWS free instance(Ubuntu) inbound and outbound request

I'm new to AWS.
I have a django application with API, I deployed it in heroku(free instance), for accessing the api url from other external resource we need static IP address,i came to know that heroku IP is not static , it keep on changing dynamically, to get static IP in heroku there is an add-on called QuotaGuard Static , will provide inbound and outbound request for the API,
Like wise I want to know whether AWS free instance has static IP for inbound and outbound request for the API or not? Or like heroku we need to add any add-on for it. Can you guys please suggest me whether static IP is available for free instance in AWS or we need to go for paid service. Thanks in advance.
The public IPs are static and do not change over the life of an EC2 instance.
However if you terminate an instance and spawn a new one then the public IP will change.
To overcome this you can use elastic IP.
Elastic IPs do not change (its like they are reserved for you)
The cool thing about elastic IP is that they are charged if not attached to any instance, but the moment you attach them to an instance they are free.
So if you use elastic IPs then you can use one static IP and it will not change even when you terminate the underlying EC2 instance and attach newly created EC2 instance

Is there EC2 Elastic IP that is public facing? without NAT?

I am hosting a SIP server in EC2 using elastic IP. However, I read that SIP server doesn't really work well if the server is not public facing (using NAT), because from what I read at AWS site, elastic IP is using 1:1 NAT.
The Elastic IP address is mapped to the instance using 1:1 NAT. The
instance itself is not aware of the public address.
Is there any public facing non-NAT static IP address that I can buy from Amazon and assign to my server? Or, this action is actually useless?
Thanks!
You can't have EC2 instance with public IP without NAT. Nevertheless all major PBX, proxy server or SIP server should work well with NAT. Freeswitch for example even have manual for running it in EC2:
https://freeswitch.org/confluence/display/FREESWITCH/Amazon+EC2
If you still want to get rid of NAT, you can try Digitalocean, it is similar to Amazon but without NAT.

EC2 - S3 connectivity

Is it possible to use S3 APIs from an EC2 instance that does not have a elastic / public IP? Alternatively, is it possible to whitelist the connection with S3?
We intend to use the APIs to read/write objects from a few buckets on S3.
Based on this:
Q: Do I need one Elastic IP address for every instance that I have running?
No. You do not need an Elastic IP address for all your instances. By default, every instance comes with a private IP address and an internet routable public IP address. The private address is associated exclusively with the instance and is only returned to Amazon EC2 when the instance is stopped or terminated. The public address is associated exclusively with the instance until it is stopped, terminated or replaced with an Elastic IP address. These IP addresses should be adequate for many applications where you do not need a long lived internet routable end point. Compute clusters, web crawling, and backend services are all examples of applications that typically do not require Elastic IP addresses.
It looks like you have a public IP even if you don't have an elastic IP, it'll just go away when you stop your instance (and can't be given to another box like elastic IPs can).
So yeah, you should be able to access S3 from any running EC2 instance.
As for whitelisting, I think it depends on how you're doing it? If you're using security groups, all outbound traffic is allowed by default and I don't think you can change that unless you're using VPC. If you're using an internal firewall you'll have to find the S3 IP ranges somewhere on the AWS forums.
You can whitelist and blacklist users and instances using S3 Bucket Policies or IAM Policies or both.
S3 Bucket Policies
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucketPolicies.html
IAM Policies
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingIAMPolicies.html