© Raymond Pompon 2016

Raymond Pompon, IT Security Risk Control Management, 10.1007/978-1-4842-2140-2_17

17. Network Security

Raymond Pompon

(1)Seattle, Washington, USA

People must communicate. They will make mistakes, and we will exploit them.

—James Clapper

Imagine a network worm using a variety of attacks to infect the most popular operating system on the Internet. The author of the worm was so technically skilled that within hours of being launched, it infected one out of ten machines on the Internet. It was called the Morris worm1 after its creator Robert Morris, a computer scientist. The worm hit in 1988, before some people in the security field were even born.

Soon after, network worms plagued the first decade of commercial Internet usage . The nightly news gave the world its first real taste of hacking with stories on worms like Blaster, Lovebug, Code Red, Nimda, and SQL Slammer. What has changed since then? For one, hackers have learned to be stealthier and monetize their malware. Instead of vandalizing the Internet, many worms are honed to fulfill a purpose, usually economic. Many security professionals, including me, began our IT security career doing network defense and battling network worms. Even now, network security has become a core competency of IT security.

Today, a majority IT security attacks still originate over the network. The attacks that don’t originate from a network still usually involve a network in some manner. Social engineering attacks are mostly Internet-driven with fake e-mails (phish), booby-trapped sites (watering holes), or fake web sites (pharms). Even some physical security attacks can involve breaking into facilities to plant network spy devices. It seems that every device and application is now Internet aware, where even our household appliances supporting social media accounts.2

Understand Networking Technology

This chapter is not going to teach you everything you need to know about network security. Instead, it is going to highlight the major aspects and nuances of the network security issues. Regarding networking technology, there are a few key concepts you should understand, including:

  • Network protocols rely on software. All software has bugs. Network attackers can exploit those bugs in unexpected ways to produce malicious results.

    • For example, the ping-of-death exploits a bug in old operating systems such that a single malformed or malicious ping packet crashes the system.3

    • Dedicated network devices and appliances also run on software that can have bugs. Those bugs can be exploited as well.4

  • There is a difference between the IP protocols of TCP, UDP, and ICMP:

    • TCP connections establish a connection by sending and receiving handshakes and sequence numbers. This makes full TCP connections very difficult to fake. Some denial-of-service (DoS) attacks and network probes try to exploit that handshake sequence.5

    • UDP and ICMP network packets are one-way from sender to receiver with no handshake and therefore can be faked.

    • Common network services that use UDP include Domain Name Services (DNS) , Simple Network Management Protocol (SNMP) , Network Time Protocol (NTP) , Trivial File Transfer Protocol (TFTP) , and Network File System (NFS) . These services can be faked and used in DoS reflection attacks.

    • Most notorious of these weak services are SNMPv1, Telnet, and FTP. These services can be used send files or commands to running systems or file stores. They should never be used over untrusted networks for anything important.

    • ICMP packets have different types with different purposes. Ping (Echo Request) and Echo Response are two parts of ICMP. ICMP Redirect is another, which means don’t send this packet here, send it over there. Attackers can use redirects to reroute traffic around security devices or create DoS attacks.

  • RFC 1918 addresses are usually used for local area networks.

    • You should never see RFC 1918 addresses on the Internet.

    • Firewalls can network address translate (NAT) between live Internet addresses and RFC 1918 addresses, such as 10.0.0.1 and 192.168.2.3.

These are the highlights of the major topics with network protocols. If you are really interested in doing more work in network security, there is a huge variety of learning material out there. You can start with the “Further Reading” section at the end of this chapter.

Network-based Attacks

The global reach of the Internet provides a vast swamp for anonymous adversaries to strike from and hide in. As everything is always connected, attacks can come at anytime from anywhere. Some network attacks are one-off, with a single attack delivering the final effect such as denial of service or information leakage. Other network attacks are part of a chain that can include self-replicating malware (worms) or create a gateway for additional exploitation. What do these attacks look like? Table 17-1 breaks down the major network attacks and their common impacts.

Table 17-1. Network Attacks and Common Impacts

Network Attack

Common impacts

Remote exploits

Anything up to full control of impacted host, including remote command execution, remote control, denial of service, information leakage, or installation of self-replicating copies of itself.

Remote password guessing

The same level of authorization granted to the user of the compromised authentication.

Drive-by-downloads

Anything up to full control of impacted host, including remote command execution, remote control, denial of service, information leakage, or installation of self-replicating copies of itself.

Network denial of service

Denial of service. Can be temporary (flooding attack) or long-term (crash the server and/or corrupt the system).

Sniffing

Information leakage. If leakage involves authentication credentials, can lead to the same level of authorization granted to the user of the compromised authentication.

Impersonation

Information leakage. If leakage involves authentication credentials, can lead to the same level of authorization granted to the user of the compromised authentication.

Man-in-the-middle

Alteration of network transmission. Impersonation by adding misleading sites. Information leakage. If leakage involves authentication credentials, can lead to the same level of authorization granted to the user of the compromised authentication.

Exfiltration of data

Information leakage. Can be used for a remote command and control channel of compromised internal hosts.

Remote Exploits

The Morris worm used several remote exploits to gain access to Unix systems. Primarily it used a bug in Sendmail delivered over the Internet on TCP port 25 (Mail) to provide a command shell on the victim machine. Network exploit tools can range from simple Python scripts run at the command line to fully interactive graphical interfaces with point-and-click launchers.

There is a huge range of sophistication and effects from network delivered exploits. Network exploits include things like the ping of death, Heartbleed, and even SQL injection attacks. Most remote exploits embed codes that trigger a software bug and then follow them with some kind of command. Here is the network connection string to a vulnerability on a web server used by the Code Red virus:

GET /default.ida?NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN NNNNNNNNNNNNNNNNNNNNNNNNN%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u9090%u6858%ucbd3%u7801%u9090%u9090%u8190%u00c3%u0003%u8b00%u531b%u53ff%u0078%u0000%u00=a HTTP/1.0

You can see the first part of the network payload is a series of Ns, used to overflow the buffer of a built-in app on the web server. They are followed by some codes representing new commands being given to the system. All the attacker needs to do is connect to the web service (TCP 80), send this string, and boom. Simple remote exploits like these are ideal for network worms since they are fire-and-forget generic attacks. These kinds of attacks aren’t limited to servers, anything with a service can be hit, even routers.6

Many attackers just wait for new widespread remote exploits to become available so they can quickly weaponize them by adding the exploit onto existing rootkit. Root kits are software packages designed by attackers to secretly control victimized machines.

Some attacks, like SQL Injection, are more sophisticated, because the remote exploit must be customized for the specific service. SQL injection involves delivering a command to a web application that interrupts the normal flow of database operations and injects new commands, such as delete all databases.7 Because of this customization , these kinds of attacks aren’t usually put into worm form, although it has happened once or twice in the past.8

Remote Password Guessing

If your organization has any easily reachable login services on the Internet, then you should be on guard for remote password guessing attacks. Network logins can include Terminal servers, Secure Shell (SSH) sites , File Transfer Protocol sites (FTP ), Telnet consoles, Virtual Private Network (VPN ) logins, and any network service requiring authentication. The tricky thing is that there may be login services available on your Internet perimeter that you do not know about. This can easily happen if network devices are deployed without hardening or disabling administrative services. Most network devices, like routers and switches, have network console services like SSH and Telnet running on their network interfaces by default.

Attackers scan for network logins. When they find them, they try username and passwords from anywhere in the world, day and night. Once they hit the right combination of username and password, it’s easy money. To make things easier for them, there are numerous lists of commonly chosen passwords available for them to try. Currently, the top chosen passwords are Password, 123456, 12345678, qwerty, letmein, 111111, and football.

You can find many popular passwords based on previous hacks and public password dumps.9 There are also easily available default password lists for network devices. If they think you’re using a Krypto Router, they can look up the default password for that router (probably admin or password) and see if it works. There are numerous tools that attackers can use to automatically scan for listening login services and try a list of usernames and passwords. A typical organization with a SSH service on the Internet sees a few of these kinds of scans every minute from all over the Internet .

Drive-by-Download Attacks

Instead of launching attacks at your web services, some attackers booby-trap web sites to infect victims who browse them. First, the attacker finds or creates an exploit that works against a web browser or anything that a web browser may call. These are remote exploits that the victim connects and inadvertently downloads. Since there are many vulnerabilities found in web browsers, web scripting languages, and web animation tools, there is no shortage of exploits to create. The more popular the browser, usually the more browser exploits uncovered and weaponized.10

For this to work, the attacker needs victims to browse to a site with these exploits. To do this, they have a few options. They can host a site themselves and try to drive traffic to it via search engine optimization or by e-mailing enticing links to victims. Attackers can also hack a site and then use these techniques to get people to visit. Attackers could also just hack popular sites that they know their victims would frequent. This is called a watering hole attack. For example, if an attacker is looking to compromise a particular defense industry company, they could set up drive-by-download exploits on a web magazine serving that industry. Some attackers sign up for Internet advertising and deliver exploits via banner-ads on legitimate sites. If users are surfing with unpatched browser vulnerabilities, there is no telling where or when they could be hit.

Network Denial of Service

Instead of hacking a site, attackers simply try to knock it down. They can do this with an exploit that crashes the system or a firehose blast of network traffic. Sometimes these kinds of attacks are politically motivated and sometimes they are financially motivated (pay us to stop). In any case, the attacker attempts to send more traffic to the victim than their servers and network connections can handle. The downside for the attacker is that they must maintain the attack the entire time to deny service. Sadly, this is not very hard. Attackers use other previously hacked victims remotely controlled in a huge global network, called a botnet, to generate a traffic swarm. Some hackers rent out their botnets for others to use for denial of service.11 Sometimes people even volunteer their machines to join a DoS attack if they believe in the political cause.12

Attackers can also do reflection attacks by sending spoofed UDP packets at unsuspecting servers. The sent packets appear to come from the victim, so the return traffic sent by the legitimate unsuspecting server returns en masse to the victim. Also, the attacker’s true IP address is never seen by the victim. Instead, the victim sees a burst of reflections from all over the Internet. Here is an example where the attacker spoofs DNS queries from the victim to DNS servers spread around the Internet. Figure 17-1 shows a simplified version of how this works.

A417436_1_En_17_Fig1_HTML.gif
Figure 17-1. Reflection denial-of-service attack

Sniffing

Sniffing attacks are eavesdropping or wire-tapping attacks where an attacker listens to all network traffic. Nearly every kind of network interface card supports a promiscuous modewhere all packets on the transport media are captured instead just the packets addressed to the interface. Sniffing tools can then collect and decode all the traffic. Basic sniffing software tools are built into most operating systems at the administrator level. Here is an example of tcpdump on Unix operating systems:

