Confidential CCNA 6 to CCNA 7 comparison CCNA v6 CCNA v7 Focus on configuration, verification and troubleshooting Focus on network fundamental concepts and configuration Source: Leandro Almeida - Brazil
Cisco Confidential Module Objectives Module Title: Switch Security Configuration Module Objective: Configure switch security to mitigate LAN attacks Topic Title Topic Objective Implement Port Security Implement port security to mitigate MAC address table attacks. Mitigate VLAN Attacks Explain how to configure DTP and native VLAN to mitigate VLAN attacks. Mitigate DHCP Attacks Explain how to configure DHCP snooping to mitigate DHCP attacks. Mitigate ARP Attacks Explain how to configure ARP inspection to mitigate ARP attacks. Mitigate STP Attacks Explain how to configure PortFast and BPDU Guard to mitigate STP Attacks.
Confidential We forget about attacks inside our network Most of the attacks on the network occur or started from inside of your network (FBI report on Networking Security) Employee innocently open a link on an e-mail or download a non trusted application on the network Malicious attacks coming from a disgruntled employee Visitors accessing the LAN from public areas IoT devices not properly secured
Cisco Confidential Implement Port Security Secure Unused Ports Layer 2 attacks are some of the easiest for hackers to deploy but these threats can also be mitigated with some common Layer 2 solutions. • All switch ports (interfaces) should be secured before the switch is deployed for production use. How a port is secured depends on its function. • A simple method that many administrators use to help secure the network from unauthorized access is to disable all unused ports on a switch. Navigate to each unused port and issue the Cisco IOS shutdown command. If a port must be reactivated at a later time, it can be enabled with the no shutdown command. • To configure a range of ports, use the interface range command. Switch(config)# interface range type module/first-number – last-number Switch(config)# interface range f0/20 – 24 Switch(config-if)# shutdown
Cisco Confidential Implement Port Security Mitigate MAC Address Table Attacks The simplest and most effective method to prevent MAC address table overflow attacks is to enable port security. • Port security limits the number of valid MAC addresses allowed on a port. It allows an administrator to manually configure MAC addresses for a port or to permit the switch to dynamically learn a limited number of MAC addresses. When a port configured with port security receives a frame, the source MAC address of the frame is compared to the list of secure source MAC addresses that were manually configured or dynamically learned on the port. • By limiting the number of permitted MAC addresses on a port to one, port security can be used to control unauthorized access to the network.
Cisco Confidential Implement Port Security Enable Port Security Port security is enabled with the switchport port-security interface configuration command. Notice in the example, the switchport port-security command was rejected. This is because port security can only be configured on manually configured access ports or manually configured trunk ports. By default, Layer 2 switch ports are set to dynamic auto (trunking on). Therefore, in the example, the port is configured with the switchport mode access interface configuration command. Note: Trunk port security is beyond the scope of this course.
Cisco Confidential Implement Port Security Limit and Learn MAC Addresses To set the maximum number of MAC addresses allowed on a port, use the following command: • The default port security value is 1. • The maximum number of secure MAC addresses that can be configured depends the switch and the IOS. • In this example, the maximum is 8192. Switch(config-if)# switchport port-security maximum value
Cisco Confidential Implement Port Security Limit and Learn MAC Addresses (Cont.) The example demonstrates a complete port security configuration for FastEthernet 0/1. • The administrator specifies a maximum of 4 MAC addresses, manually configures one secure MAC address, and then configures the port to dynamically learn additional secure MAC addresses up to the 4 secure MAC address maximum. • Use the show port-security interface and the show port- security address command to verify the configuration.
Cisco Confidential Implement Port Security Port Security Aging Port security aging can be used to set the aging time for static and dynamic secure addresses on a port and two types of aging are supported per port: • Absolute - The secure addresses on the port are deleted after the specified aging time. • Inactivity - The secure addresses on the port are deleted if they are inactive for a specified time. Use aging to remove secure MAC addresses on a secure port without manually deleting the existing secure MAC addresses. • Aging of statically configured secure addresses can be enabled or disabled on a per-port basis. Use the switchport port-security aging command to enable or disable static aging for the secure port, or to set the aging time or type. Switch(config-if)# switchport port-security aging {static | time time | type {absolute | inactivity}}
Cisco Confidential Implement Port Security Port Security Violation Modes If the MAC address of a device attached to a port differs from the list of secure addresses, then a port violation occurs and the port enters the error-disabled state. • To set the port security violation mode, use the following command: Switch(config-if)# switchport port-security violation {shutdown | restrict | protect} Mode Description shutdown (default) The port transitions to the error-disabled state immediately, turns off the port LED, and sends a syslog message. It increments the violation counter. When a secure port is in the error-disabled state, an administrator must re-enable it by entering the shutdown and no shutdown commands. restrict The port drops packets with unknown source addresses until you remove a sufficient number of secure MAC addresses to drop below the maximum value or increase the maximum value. This mode causes the Security Violation counter to increment and generates a syslog message. protect This is the least secure of the security violation modes. The port drops packets with unknown MAC source addresses until you remove a sufficient number of secure MAC addresses to drop below the maximum value or increase the maximum value. No syslog message is sent. The following table shows how a switch reacts based on the configured violation mode.
Cisco Confidential Implement Port Security Port Security Violation Modes (Cont.) The example shows an administrator changing the security violation to “Restrict”. The output of the show port-security interface command confirms that the change has been made.
Cisco Confidential Implement Port Security Ports in error-disabled State When a port is shutdown and placed in the error-disabled state, no traffic is sent or received on that port. A series of port security related messages display on the console, as shown in the following example. Note: The port protocol and link status are changed to down and the port LED is turned off.
Cisco Confidential Implement Port Security Ports in error-disabled State (Cont.) • In the example, the show interface command identifies the port status as err-disabled. The output of the show port-security interface command now shows the port status as secure-shutdown. The Security Violation counter increments by 1. • The administrator should determine what caused the security violation If an unauthorized device is connected to a secure port, the security threat is eliminated before re-enabling the port. • To re-enable the port, first use the shutdown command, then, use the no shutdown command.
Cisco Confidential Implement Port Security Verify Port Security (Cont.) Use the show port-security interface command to view details for a specific interface, as shown previously and in this example.
Cisco Confidential Implement Port Security Packet Tracer – Implement Port Security In this Packet Tracer, you will complete the following objectives: • Part 1: Configure Port Security • Part 2: Verify Port Security
Cisco Confidential Mitigate VLAN Attacks Steps to Mitigate VLAN Hopping Attacks Use the following steps to mitigate VLAN hopping attacks: Step 1: Disable DTP (auto trunking) negotiations on non- trunking ports by using the switchport mode access interface configuration command. Step 2: Disable unused ports and put them in an unused VLAN. Step 3: Manually enable the trunk link on a trunking port by using the switchport mode trunk command. Step 4: Disable DTP (auto trunking) negotiations on trunking ports by using the switchport nonegotiate command. Step 5: Set the native VLAN to a VLAN other than VLAN 1 by using the switchport trunk native vlan vlan_number command.
DHCP Attacks DHCP Snooping DHCP snooping filters DHCP messages and rate-limits DHCP traffic on untrusted ports. • Devices under administrative control (e.g., switches, routers, and servers) are trusted sources. • Trusted interfaces (e.g., trunk links, server ports) must be explicitly configured as trusted. • Devices outside the network and all access ports are generally treated as untrusted sources. A DHCP table is built that includes the source MAC address of a device on an untrusted port and the IP address assigned by the DHCP server to that device. • The MAC address and IP address are bound together. • Therefore, this table is called the DHCP snooping binding table.
Cisco Confidential Mitigate DHCP Attacks DHCP Snooping Configuration Example Refer to the DHCP snooping sample topology with trusted and untrusted ports. • DHCP snooping is first enabled on S1. • The upstream interface to the DHCP server is explicitly trusted. • F0/5 to F0/24 are untrusted and are, therefore, rate limited to six packets per second. • Finally, DHCP snooping is enabled on VLANS 5, 10, 50, 51, and 52.
Cisco Confidential Mitigate DHCP Attacks DHCP Snooping Configuration Example (Cont.) Use the show ip dhcp snooping privileged EXEC command to verify DHCP snooping settings. Use the show ip dhcp snooping binding command to view the clients that have received DHCP information. Note: DHCP snooping is also required by Dynamic ARP Inspection (DAI).
Cisco Confidential Mitigate ARP Attacks DAI Features Dynamic ARP Inspection or DAI required DHCP spoofing and help prevents ARP attacks by . • Not relaying invalid or gratuitous ARP Replies out to other ports in the same VLAN. • Intercepting all ARP Requests and Replies on untrusted ports. • Verifying each intercepted packet for a valid IP-to-MAC binding. • Dropping and logging ARP Replies coming from invalid to prevent ARP poisoning. • Error-disabling the interface if the configured DAI number of ARP packets is exceeded.
Cisco Confidential Mitigate ARP Attacks DAI Implementation Guidelines To mitigate the chances of ARP spoofing and ARP poisoning, follow these DAI implementation guidelines: • Enable DHCP snooping globally. • Enable DHCP snooping on selected VLANs. • Enable DAI on selected VLANs. • Configure trusted interfaces for DHCP snooping and ARP inspection. It is generally advisable to configure all access switch ports as untrusted and to configure all uplink ports that are connected to other switches as trusted.
Cisco Confidential Mitigate ARP Attacks DAI Configuration Example (Cont.) DAI can also be configured to check for both destination or source MAC and IP addresses: • Destination MAC - Checks the destination MAC address in the Ethernet header against the target MAC address in ARP body. • Source MAC - Checks the source MAC address in the Ethernet header against the sender MAC address in the ARP body. • IP address - Checks the ARP body for invalid and unexpected IP addresses including addresses 0.0.0.0, 255.255.255.255, and all IP multicast addresses.
STP Attacks PortFast and BPDU Guard Recall that network attackers can manipulate the Spanning Tree Protocol (STP) to conduct an attack by spoofing the root bridge and changing the topology of a network. To mitigate STP attacks, use PortFast and Bridge Protocol Data Unit (BPDU) Guard: PortFast • PortFast immediately brings a port to the forwarding state from a blocking state, bypassing the listening and learning states. • Apply to all end-user access ports. BPDU Guard • BPDU guard immediately error disables a port that receives a BPDU. • Like PortFast, BPDU guard should only be configured on interfaces attached to end devices.
STP Attacks Configure PortFast PortFast bypasses the STP listening and learning states to minimize the time that access ports must wait for STP to converge. • Only enable PortFast on access ports. • PortFast on inter switch links can create a spanning-tree loop. PortFast can be enabled: • On an interface – Use the spanning-tree portfast interface configuration command. • Globally – Use the spanning-tree portfast default global configuration command to enable PortFast on all access ports.
STP Attacks Configure BPDU Guard An access port could receive an unexpected BPDUs accidentally or because a user connected an unauthorized switch to the access port. • If a BPDU is received on a BPDU Guard enabled access port, the port is put into error-disabled state. • This means the port is shut down and must be manually re-enabled or automatically recovered through the errdisable recovery cause psecure_violation global command. BPDU Guard can be enabled: • On an interface – Use the spanning-tree bpduguard enable interface configuration command. • Globally – Use the spanning-tree portfast bpduguard default global configuration command to enable BPDU Guard on all access ports.
I learned • If Layer 2 is compromised, then all layers above it are also affected • Switches have many security features that we do not turn on to implement security of our internal network • VLAN attacks can be mitigated by disabling DTP negotiations, manually enable trunking ports, and disabling unused ports • The first step in mitigating attacks on the Layer 2 infrastructure is to understand the underlying operation of Layer 2 and the Layer 2 solutions: Port Security, DHCP Snooping, and Dynamic ARP Inspection. • STP can be secured activating BPDU guard on access ports