Managing network security aspects in the public cloud
Tags: aws, cloud, security, cybersecurity
Published: 2023-04-10 15:56:58

Managing cloud environments on large scale has many challenges.  
One of the challenges many organizations are facing is managing network inbound/outbound network connectivity to their cloud environments.  
Due to the nature of the public cloud, all resources are potentially public, unless we configured them otherwise.  
## What are the challenges in the network security domain?
There are many challenges related to network security, here are the most common ones:  
* Unauthorized inbound network access – Publicly facing resources (such as virtual machines, object storage, databases, etc.) allowing anyone on the Internet access to the resources  
* Unrestricted outbound network access – Internal resources (such as virtual machines, databases, serverless, etc.) can initiate outbound traffic to resources on the public Internet  
* Managing network access rules at large scale – Ability to control thousands of firewall rules created over time, while managing multiple accounts for a specific cloud provider (or even multiple different cloud providers)  
* Understanding the network attack surface – Ability to get a clear view of what inbound or outbound traffic is allowed or denied in a large cloud environment with multiple accounts  
* Enabling the business, while keeping the infrastructure secure – Ability to respond to multiple business requests, using small network/information security / IT team  

With all the above challenges, how do we keep our cloud network infrastructure secure and at a large scale?  

## Set Guardrails
One of the common ways to configure guardrails is to use organizational policies using Policy-as-Code.  
All major cloud providers support this capability.  
It allows us to configure rules for the maximum allowed permissions over our cloud environments according to our company security policy while allowing developers / DevOps to continue provisioning resources.  

### AWS Service control policies (SCPs)
Below are sample service control policies that can be configured at the AWS organizational level (with inheritance to the underlining OU's), for restricting inbound access:  
* [Detect whether any Amazon EC2 instance has an associated public IPv4 address](https://docs.aws.amazon.com/controltower/latest/userguide/data-residency-controls.html#ec2-instance-no-public-ip)  
* [Detect whether Amazon S3 settings to block public access are set as true for the account](https://docs.aws.amazon.com/controltower/latest/userguide/data-residency-controls.html#s3-account-level-public-access-blocks-periodic)  
* [Detects whether an Amazon EKS endpoint is blocked from public access](https://docs.aws.amazon.com/controltower/latest/userguide/data-residency-controls.html#eks-endpoint-no-public-access)  
* [Detect whether the AWS Lambda function policy attached to the Lambda resource blocks public access](https://docs.aws.amazon.com/controltower/latest/userguide/data-residency-controls.html#lambda-function-public-access-prohibited)  
* [Detect whether any Amazon VPC subnets are assigned a public IP address](https://docs.aws.amazon.com/controltower/latest/userguide/data-residency-controls.html#subnet-auto-assign-public-ip-disabled)  

## Controlling inbound/outbound network traffic at scale
At large scale, we cannot rely on the built-in layer 4 access control mechanisms (such as AWS Security groups, Azure Network Security Groups, or GCP Firewall Rules) to define inbound or outbound traffic from/to our cloud environments.  
For large scale, we should consider alternatives that will allow us to configure network restrictions, while allowing us central visibility over our entire cloud environment.  
Another aspect we should keep in mind is that the default layer 4 access control mechanisms do provide us advanced protection against today's threats, such as the ability to perform TLS inspection, control web traffic using URL filtering, etc.  
### Cloud-native firewall services:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/03k08utr6qrxm2l5px3k.JPG)
Note: If you prefer to use 3rd party NGFW, you can deploy it using [AWS Gateway Load Balancer](https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/introduction.html) or [Azure Gateway Load Balancer](https://learn.microsoft.com/en-us/azure/load-balancer/gateway-overview).  
### Additional reference
* [What is AWS Network Firewall?](https://docs.aws.amazon.com/network-firewall/latest/developerguide/what-is-aws-network-firewall.html)  

## Understanding the network attack surface
One of the common issues with large cloud environments is to have a visibility of which inbound or outbound ports are opened to the Internet, exposing the cloud environment.  
Example of service to allow network visibility:  
* [AWS Network Access Analyzer](https://docs.aws.amazon.com/vpc/latest/network-access-analyzer/what-is-network-access-analyzer.html)  

Another alternative for getting insights into attack surface or network misconfiguration is to deploy 3rd party [Cloud Security Posture Management (CSPM)](https://www.gartner.com/reviews/market/cloud-security-posture-management-tools) solution, which will allow you central visibility into publicly accessible virtual machines, databases, object storage, and more, over multiple cloud providers' environments.  

## Summary
In this blog post, I have presented common challenges in managing network security aspects in cloud environments.  
Using a combination of organizational policies, strict inbound/outbound traffic control, and good visibility over large or complex cloud environments, it is possible to enable the business to move forward, while mitigating security risks.  
As the cloud threat landscape evolves, so do security teams need to research for suitable solutions to enable the business, while keeping the cloud environments secure.  

### About the Author
Eyal Estrin is a cloud and information security architect, the owner of the blog [Security & Cloud 24/7](https://security-24-7.com/) and the author of the book [Cloud Security Handbook](https://amzn.to/3xMI4Ak), with more than 20 years in the IT industry.  
Eyal is an [AWS Community Builder](https://aws.amazon.com/developer/community/community-builders/) since 2020.  
You can connect with him on [Twitter](https://twitter.com/eyalestrin) and [LinkedIn](https://www.linkedin.com/in/eyalestrin/).