Configuration Management is the Next Best Option
The use of a Privileged Access Management (PAM) tool can provide additional benefits such as:
- time based or temporary access to elevated privileges
- granular privilege management
- session recording and audit trails
- password and secrets management
- multi factor authentication
Additional Best Practices To Prevent Unauthorized Access
Finally, in addition to choosing a method for providing access, it’s critical to observe a few additional best practices:
- Keep instances up to date and patched.
- Enforce hardening that encompasses security best practices around OS hardening
- Add monitoring for vulnerabilities to ensure that either OS or application vulnerabilities are addressed as soon as possible.
- Implement monitoring and alerting for suspicious events using tools such as intrusion detection systems or IDS or security information and event management or SIEM tools.
Further Research
Background Reading on Privileged Access Management
AWS Systems Manager Session Manager
Controlling Network Traffic
Ingress
Ingress can be required to access services and resources that are running in our cloud environment.
A few examples of ingress traffic are:
- Web application traffic comes from the internet to your web applications.
- Traffic comes from other cloud virtual private networks.
- Traffic comes from on-premise networks such as data centers or corporate offices for management, internal user traffic, or other application integration for hybrid cloud environments.
Egress
We also need to be able to access the internet or other external networks for our applications to be able to function. We will call this egress.
Common egress destinations are:
- Integrations with other cloud based APIs.
- Application API traffic to AWS cloud services.
- Downloading patches, etc.
- Sending monitoring and metric data to external tools.
Controlling Access
Ingress traffic can be controlled and restricted using network ACLs, security groups, which are both effective firewalls, routing rules, and host based endpoint security tools which oftentimes contain firewall capabilities.
In addition to the configuration of ACLs and security groups, private access to VPC networks is also required, either from user work locations or from corporate-owned network spaces.
Egress traffic in AWS is generally handled using internet gateways and nat gateways. As with ingress traffic, egress traffic should also be controlled and restricted for a number of reasons.
Restrict Access to Cloud Resources
The use of firewalls will provide the ability to granularly restrict and control network traffic to and from cloud VPCs, subnets, instances, databases and other resources which reside in the private IP space of your VPCs.
Our goal should be to limit and restrict connectivity to specific IP ranges and ports.
This is traditionally done with the use of firewalls. In the cloud, there are a number of ways that we can implement firewall functionality.
1. Host based firewalls
Host based firewalls allow server admins and developers to define at the operating system level specific inbound and outbound sources and ports.
2. Firewall appliances
Commercial Firewall products or appliances can also be deployed in cloud environments.
3. Network ACLs
Network ALCs can be applied at a subnet level and allow you to add multiple firewall rules.
4. Security Groups
Security groups are a second layer and by far the most utilized tool to restrict traffic to and from your cloud hosts and instances
Most cloud native patterns will at minimum tend to use a combination of NACLs and Security groups.
General Guidelines for using ACLs and Security Groups
- Know and define your trusted networks for your source and destination traffic.
- Apply ACLs for incoming traffic to all subnets based on trusted networks.
- Apply Security groups to instances based on the role or functionality of that instance or application.
- For both Security groups and NACLs, following the principle of the least privilege only allows traffic from specific hosts or IP ranges to specific ports.
- Determine the default Security group for a VPC.
Further Reading
Egress Control
Using NACLs and security groups to restrict internet bound traffic to specific entities is not the best approach.
AWS provides a few different conduits for connecting to internet sites from our VPC subnets:
- Resources deployed in a subnet can be assigned to public IP addresses and will have internet bound traffic routed through an "internet gateway".
- A NAT instance or NAT gateway can be deployed in public subnets so that instances in other subnets can use this device to gain access to the internet.
From a security perspective, it is not practical to deploy all application resources that require internet connectivity into a public subnet. This widens the attack surface and leaves the environment open to exploitation.
To solve this, a device such as the NAT gateway is the most common solution.
The shortfall with the NAT gateway solution from a security perspective is that it is difficult to monitor and restrict traffic at the application layer to specific domains and sites.
A Few Solutions
-
Set Up a Web Proxy Layer: This is the simplest way to log application internet traffic. Proxies can also be used to restrict traffic to allowed sites. There are a few drawbacks:
-
Additional Configuration: applications and instances that require internet access will need to be configured to make use of an http proxy.
-
The proxy farm itself will need to be configured, managed and maintained.
-
In-Line Gateway Appliance: These appliances generally come from commercial vendors and provide a range of capabilities for controlling and inspecting outbound traffic out of the box. Cost is the biggest barrier to this approach.
-
Host-Based IDS: A host-based IDS is an agent based solution that runs on each instance. Providing many of the capabilities that the in-line gateway appliance provides including egress control and data loss prevention, intrusion detection and prevention. The biggest disadvantage is enforcing that all hosts in your environment have the agent running.
Additional Resources
We highly advise this article be reviewed in detail.
Access to Cloud Networks
Previously, we talked about obtaining console login access to cloud servers and instances. Oftentimes, developers and engineers will need to establish network connectivity with these hosts and other hosts running in private subnets, such as RDS database instances, etc.
Here, we will outline a few methods for establishing network access to resources running in your cloud environments.
Methods for Establishing Network Access to Resources Running in your Cloud Environments
Bastion Hosts
Bastion hosts, or jump hosts, are set up in a public subnet to allow a user to login from either their home or office network, and subsequently access or jump to resources in private networks.
- Pros: It is a simple and low cost method for getting onto your cloud VPC.
- Cons: It needs additional effort to harden the bastion host. It is not scalable for many users, and may not work if client applications need to be on the user's laptop or desktop. It is a common target for attackers who hope to gain access to the network by exploiting a vulnerability on the bastion host.
Virtual Desktop Solution
Similar to a bastion host, except that each user will get their own virtual bastion.
- Pros: It allows users to install their desktop application clients in the cloud environment without having connectivity to the VPC from their local laptop
- Cons: It costs more than a bastion host. Users will not have direct connectivity to any backend services in the VPC.
Client VPN
A client VPN solution allows a user to connect to the cloud VPC using a secure VPN client to establish an encrypted tunnel.
- Pros: Easy to set up. It has the ability to manage many users and roles. It places the user into the VPC so that they may use client applications on their local host to hit the resources deployed in the VPC.
- Cons: It has additional cost as compared to a bastion host. Users may need to install proprietary VPN clients on their local machines.
Site-to Site-VPN
We can connect a local trusted network's firewall with the AWS VPN service to establish VPN tunnel connectivity from the entire local network to the AWS VPC network.
- Pros: No need to install any VPN client software on each user's local machine.
- Cons: Additional routing and configuration needs to be performed on the local network. It often leads to delays in setup. No role based routing.
Direct Connect Link
A dedicated link from a corporate office network or co-location datacenter.
- Pros: Dedicated bandwidth. It is ideal for hybrid cloud environments.
- Cons: Higher costs and require more time to set up. Once set up, if users are not on the corporate LAN, a solution such as VPN or VDI will still need to be implemented. Generally, it is not an option for small or virtual teams that do not have a LAN to work out of.
Additional Resources
From:
To: