Why: Setting strong passwords is the first line of defense against unauthorized access. Weak passwords make it easier for attackers to gain control of the device.
Consequences of Not Hardening: Weak or default passwords can lead to unauthorized access, compromising the confidentiality and integrity of network configurations and data.
Switch(config)# line console 0
Switch(config-line)# login local
Switch(config)# username admin privilege 15 algorithm-type scrypt secret <very_strong_password>
Switch(config)# line vty 0 15
Switch(config-line)# login local
Switch(config)# enable secret <enable_password>
Why: Enabling SSH provides a more secure method of remote access compared to Telnet. SSH encrypts data during transmission, reducing the risk of eavesdropping.
Consequences of Not Hardening: Using unencrypted protocols like Telnet increases the likelihood of unauthorized individuals intercepting sensitive information, potentially leading to security breaches.
Switch(config)# crypto key generate rsa general-keys modulus 4096
Switch(config)# line vty 0 15
Switch(config-line)# transport input ssh
Why: Restricting management access to specific IP addresses helps control who can manage the switch, reducing the attack surface.
Consequences of Not Hardening: Without access restrictions, malicious actors may attempt unauthorized configuration changes or launch attacks against management services.
Switch(config)# access-list 10 permit host <management_ip>
Switch(config)# line vty 0 15
Switch(config-line)# access-class 10 in
Why: SNMPv3 provides authentication and encryption, enhancing the security of SNMP. Access controls limit which systems can query or modify SNMP information.
Consequences of Not Hardening: Inadequate SNMP security can expose sensitive information and potentially lead to unauthorized device manipulation.
Switch(config)# snmp-server group <group_name> v3 auth
Switch(config)# snmp-server user <user_name> <group_name> v3 auth sha <auth_key> priv aes 128 <priv_key>
Switch(config)# snmp-server view <view_name> iso included
Switch(config)# snmp-server community <community_string> view <view_name> RO
Why: Port security limits the number of MAC addresses on an interface, preventing unauthorized devices from connecting to the network.
Consequences of Not Hardening: Without port security, unauthorized devices can connect to the network, leading to potential security breaches and unauthorized access.
Switch(config)# interface <interface_type> <interface_number>
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum <max_mac_addresses>
Switch(config-if)# switchport port-security violation restrict
Switch(config-if)# switchport port-security mac-address sticky
Why: DHCP snooping prevents rogue DHCP servers from assigning IP addresses, reducing the risk of man-in-the-middle attacks.
Consequences of Not Hardening: Rogue DHCP servers can distribute incorrect network configurations, leading to connectivity issues and potential security vulnerabilities.
Switch(config)# ip dhcp snooping
Switch(config)# interface range <interface_type> <interface_range>
Switch(config-if-range)# ip dhcp snooping trust
Why: CoPP protects the control plane from excessive traffic and denial-of-service attacks, ensuring critical control plane processes remain operational.
Consequences of Not Hardening: Without CoPP, the control plane may become overwhelmed with traffic, impacting the stability and performance of the switch.
Switch(config)# control-plane
Switch(config-cp)# service-policy input <policy_name>
Switch(config)# class-map <class_name>
Switch(config-cmap)# match access-group <access_group>
Switch(config-cmap)# exit
Switch(config)# policy-map <policy_name>
Switch(config-pmap)# class <class_name>
Switch(config-pmap-c)# police <rate> <burst>
Why: Disabling DTP prevents unauthorized switches from forming trunk links, reducing the risk of VLAN hopping attacks.
Consequences of Not Hardening: Failure to disable DTP may expose the network to VLAN manipulation and potential unauthorized access.
Switch(config)# interface range <interface_type> <interface_range>
Switch(config-if-range)# switchport nonegotiate
Why: Disabling HTTP and HTTPS servers reduces the attack surface and eliminates potential security vulnerabilities associated with these services.
Consequences of Not Hardening: Open HTTP and HTTPS servers may be exploited, leading to unauthorized access or attacks against the switch.
Switch(config)# no ip http server
Switch(config)# no ip http secure-server
Why: Disabling VTP prevents unauthorized changes to VLAN configurations, reducing the risk of unintended network changes.
Consequences of Not Hardening: Without disabling VTP, unauthorized users may introduce incorrect VLAN configurations, potentially causing network disruptions.
Switch(config)# no vtp domain
Switch(config)# no vtp mode
Switch(config)# no vtp version
Why: Configuring logging enables the monitoring of system events, aiding in the detection and investigation of security incidents.
Consequences of Not Hardening: Without proper logging, it becomes challenging to identify security incidents, leading to delayed or inadequate responses to potential threats.
Switch(config)# logging host <syslog_server_ip>
Switch(config)# logging trap <severity_level>
Switch(config)# logging source-interface <source_interface>
Why: Enabling Netflow provides visibility into network traffic, aiding in the detection of anomalies and potential security threats.
Consequences of Not Hardening: Without Netflow, the network lacks detailed traffic analysis, making it difficult to identify and respond to security incidents effectively.
Switch(config)# flow record <record_name>
Switch(config-flow-record)# match ipv4 source address
Switch(config-flow-record)# match ipv4 destination address
Switch(config)# flow exporter <exporter_name>
Switch(config-flow-exporter)# destination <exporter_ip> <port>
Switch(config)# flow monitor <monitor_name>
Switch(config-flow-monitor)# record <record_name>
Switch(config-flow-monitor)# exporter <exporter_name>
Switch(config)# interface <interface_type> <interface_number>
Switch(config-if)# ip flow monitor <monitor_name> input
Implementing these security measures is crucial for safeguarding the Cisco Catalyst 9200/9300 switches and the overall network. Failure to harden the devices increases the risk
of unauthorized access, data breaches, network disruptions, and compromised system integrity. Regularly reviewing and updating security measures is essential to adapt to evolving threats and maintain a secure network environment.