Exposure Reduction Guideline
Achieving a secure infrastructure is a serious undertaking, costing non-trivial time and resources. The cost to value ratio of any decision and mechanism has to be heavily considered before they could be implemented. This guideline provides opinionated recommendations on: which property of the infrastructure to focus on primarily for exposure reduction; an all-too theoretical approach to optimizing that property, and finally two technical measures for solving parts of the situation.
Achieving a secure infrastructure is a serious undertaking, costing non-trivial time and resources. The cost to value ratio of any decision and mechanism has to be heavily considered before they could be implemented. This guideline provides opinionated recommendations on: which property of the infrastructure to focus on primarily for exposure reduction; an all-too theoretical approach to optimizing that property, and finally two technical measures for solving parts of the situation.
#1: Infrastructure Exposure & Optimizing it in Theory
Priority❓ Did you just come up with new terminology?
🗣️ Maybe 🤷♂️
Even though you might not be familiar with Exposure, the term Attack Surface is probably not alien to you. Now if you isolate the social, psychological and humane aspects of Attack Surface, you are left with purely technical subset, which is exactly Infrastructure Exposure.
Why should I care about exposure?
❓ Can you come up with an unwritten cybersecurity rule?
🗣️ Any asset reachable by malicious entities will (sooner or later) be attacked.
In other words, if its exposed, it will be targeted by a threat actor. What does this mean when designing a secure infrastructure?
- A high value-to-cost ratio mechanism for securing your infra is decreasing exposure.
- You need to think about exposure in a multi dimensional way, consider the different contact surfaces of your infra and devices.
- Don't forget about usability. Too strict exposure limitations will start meddling with it in all the wrong ways. (Always consider confidentiality, integrity and availability in unison.)
🥜 Limiting exposure means (in a nutshell): making only the crucial fragments of the infrastructure available on the right contact surfaces, with proper governance, while taking care that access to these fragments does not get complex for authorized parties.
Contact surfaces
Contact surfaces can be defined on a per-device-per-service basis, but are most often generalizable to machines with similar "missions". Defining contact surfaces means defining outside entity groups, inside which all entities have the same set of attributes.
The first attribute to consider is the need-to-reach: whether an entity should be able to communicate with the machine. This attribute divides all entities into two sets: wanted & unwanted.
When choosing which entities should be wanted, obey the rules of Least Privilege and Need to know principles.
The entities must be further attributed with trust: entities are either untrusted or slightly-trusted. Untrusted entities are those which we do not know anything about, while slightly trusted are either part of the intranet (including those that can connect via VPN), owned or used by an authorized personnel, ...
When engineering the attribute of trust, obey the rules of Zero Trust where possible.
Based on these attributes different technical opportunities arise to secure the contact surfaces, at least in theory. Unwanted entities should be isolated from the subjects on the network, while trust-based differentiation should be done in the service.
Contact surfaces can help you prioritize the tasks of exposure limitation.
Exposure in Practice
While in theory the optional mechanisms of exposure limitation are straightforward, in practice the dynamic nature and complexity of networks & infra will "throw forks" into the process. Network appliances, firewalls are not armed with enough processing power to keep separate sets of rules for each contact surface. Therefore, machines that are similar in contact surfaces should be put into subnets, therefore contact surfaces can be - at least partially - secured on the subnet borders.
The contact surface for unwanted & untrusted entities overlaps for most of the machines, or rather it is a good idea to manage it at the infrastructure perimeter via network reachability =~ firewalls. Generally you want to disallow any reachability on this surface and use exceptions when needed. For a university, we have compiled the following list of meaningful exceptions with use-cases:
Possible untrusted accesses by machine MISSION
For the other contact surfaces, governance via network reachability is a possible solution. When many contact surfaces overlap, aggregations over machines and the entities into (virtual)subnets might be available. The engineering of these subnets, the aggregation is a tedious work, and it heavily depends on the usage and design of the infrastructure. Therefore, we won't provide any generic advice here.
In cases where governance via network reachability between subnets fails, we have to look at the machines and the services themselves. There are too many services to aid you in securing all of them, so we chose the SSH protocol (as the most used representant in remote management services) on which we show you some general principles and some protocol-specific configurations to make it as secure as possible.
& Securing SSH
Exposure Reduction for SSHDepending on the particular state & needs, reducing exposure for SSH might be a different process for every infrastructure, however there are common points for many:
- If SSH is not needed to be reached on a machine by anyone, it should be disabled.
- If wanted entities are easy to aggregate into a few subnets, network or host firewalls should be set up.
- Configure SSH in a secure way, that withstands intentional attacks by either insider threats or compromised slightly-trusted entities. Follow the recommended SSHD Configuration primer (below)
- Use SSHs' authentication scheme to govern the contact surface via users and public key cryptography.
- For very complex or voluminous networks, implement the bastion security principle.
Bastion
The bastion principle means placing an intermediary entrypoint into the infrastructure to handle governing multiple contact surfaces for all machines providing the same service. Then, reachability is between the machines and the bastion, and the bastion and the outside entities. This way, the bastion aggregates all machines under one IP address, and can aggregate the wanted entities for all protected machines.
Bastions are usually made up of a cluster of servers for availability, but for the parties they seem like a single proxy point.
Further contact surfaces are then managed via the bastion host itself, in a centralized manner. It provides an authentication & authorization interface that can be independent of network identificators, might support Role-based access control (RBAC) and aggregate outside entities of matching contact surfaces into groups. Furthermore, it provides heavy accounting capabilities.
Implementing bastions is a fragile and tedious process. Fortunately, some out-of-the-box solutions exist, such as the open-source Bastion from OVH, the partially open-source teleport from Gravitational or HashiCorp Boundary.
This result was supported by the SOCCER project, funded under Grant Agreement No. 101128073, with the support of the European Cybersecurity Competence Center (ECCC).