0

My Config is a single EC2 instance. I'm new to aws and inherited this architecture. We want to create an endpoint that will be accessible only from the office (specific IP).

What is the best way to achieve that?

is there a vpc / security group rule that will block a certain endpoint regex?

for example

    allow traffic to */sensative_endpoint/* only from 84.100.*.*
    for all rest of the endpoints - allow from all ips

thanks.

WebQube
  • 131
  • 5
  • 1
    You would typically do this within the web server configuration on the instance. Nginx / Apache are the most common web servers used. – Tim Jul 06 '20 at 07:56

1 Answers1

1

As pointed out in the comments this is probably best solved on the web server running on the ec2 instance.

If you are looking for a managed solution you should check AWS WAF - Web Application Firewall. WAF checks every request for the path and a bunch of other parameters and allows to define block and allow rules based on those request parameters. If you are running just a single ec2 instance this is however probably overkill.

You cannot solve this just using security groups as those operate at lower OSI layers and don't take the path (to the sensitive endpoint) into account.

Henrik Pingel
  • 9,380
  • 2
  • 28
  • 39