$ sudo tcpdump            
tcpdump: data link type PKTAP
listening on pktap, link-type PKTAP (Packet Tap), capture size 262144 bytes
19:09:20.732434 IP 192.168.0.14.51750 > www.apress.com.https: Flags [.], ack 50692, win 3925, options [nop,nop,TS val 821382870 ecr 227562921], length 0
19:09:20.732467 IP 192.168.0.14.51747 > www.apress.com.https: Flags [.], ack 44719, win 4010, options [nop,nop,TS val 821382870 ecr 227562921], length 0
19:09:20.732491 IP 192.168.0.14.51750 > www.apress.com.https: Flags [.], ack 53428, win 3839, options [nop,nop,TS val 821382870 ecr 227562921], length 0

On networks using hubs, all network conversations are broadcast over every wire, so everything on the local subnet can be sniffed. On switched networks, more work is required. Network switches, which actually segregate network conversations via internal bridges13 and transmit the conversations to or from the client to their network port. The difference is like having a verbal conversation in a crowded room (network hubs) versus passing private notes amongst each other (network switches). However, many network switches have span portsthat can be used to copy ongoing connections on that switch to another device. Another way eavesdroppers can gain access to switched conversations to physical tap the local wire by placing a tap in-line somewhere in the connection. This is less relevant within an organization’s facility but can happen if an attacker sneaks onsite and plants a tap on a key connection.

A bigger issue is eavesdroppers upstream on the Internet or telecom provider side of the connection listening on Internet conversations going in and out of the organization. This is how some government intelligence agencies spy on organizational traffic.

Wireless network traffic, like hotspots at coffee shops, act like hub networks. Anyone on that wireless network could potentially be eavesdropping on the users of that network. Since wireless networks are nothing but network packets delivered by radio, attackers sometimes set up some distance away with long-range antennas to dip into the conversations.

Another way network traffic is sniffed is at the device level. Local network connections go through a switch and a router or firewall in order to get onto the Internet. Those network devices have the capability to listen and record network conversations. Sniffing is often a common redundant diagnostic feature for these kinds of devices.

Anything that is not encrypted in a network transmission can be decoded by a sniffer. Here is a tcpdump session of logging into an unencrypted web server with the username globaladmin and the password spacepickle. Note how easy it is to spot in a sniff trace.

$ sudo tcpdump -A            
tcpdump: data link type PKTAP
listening on pktap, link-type PKTAP (Packet Tap), capture size 262144 bytes
10:02:15.172746 IP 192.168.0.14.51867 > 192.168.0.1.http: Flags [P.], seq 1:417, ack 1, win 4117, options [nop,nop,TS val 479748387 ecr 9113597], length 416: HTTP: POST /goform/login HTTP/1.1
.......#2.....E...∼.@[email protected]....$.....&.....
..a#....POST /goform/login HTTP/1.1
Host: 192.168.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 39
loginUsername=globaladmin&loginPassword=spacepickle
10:02:15.182719 IP 192.168.0.1.http > 192.168.0.14.51867: Flags [P.], seq 1:138, ack 417, win 17376, options [nop,nop,TS val 9113598 ecr 479748387], length 137: HTTP: HTTP/1.0 302 Redirect

Malware sometimes installs sniffers on internal servers. These sniffers capture passwords or credit card numbers as they are transmitted around the secure internal network. Attackers can also record volumes of encrypted network traffic and analyze it at their leisure. Some encryption schemes can be broken, given enough captured traffic or time spent deciphering them.14 Even if an attacker can’t break through your network encryption, they can perform traffic analysis and learn what addresses you’ve visited. Remember that encryption covers the contents of the packet, or envelope, the to and from addressing information has to remain visible for the messages to be delivered. Traffic analysis is a specialized intelligence field that analyzes things like conversation participants (and their popularity in conversations), frequency of communication, and size of communication.

Impersonation

Each host on an Ethernet has a unique fingerprint called a MAC (Media Access Control) address, which manufacturers set. Network software binds these MAC addresses to IP addresses. Hosts on a local network then use Address Resolution Protocol (ARP) to look for the MAC address for a given IP address. If an attacker can spoof a MAC address, they could subvert the ARP process15 and impersonate that host. These attacks are easy since many network adapters and nearly every operating system supports changing the MAC address. In just one command, I can change the MAC address on my Mac:

$ ifconfig en0            
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
 options=27<RXCSUM,TXCSUM,VLAN_MTU,TSO4>
 ether 00:23:32:b3:ce:e6
 inet 192.168.0.14 netmask 0xffffff00 broadcast 192.168.0.255
$ sudo ifconfig en0 ether 00:23:32:b3:ce:e7
$ ifconfig en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
 options=27<RXCSUM,TXCSUM,VLAN_MTU,TSO4>
 ether 00:23:32:b3:ce:e7
 inet 192.168.0.14 netmask 0xffffff00 broadcast 192.168.0.255

Sometimes an attacker puts up their own Wi-Fi hotspot with the same name as a local business, and then eavesdrops or hijacks the conversations. Since wireless is just radio, an attacker could also use a much stronger radio signal to overpower a Wi-Fi access point or client. If an attacker has access to the local network, they launch a DoS attack to take a server down and then impersonate it to steal login credentials.

There have even been cases of criminals using stolen or fake SSL or TLS certificates, which are supposed to be verifiers of identity.16 Criminals have also been known to steal entire domain names from registrars for impersonation.

Man-in-the-Middle

