Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Cloudfront for VPC/VPN

Tags:

Does AWS allow usage of Cloudfront for websites usage, eg:- caching web pages. Website should be accessible within corporate VPN only. Is it a good idea to cache webpages on cloudfront when using Application restricted within one network?

like image 480
Chiran Ravani Avatar asked Feb 19 '16 15:02

Chiran Ravani


People also ask

Can we connect VPC using a software VPN?

You can use an AWS managed VPN connection or a third-party VPN solution. Use a third-party solution if you require full access and management of the AWS side of the VPN connection. After creating your connection, you can download the Internet Protocol Security (IPsec) VPN configuration from the VPC console.

How do I add a VPN to VPC?

Click Actions -> Attach to VPC and select the AWS VPC the instances you wish to connect are located within. You can create an IPsec VPN connection between your VPC and your remote network. On the AWS side of the VPN connection, a virtual private gateway provides two VPN endpoints (tunnels) for automatic failover.

What is the difference between VPN and VPC in AWS?

A VPC is a private network on the cloud. Multiple VPCs can be created in the same region but are isolated from each other. A VPC can be divided into multiple subnets. A VPN gateway is created based on a VPC and is the access point of a VPN connection.

What two types of VPN services are available in AWS choose two?

AWS VPN is comprised of two services: AWS Site-to-Site VPN and AWS Client VPN. AWS Site-to-Site VPN enables you to securely connect your on-premises network or branch office site to your Amazon Virtual Private Cloud (Amazon VPC). AWS Client VPN enables you to securely connect users to AWS or on-premises networks.


1 Answers

As @daxlerod points out, it is possible to use the relatively new Web Application Firewall service with CloudFront, to restrict access to the content, for example, by IP address ranges.

And, of course, there's no requirement that the web site actually be hosted inside AWS in order to use CloudFront in front of it.

However, "will it work?" and "are all the implications of the required configuration acceptable from a security perspective?" are two different questions.

In order to use CloudFront on a site, the origin server (the web server where CloudFront fetches content that isn't in the cache at the edge node where the content is being requested) has to be accessible from the Internet, in order for CloudFront to connect to it, which means your private site has to be exposed, at some level, to the Internet.

The CloudFront IP address ranges are public information, so you could partially secure access to the origin server with the origin server's firewall, but this only prevents access from anywhere other than through CloudFront -- and that isn't enough, because if I knew the name of your "secured" server, I could create my own CloudFront distribution and access it through CloudFront, since the IP addresses would be in the same range.

The mechanism CloudFront provides for ensuring that requests came from and through an authorized CloudFront distribution is custom origin headers, which allows CloudFront to inject an unknown custom header and secret value into each request it sends to your origin server, to allow your server to authenticate the fact that the request not only came from CloudFront, but from your specific CloudFront distribution. Your origin server would reject requests not accompanied by this header, without explanation, of course.

See http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/forward-custom-headers.html#forward-custom-headers-restrict-access.

And, of course, you need https between the browser and CloudFront and https between CloudFront and the origin server. It is possible to configure CloudFront to use (or require) https on the front side or the back side separately, so you will want to ensure it's configured appropriately for both, if the security considerations addressed above make it a viable solution for your needs.

For information that is not highly sensitive, this seems like a sensible approach if caching or other features of CloudFront would be beneficial to your site.

like image 166
Michael - sqlbot Avatar answered Oct 13 '22 08:10

Michael - sqlbot