If you can sniff a network connection, then you can take it a step further and try to insert yourself into the conversation. Remember that TCP connection streams have handshakes and sequence numbers to track and isolate the connection. If an attacker can sniff those sequence numbers, they can inject themselves into the conversation on both sides. This is called a man-in-the-middle attack. Man-in-the-middle attacks can intercept or substitute encryption keys, so attackers can decrypt confidential data. Attackers can also gain access to two-factor authentication in this manner as well.

A successful man-in-the-middle attack allows an attacker not only have full access to the conversation but also secretly alter the conversation. One attack is to hijack a victim’s web session with their Internet banking system, steal their two-factor authentication while sending the victim an error message. The victim thinks the banking site is down, while the crook cleans out the account. Figure 17-2 illustrates how it looks on a web session.

A417436_1_En_17_Fig2_HTML.jpg
Figure 17-2. Man-in-the-middle attack

An attacker can also just sniff and copy the session-ID token out of a web session and then use that token to directly impersonate the user. This isn’t a full-blown man-in-the-middle attack; it is called session hijacking.17 It still involves using sniffing or statistical analysis of poorly chosen keys to completely compromise the authentication credentials of the victim.

Some man-in-the-middle attacks originate from an attacker seizing control of the infrastructure involved in the transmission of the information. Sometimes this means taking over routers, a DNS server (to plant false entries pointing to fake sites), or even malware-implanted tools within the network stack on a host.

Exfiltration of Data

Once an attacker has broken into your network, sometimes it’s a challenge to maintain a persistent remote control connection and copy all of your data back out. This is called exfiltration and can be accomplished in a variety of ways. Some attackers are brazen and just copy files out via FTP or SSH sessions, if there are no firewalls or network monitors in place to block or alarm for such things. It can be challenging on networks with stringent firewall egress rules (hint: you should have these) so attackers have to get creative.

Attacker can hide data inside of seemly innocent DNS queries or HTTPS conversations. Who is going to suspect a machine going to a MyHappyShoppingSite.com, when in fact, the web request itself contains stolen data and the web site is run by cyber-criminals. Data can be easily encoded or encrypted and then tucked into any kind of communication medium that exits your network. It’s very hard to control exfiltration, though that doesn’t mean you shouldn’t try.

Network Controls

Now that you’ve learned about network attacks, it’s time to stop them. Let’s start with administrative controls. There are a few key operational documents that should be recorded for network security. One is a good, clear diagram of the network including all the places where the trusted networks touch the untrusted networks. Detailed diagrams should also include critical networks like the scoped sensitive environments and the Internet perimeters. Data flow for sensitive information should be mapped onto these diagrams, so you can see exactly where things go and need to be protected. All of these help avoid accidents, point out design flaws, and provide documentation for auditors.

The biggest administrative control is a policy that lays the groundwork for everything else. Here’s an example:

Sample Network Security Policy

ORGANIZATIONwill protect its IT networks and the supporting infrastructure from unauthorized access, corruption, or interruption. To accomplish this, ORGANIZATION will do the following:

  • The Security department will have primary authority for the security of the untrusted network perimeter. The untrusted network perimeter refers to the border between untrusted networks, such as the Internet, and ORGANIZATION managed or owned networks.

    • The Security department and the IT Department will jointly manage the security of the untrusted network perimeter.

  • ORGANIZATION will only use these approved network security devices to control access across untrusted network perimeters. Security standards for approved network security devices will be written by the security department.

  • ORGANIZATION will only make perimeter changes based on business-need and only after a risk analysis and approval process. The IT department will be responsible for making the perimeter changes while the Security Department will be responsible for the risk analysis and approval.

    • ORGANIZATION will use a formal process of submission, review, analysis, acceptance, verification, and maintenance to manage proposed changes to the untrusted network perimeter. The Security department must review and perform a risk assessment for all changes to the untrusted network perimeters, either by configuration changes or by the addition of new equipment.

  • The Security department will be responsible for maintaining a configuration standard describing the protocols, directions, content and business reasons for every network communication crossing the untrusted network perimeter.

  • The IT department and the Security department will share responsibility of the management of systems placed on the untrusted security perimeter. These systems should be network devices such as Internet routers, network switches and other monitoring devices.

    • The IT department will be responsible for maintaining and managing a secure configuration of these devices based on the approved hardening standards. The Security department will be responsible for providing technical risk assessments of these device configurations.

  • ADemilitarized Zone(DMZ) is a network segregated by security devices such as firewalls. ORGANIZATION will use DMZs to provide defense in depth for critical servers. ORGANIZATION considers DMZs to be semi-trusted domains.

    • Network connections from customers and other third parties will terminate in a DMZ.

  • The Security department will be responsible for periodically assessing the vulnerability and configuration of the untrusted network perimeter. This will take the form of device configuration audits or network vulnerability scans.

  • Remote access refers to connections to ORGANIZATION owned or managed networks and computers from untrusted networks. ORGANIZATION requires that an approved security device, such as a firewall or a VPN termination device, manage all remote access.

    • Remote access connections must use approved cryptographic protocols and approved authentication methods.

    • Automated remote access connections will terminate into DMZ networks with additional security inspections in place.

    • ORGANIZATION will only permit remote access from approved portable computing devices. Critical systems, such as servers holding sensitive information, will require additional security controls for remote access.

    • The IT department and the Security department will maintain an approved standard configuration for remote access, designed to provide adequate security protections for teleworkers.

  • The IT department is responsible for managing network security to workstations, and may use technical controls such as personal network firewalls and host-based intrusion detection to reduce risk.

  • ORGANIZATION will not maintain either inbound modem pools or dialup services. No unauthorized connections either to or from ORGANIZATION networks is allowed.

  • Wireless networking refers to wireless local area networks (WLANs) connected ORGANIZATION owned or managed networks. The Security department will maintain an approved standard for wireless data networking access, designed to provide adequate security protection.

    • WLANs will be treated as untrusted network perimeters and therefore be segregated by firewalls.

    • WLANs must support approved authentication and cryptographic methods.

    • WLANs should support Network intrusion detection and prevention systems.

  • All communication protocols and messaging systems traversing the ORGANIZATION perimeter will be subject to automated inspection for malware, policy violations, and unauthorized content.

    • The IT department and the Security department will share responsibility for managing messaging security. ORGANIZATION will analyze and filter messages to detect and prevent the spread of malware. ORGANIZATION will perform this filtering before the message is delivered to the recipient.

    • ORGANIZATION will not allow unencrypted file transfers of confidential data via messaging systems. Users must only use approved encryption methods and hardware/software systems for message security.

Network Security Standards

In addition to the standards mentioned in the policy, here are few more standards you may want to consider for network security:

  • Network security and hardening standards for virtualized networks and default guest images. If you use public cloud systems, you should have an additional set of standards on how those cloud systems should be accessed and configured.

  • Detailed network hardening standards for network devices that include things like disabling unused jacks (to prevent unauthorized people from just plugging into your network) and turning off unnecessary UDP network services on the perimeter (to prevent them being used for reflection attacks).

  • Standards describing network access control lists used internally or externally.

    • Externally, do you block certain countries by registered country IP address? If so, who determines the list and how is it updated?

    • Can you use internal access control list to ensure that access to scoped networks only occurs from jump hosts? The implementation of jump hosts is discussed in more detail later in this chapter.

    • Can you use access control lists to do least privilege, such as segregating voice and data networks?

  • Standards describing administrative access. What services are allowed (SSH but not Telnet)? Which encryption modes are required? Which networks are allowed access and which are not? What are the requirements to segregate out-of-band management networks from the main network? Should administrators have separate authorized accounts for administrative work?

Network Security Procedures

There should be procedures to go with all of these policies and standards. The following are a few to consider:

  • Quarterly vulnerability scanning procedures

  • Quarterly firewall rule reviews to ensure that temporary rules are removed, bad rules are cleaned up, and only approved rules are in place

  • Periodic MAC address inventory sweeps of the network to ensure that no unknown devices have been added to the network

  • Periodic wireless network scans to look for rogue wireless access points and cross-connections that aren’t firewalled

Firewalls

There was a time long ago when the entire job of the IT security role was managing the firewall. Most of that job entailed explaining to users why their applications failures were not caused by the firewall but by faulty or poorly documented software. Firewalls have gotten more sophisticated and commoditized and so have IT security roles, but users still do blame the firewall occasionally for application failures. C’est la vie.

Firewalls are such a critical control that PCI DSS devotes the entire first control objective to firewall management. Firewalls control access between zones of differing levels of trust or as a partition to block the lateral spread of compromise (back to the original definition of physical firewalls). Usually this means keeping the bad people from the Internet out of the internal network, but they can also be used block off access to the scoped environment from the rest of the organization. Over the years, firewall technology has gotten so advanced and cheap that firewall functionality can be found in most internal switching devices.

Firewall technology covers a range of different types of systems. The simplest firewall is a packet filter, which can be easily configured with open source software.18 Most firewalls also do network address translation (NAT ), so that you can use a small number of live Internet addresses to translate to a larger range of internal RFC 1918 addresses. Packet filter firewalls work on a packet-by-packet basis, so they aren’t so useful for sophisticated attacks that spoof TCP connections. The next step up is stateful inspection firewallsthat check that packets and protocols aren’t being spoofed. Stateful firewalls also do some limited packet reassembly to try to ascertain what kind of traffic is flowing through them. Some stateful firewalls can do rule matching on the data streams to try to filter out known attacks or alert on suspicious behavior.

The most secure firewalls are the proxy firewalls , which use software listeners to accept connections on one side of the firewall and fully deconstruct connections before rebuilding them on the other side. Proxy firewalls strictly enforce protocol standards, as they aren’t just inspecting traffic but rebuilding connections from scratch on the other side. It gives the firewall tremendous control over what is passing through it. This is why you often see proxy firewalls in place in medical, financial, and military networks.

Proxy firewalls come at a cost, as they can be slower and more unforgiving than other firewalls. If a particular software application doesn’t fully conform to documented protocol standards and needs to pass through a proxy firewall, it will not work. Cases like these do come up and require firewall engineers to downgrade proxy connections to stateful inspection. Another limitation of proxy firewalls is that the proxy needs to be written to the specification. For example, the protocols for e-mail, domain name services, file transfer, and web traffic are very well known so you can expect intelligent secure proxies to be developed for them. If a new protocol is needed and no proxy is available, then a stateful connection needs to be used.

When looking at firewalls, there are independent organizations that test and certify firewalls. Two organizations to look at are ICSA Lab Certified firewalls19 and Common Criteria Certified Boundary Protection20 devices.

Firewall Designs

One of the most basic firewall designs is simply to place a firewall between the Internet and the internal network, and be done with it. This may work fine for home networks, but most organizations need to be a little more sophisticated. A DMZ should be used if the organization has any Internet-facing services like the Web and mail servers. A demilitarized zone (DMZ) is a separate network segregated by firewalls. Access in and out of that DMZ is controlled by access control rules so that if one of those exposed Internet-Facing services is hacked, the attackers still won’t have access to the internal network. Some even go as far as using different firewall vendors for each end of the DMZ, to try to get as much breadth of control coverage as they can.

Firewalls can also be used to control switch virtual LANs (VLANs) to help implement least privilege on the internal network. An ideal design from a network security perspective (but not necessarily a practical design), is a honeycomb of firewalls network segments between all departments and functions. The goal is to move beyond authentication and provide granular network authorization to just the necessary connections. Firewalls can also be used as a gateway between the following:

  • Wireless and Wi-Fi networks

  • Remote access gateways

  • Database servers and application servers

  • Third-party/business partner connections

  • Out-of-band management networks like iLO and PDU interfaces

  • Internal “Internet of Things” networks like HVAC, door card readers, and voice networks

Firewall Management

When it comes to the firewall rules itself, least privilege is your guide. The worst kind of firewall rules are those that allow every host to have full service access to every other host. Not only do these rules defeat the purpose of firewalls but they can also be cited as audit control failure findings. If such a rule is actually deemed necessary, it should be treated as a temporary policy exception and be approved by the ISMS committee.

Organizations are often mindful about the firewall rules allowing connections in from the Internet but forget about the rules going out. Remember the network exfiltration threat. Egress filtering is a useful tool that can be implemented on the firewall to limit which machines on the inside network can talk to the Internet. Many servers may never need Internet access, so why give it to them? At the very least, you should limit the protocols that users can access online. There are some organizations that deploy separate web proxy servers that users must web surf through to the Internet. In this way, drive-by-downloads and exfiltration attacks can often be spotted and stopped.

Some firewalls can implement whitelist or blacklist blocks. This means instead of having every single address on the Internet allowed to touch your Internet perimeter, it is limited to a defined set of servers (whitelist) or certain known bad addresses are blocked (blacklist). Subscriptions to the addresses of known addresses with bad reputations are available and can be integrated into some firewalls.

Jump Hosts and Firewalls

Firewalls are powerful but they don’t always offer the granular authorization tools that you need. Sometimes you want to apply more control on user or administrator access across a network boundary. Enter the jump host. As discussed in Chapter 6, are sometimes called bastion hosts. These are special workstations—virtual or physical—that sit between scope or trust boundaries and manage access. Basically, you build a hardened machine (see Chapter 15 on hardening standards) and allow access through the firewall to it. This machine acts as a secure gateway into the trusted or scoped environment. Technically, you can set this up many ways but commonly people use either SSH-Agent forwarding (often for Linux connectivity) or remote desktop gateway (often for Windows connectivity). Here are two good resources on how to do that.

IDS/IPS

Intrusion detection systems (IDS) work just like sniffers, but for defense. They are software that either sniffs network traffic or acts as a gateway that traffic passes through. Many intrusion detection systems are integrated into firewall appliances, since the firewall already has direct access to all the Internet traffic. The IDS examines the traffic and pattern matches on known attacks and attack behaviors, sounding an alarm when something is detected. In this way, they work much like antivirus software, with an updating signature list of known attacks.

IDS has also evolved into intrusion prevention systems (IPS), where the system blocks a network stream as soon it detects an attack. IPS must be in a position to block network traffic for them.

Some IDS/IPS support subscriptions to IP address reputation lists, so you can monitor or block connections to known sketchy sites and stop problems that don’t have signatures yet.

The key thing to remember about IDS/IPS is they work primarily off lists of known attacks, so they’re useful for scraping off the top layer of sewage flowing into your network, but they won’t capture everything. They are only as good as their signature lists and those lists usually at least 24 hours behind the latest threat. Some IDS/IPS software packages allow you to write your own signatures, which is handy in emergencies or customizing signatures for your environment.

One big value of an IDS/IPS is since they clear away the Internet background radiation of scans and attacks, you can focus on the really dangerous threats. The second value of an IDS is to give you a network-eye view of what’s going on on your network and what threats you might be facing. As you study IDS logs and alerts, you will see probes, port scans, exploit attempts, and all kinds of suspicious behavior. Over time, you’ll get an idea about what should be normal for your organization and industry, so that when the threat level changes, you’ll have some warning. All of this entails spending time and resources on examining IDS data. There are many tools and visualization systems that can help with this. They all cost something in terms of time or money (or both). The real cost is the expertise and time invested in training or hiring people with strong skills in both network technology as well as network attacks.

When I was a consultant, I used to talk to organizations about IDS deployments. I would ask them if they were currently reviewing their firewall and web logs. When they said no (because they always did), I asked them how they felt about adding another system that would generate more logs for them to ignore. I’ll say it bluntly: The value of an IDS/IPS is in the expertise and resources you put into using it. It is not a fire-and-forget control. For some organizations, this is such a burden that they pay an outsourced organization to watch their IDS logs for them and call if they see a real problem.

IDS Deployment

Obviously, you want to have IDS sensors at your Internet perimeter and in front of your sensitive systems. You also should put IDS wherever you see major traffic flows, such as:

  • Where users access the Internet, to watch for signs of compromise

  • On the scope barrier as discussed in Chapter 6, to watch who’s trying to break in there

  • Between the DMZ and the inside, to watch for escalating attacks

Some IDS software can be configured with a preloaded HTTPS certification, which automatically performs a man-in-the-middle attack on encrypted web sessions for users. In this way, you can have more visibility into possible threats, such as drive-by-downloads heading down toward user web browsers.

Host-based IDS (HIDS )

Some IDS solutions are software applications that can be loaded on servers or workstations. They listen to incoming and outgoing network conversations from the host, as well as sometimes monitoring what is going on internally on the system as well. Usually a HIDS is configured to transmit its log data to another server so in the event it is compromised, all of the log data is preserved.

Transmission Encryption

Encryption is a good control to counter the threats of sniffing, spoofing, and man-in-the-middle. The encryption most normal people think of is called symmetric encryption, where a code key is used to both scramble up a message and descramble it. This is called encrypting plaintext data into ciphertext data. Since you use the same code key to encode as you to decode, you need to keep this code key a secret.

The problem arises if you have to exchange code keys over an untrusted network without meeting in person. Here’s an old riddle: a prince is fighting a civil war. He needs to send a message to his one trusted Duke in a nearby castle, but there are traitors everywhere in his kingdom. He commissions a special iron box from his master blacksmith, DiffieHellman. This box has a big iron rings on the lid and case to affix locks onto. He puts his message in it, and then locks it with a padlock that only he has the key to (see Figure 17-3).

A417436_1_En_17_Fig3_HTML.jpg
Figure 17-3. DiffieHellman’s Iron Box with the Prince’s lock

He summons his fastest rider, Squire Internet. He doesn’t really trust Squire Internet, but he has no choice. He gives the locked chest to the Squire and tells him to take it to the Duke. Upon receiving the box, the Duke smiles, as he knows what to do. He snaps a second lock onto the chest ring, one that only the Duke has the key to open (see Figure 17-4).

A417436_1_En_17_Fig4_HTML.jpg
Figure 17-4. The box with both the Prince’s and the Duke’s lock

He hands the box back to Squire Internet and tells him to return it to the Prince. The Squire shrugs and rides back to the castle. Upon receiving the Squire, the Prince unlocks his padlock and tells the Squire to ride the box back to the Duke (see Figure 17-5).

A417436_1_En_17_Fig5_HTML.jpg
Figure 17-5. The box with just the Duke’s lock

Upon receiving the box a second time, the Duke can open his lock, safely knowing that no one but the Prince ever had access to the message.

This method works well for solving riddles and as an analogy for public key cryptography. Instead of a single shared secret key between two individuals, public key cryptography uses two pairs of keys for each participant. The key pair consists of a private key and a public key. The public and private keys are mathematically derived to be related to each other, but it is unfeasible to figure the private key from the public.21

In the Prince/Duke example, the public key functions as the lock and the private key unlocks the lock. Each participant has a public key that other participant can use to encrypt, but not decrypt, messages. So when setting up a communications channel over an untrusted network, like the Internet, participants sends their private key to the other. They can then use each other’s public keys to send messages that only the other can read. Usually, these messages are the code keys, called symmetric keys, which are used to both encrypt and decrypt messages. These symmetric keys only keep data confidential as long as they remain secret to outsiders, but public key cryptography gives us a way to safely exchange them. Therefore, anyone wanting to receive encrypted information just publishes their public key to anyone who wants it. This is how secure HTTPS web servers work, with their public key being wrapped up inside of a certificate. We’ll get to what that means in a minute.

Our analogy breaks down a bit because in public key cryptography, the keys can work in both directions. Not only can the private key decrypt things enciphered with the public key, but the public key can decipher things encrypted with the private key. However, public keys can’t decrypt things encrypted with other public keys. It only works within the pair. This gives us a useful new application: these key pairs can also be used to verify their counterpart. This is where digital signatures come from. If I take a hash of a message, which you may recall is a mathematical fingerprint of the file, and then I encrypt that hash with my private key and the other person’s public key. Now I send out that encrypted hash as a digital signature with the original message. Someone who gets my message can take their own hash of the received message. If they have my public key, they decrypt the signature with my public key and compare the hashes. If the hashes match, then they know (a) the file hasn’t been altered and (b) it had to come from me since only I have the private key. Viola, the file is authentic.

Web Encryption

Now take it one more step. What if instead of a message being digitally signed, the message is another key, a third person’s key. This is how you can have a large trusted authority institution vouch for someone’s public key. They can choose to digital sign someone’s key as way of issuing a stamp of approval. What does that stamp approval mean? Well, it could mean that the large trusted authority institution has done some legwork to verify there the person’s name matches their key. Now, you put all of these keys and signatures into a standardized format and you have HTTPS certificate, aka the little lock on a web site. The Large Trusted Authority Institution is the certificate authority, which is who the organization running the web site has paid to sign their key.

So now when you visit a web site, you get two things from the certificate: a key to start the encryption for talking to the web site and a method of verifying that the web site is legitimately who it claims to be. Certificates also include validity dates, because you do want to rotate your keys every couple of years or so. Web certificates also include the domain name of the server they’re verifying, which is the mechanism for establishing legitimacy of the site. You really don’t want some random cable modem web site to be capable of claiming to be PugetRegionalBank.com.

If you’ve been paying attention, you may notice something is missing here. How does your browser verify the certificate authority’s signature without having access to its public key? Moreover, if I don’t have their key, how do I get it in a manner that I trust? Doesn’t another certificate authority have to sign it? This could go on forever. Yes, and this is why the folks who write browser software just include a big bunch of certificate authority keys that are pre-trusted by your browser. These are called trusted root certificates and you can view them in your browser settings. Don’t be too shocked by how many are in there. Some of the more privacy-minded security professionals go in and remove many of these certificates to limit who they trust by default. Not a bad idea, but it can be a lot of work to maintain and not exactly user friendly.

Whenever a browser has a problem with a certificate, it displays a message warning the user. We talked about how confusing this can be to non-techies. Here’s a breakdown of what the messages are and what they mean:

  • Expired: This certificate used to be trustworthy but that was a long time ago (or yesterday), expiration date has passed.

  • Mismatch: Domain name and certificate don’t match.

  • Revoked: This certificate is no longer trustworthy, be very worried.

  • Untrusted: This certificate is not in my root list (includes self-signed).

Note that in each case, the actual transmitted data is still encrypted, but the certificate message questions the identity of the opposite end.

Virtual Private Networks

Another major use of network encryption (and public key cryptography) is with Virtual Private Networks or VPNs. A VPN encapsulates or tunnels network traffic inside an encrypted connection to the other end of the VPN tunnel. Users on the VPN appear to have a direct link to the things on the other side of the tunnel. To everyone else, all they see is an encrypted network stream passing back and forth. This means VPNs ideal for connecting remote sites and untrusted networks to your organization without the cost or hassle of wiring up direct lines.

A417436_1_En_17_Fig6_HTML.jpg
Figure 17-6. A VPN tunnel over the Internet

Both sides of the VPN connection must be running compatible software and have the same encryption settings. The VPN software can run locally on a computer as a VPN client or within a server as a VPN gateway. VPN software is available in almost every commercial firewall and most of them are compatible with each other. Many VPNs also have firewall capability within the tunnel itself, which is very useful. Remember least privilege. Give connections just the access they need and no more. You can use firewall access control rules to manage access by destination host and allowed service through the tunnel. Some VPN solutions can even allow IDS scanning of tunnel traffic, which is a nice extra control to have on those remote connections.

One downside of VPNs is that they are completely dependent on a network to flow over. If you are using VPNs over the Internet to link up your remote offices, a denial-of-service attack or Internet outage means a loss of the VPN. Organizations that really put Internet providers or telco companies in their significant threat list run VPNs over their leased lines to remote sites. This significantly reduces the risk of eavesdropping from the telecommunication providers or national government intelligence agencies.

VPNs come in a variety of flavors, but the most common contemporary types are IPsec and SSL, although almost any persistent communication channel can be used for a VPN (e.g., SSH). IPsec VPNs are based on IPv6 and are pretty much the standard for network-to-network connections. They can require some work to set up, as there are half a dozen settings to make sure match on both sides of the tunnel. IPsec VPNs also require several different network services (protocols and ports), which can make them hard to run from behind firewalls. SSL VPNs are web-based and actually now use TLS encryption since SSL has been deprecated. SSL VPNs are lightweight and work over the web HTTPS service. They are often used as remote access connections for road warriors who need the flexibility and ease of use. With remote access VPNs, you can usually tie whatever authentication systems you have in your organization to the remote connection. Since they are accessing your network from parts unknown, stronger authentication standards should apply. Using two-factor authentication for VPN connections into scoped networks is prudent and required for PCI DSS.

Console Encryption

Administrative credentials should also be protected by encryption, so standards should specify the use of HTTPS, Secure Shell (SSH), and Remote Desktop Protocol (RDP ) for all admin work. All of these services are encrypted by default, but you should specify in a standard what levels of encryption should be used. Both RDP and HTTPS support TLS encryption with certificates, which can be self-signed or externally purchased.22 SSH encryption can also be configured from relatively weak to strong.23 Remember what you learned about access control in Chapter 16 and specify stronger authentication for administrative access, especially if admins are logging from the Internet.

Wireless Encryption

For Wi-Fi connections, there are quite a few choices for encryption as well. Wireless access points can use certificates as authentication as well, much like a VPN. Unless your encryption settings and key match the Wi-Fi encryption settings, no connection can be established. This is how Wi-Fi Protected Access (WPA) functions, with the two versions WPA and WPA2 being the most common implementation in use. Both require the wireless client to enter a pre-shared key, which works effectively like a password. Some wireless encryption schemes can handoff this key sharing and integrate native Windows authentication to allow wireless clients to seamless connect to the network if they’re part of the domain.

Cryptographic Modules

Some organizations opt to acquire cryptographic modules to do their encryption. Instead of setting up servers, software, and configuring interfaces, they use cryptographic modules for ease of use. These are hardware or virtual image appliances with pre-configured cryptographic software and an interface to do the encryption. There are many commercial cryptographic modules and most are certified to NIST standards to be acceptable for certain classes of government work.

Acceptable Encryption Methods

Cryptographic methods are always changing. Sometimes flaws in implementations or algorithms are found. Sometimes new technology and techniques find ways to decipher encryption schemes without the keys. Some encryption schemes work well for some kind of applications and not for others. This means that you should have published encryption standards specifying acceptable algorithms, key lengths, and appropriate usages. You should revisit the standard at least yearly, and update appropriately.

As a note on this, anyone foolish enough to think they can write their own encryption algorithm without thorough outside review should remember the assume breach concept as well as Schneier’s Law , which states: “Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can’t break.”24

Footnotes

18 Netfilter, Linux packet filtering firewall http://www.netfilter.org/

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset