ContentsOverview OverviewThe security of Cisco IOS devices consists of multiple factors, including physical and logical access to the device, configuration of the device, and the inherent security of the software being used. The security configuration of a device, specifically in relation to device security, is conveyed using documented best practices. The document entitled Cisco Guide to Harden Cisco IOS Devices represents one collection of those best practices. The integrity of the software used on Cisco IOS devices, in this case Cisco IOS software, is also important to device security. Depending on severity, security issues in Cisco IOS software are communicated to customers using Security Advisories, Security Responses, or Cisco bug release notes. Further details are documented in the Cisco Security Vulnerability Policy. It may be possible for an attacker to insert malicious code into a Cisco IOS software image and load it onto a Cisco device that supports that image. This attack scenario could occur on any device that uses a form of software, given a proper set of circumstances. This document will describe best practices that network administrators can use to reduce the risk of malicious code being installed on Cisco IOS devices. Additionally, this document will offer some methods that administrators can use to mitigate the risks of introducing malicious code into the network. Security Best PracticesCisco recommends that the following security best practices be implemented to improve the security posture of the network. These practices are particularly relevant to ensure that Cisco IOS devices only use authorized and unaltered Cisco IOS software images. Supply Chain IntegrityTo minimize the risk associated with malicious code, it is important that network administrators develop and consistently apply a secure methodology for Cisco IOS software image management. This secure process must be used from the time a Cisco IOS software image is downloaded from Cisco.com until a Cisco IOS device begins using it. Although processes may vary based on the network and its security and change management requirements, the following procedure represents an example of best practices that may help minimize the possibility of malicious code installation.
Implement Change ControlChange control is a mechanism through which changes being made to network devices are requested, approved, implemented, and audited. In the context of ensuring the authenticity of Cisco IOS software images used in the network, change control is relevant because it helps greatly when determining which changes have been authorized and which are unauthorized. Change control is important to help ensure that only authorized and unaltered Cisco IOS software is used on Cisco IOS devices in the network. Harden the Software Distribution ServerThe server that is used to distribute software to Cisco IOS devices in the network is a critical component of network security. Several best practices should be implemented to help ensure the authenticity and integrity of software that is distributed from this server. These best practices include:
Utilize Up-to-Date SoftwareCisco IOS software used in the network must be kept up-to-date so that new security functionality can be leveraged and exposure to known vulnerabilities disclosed through Cisco Security Advisories is minimal. Cisco is continually evolving the security of Cisco IOS software images through the implementation of new security functionality and the resolution of bugs. For these reasons, it is imperative that network administrators maintain their networks in a manner that includes using up-to-date software. Failure to do so could expose vulnerabilities that may be used to gain unauthorized access to a Cisco IOS device. Leverage Authentication, Authorization, and AccountingThe comprehensive implementation of Authentication, Authorization,
and Accounting (AAA) is critical to ensuring the security of
interactive access to network devices. Furthermore, AAA, and
specifically authorization and accounting functions, should be used to
limit the actions authenticated users can perform in addition to
providing an audit trail of individual user actions. Limit Interactive Access to DevicesOnce AAA has been implemented to control which users can log in to particular network devices, access control should be implemented to limit from which IP addresses users may perform management functions on a network device. This access control includes multiple security features and solutions to limit access to a device:
For more information, please consult the following sections of the Cisco Guide to Harden Cisco IOS devices: Securing Interactive Management Sessions and Fortifying the Simple Network Management Protocol. Leverage Centralized and Comprehensive LoggingFor network administrators to understand events taking place on a network, a comprehensive logging structure using centralized log collection and correlation must be implemented. Additionally, a standardized logging and time configuration must be deployed on all network devices to facilitate accurate logging. Furthermore, logging from the AAA functions in the network should be included in the centralized logging implementation. Once comprehensive logging is in place on a network, the collected data must be used to monitor network activity for events that may indicate unauthorized access to a network device, or unauthorized actions by legitimate users. These types of events could represent the first step in undermining the security on a Cisco IOS device. Because the following items may represent unauthorized access or unauthorized actions, they should be monitored closely.
For more information, reference the sections entitled Centralize Log Collection and Monitoring and Logging Best Practices of the Cisco Guide to Harden Cisco IOS Devices. Cisco IOS Image File VerificationNetwork administrators can use one of several security features to verify the authenticity and integrity of Cisco IOS software images in use on their network devices. It is also possible to use a process that does not rely on features in the Cisco IOS software. The following sections contain information on Cisco IOS software features and administrative processes that can be used to verify the authenticity and integrity of a Cisco IOS software image. Using the MD5 File Validation FeatureThe MD5 File Validation feature, added in Cisco IOS Software Releases 12.2(4)T and 12.0(22)S, allows network administrators to calculate the MD5 hash of a Cisco IOS software image file that is loaded on a device. It also allows administrators to verify the calculated MD5 hash against that provided by the user. Once the MD5 hash value of the installed Cisco IOS image is determined, it can also be compared with the MD5 hash provided by Cisco to verify the integrity of the image file. Note: The MD5 File Validation feature can only be used to check the integrity of a Cisco IOS software image that is stored on a Cisco IOS device. It cannot be used to check the integrity of an image running in memory. MD5 hash calculation and verification using the MD5 File Validation feature can be accomplished using the following command:
Network administrators can use the verify /md5 privileged EXEC command to verify the integrity of image files that are stored on the Cisco IOS file system of a device. The following shows how to use the verify /md5 command on a Cisco IOS device:
Network administrators can also provide an MD5 hash to the verify command. If provided, the verify command will compare the calculated and provided MD5 hashes as illustrated in the following example:
If the network administrator provides an MD5 hash that does not match the hash calculated by the MD5 File Validation feature, an error message will be displayed. This message is shown in the following example:
In the preceding examples, the verify /md5 command calculates and displays the MD5 hash for the entire Cisco IOS image file. This approach is in contrast to the updated verify command present with the "Image Verification" feature, which calculates the hash for the entire Cisco IOS image as well as specific portions of the uncompressed Cisco IOS image file. For additional information on how to use this feature, please consult the document entitled MD5 File Validation. Using the Image Verification FeatureThe Image Verification feature, added in Cisco IOS Software Releases 12.3(4)T, 12.0(26)S, and 12.2(18)S, builds on the MD5 File Validation functionality to more easily allow network administrators to verify the integrity of an image file that is loaded on the Cisco IOS file system of a device. The purpose of the Image Verification feature is to ensure that corruption of the Cisco IOS software image file has not occurred. The corruption detected by this feature could have occurred at any time, such as during the download from Cisco.com or the installation process. Note: The Image Verification feature does not check the integrity of the image running in memory. Cisco IOS software image file verification using this feature can be accomplished using the following commands:
Note: Only the file verify auto global configuration command and the verify privileged EXEC command will be covered in this document. For information on the copy /verify and reload /verify commands, reference the Image Verification of the Cisco IOS Security Configuration Guide. Configuring the file verify auto CommandNetwork administrators can use the file verify auto global configuration command to enable verification of all images that are either copied using the copy privileged EXEC command or loaded using the reload privileged EXEC command. These images are automatically verified for image file integrity. The following example shows how to configure the file verify auto Cisco IOS feature:
In addition to file verify auto, both the copy and the reload commands have a /verify argument that enables the Image Verification feature to check the integrity of the Cisco IOS image file. This argument must be used each time an image is copied to or reloaded on a Cisco IOS device if the global configuration command file verify auto is not present. Using the Image Verification Cisco IOS verify CommandNetwork administrators can also use the verify privileged EXEC command, originally introduced for the "MD5 File Validation" feature and updated by the "Image Verification" feature, to verify the integrity of image files that are stored locally on a device. The following example demonstrates how to use the updated verify command on a Cisco IOS device:
In the preceding output, three MD5 hash values are displayed by the verify command. The following is an explanation of each MD5 hash value:
For additional information, reference the section entitled Image Verification of the Cisco IOS Security Configuration Guide. Downloading an Image File From a Cisco IOS DeviceIn certain circumstances, network administrators may consider moving an existing Cisco IOS software image file from a Cisco IOS device to an administrative workstation. Once on the administrative workstation, independent tools can be used to calculate the MD5 hash of the file. Two options are available for administrators to perform this task. One option allows the administrator to use the Cisco IOS software in use on the device to copy the stored Cisco IOS software image file to an administrative workstation. If this process is being carried out for security reasons, administrators are advised to use a secure protocol (such as SCP) to transfer the file. However, it is technically possible to perform this process using other protocols, including RCP, TFTP, FTP, HTTP or HTTPS. This process is accomplished using the copy command as illustrated in the following example:
A second and recommended option, one that provides an additional level of security, is to restart a Cisco IOS device using a known-good version of Cisco IOS software from a trusted location. Administrators can accomplish this task using the boot system global configuration command as illustrated in the following example:
Note: On some platforms, the Cisco IOS device may load the locally stored boot image before loading a Cisco IOS software system image from the network. Once the network device has been restarted with a known-good Cisco IOS image, a network administrator can verify the locally stored image using the verify command or by copying the Cisco IOS software image to a remote file server for offline verification. For additional information about copying, loading, and maintaining system images, reference the Loading and Managing System Images of the Cisco IOS Configuration Fundamentals Configuration Guide. Offline Image File VerificationOnce a file is stored on an administrative workstation, a network administrator can verify the MD5 hash for that Cisco IOS image file using an MD5 hashing utility. Such utilities include md5sum for the Linux operating system, md5 for the BSD operating system, and fsum, MD5summer, and WinMD5 for Microsoft Windows platforms. Additionally, the size of the Cisco IOS image file can be obtained using the ls command on Linux and BSD operating systems and the dir command on Microsoft Windows platforms. The following example demonstrates the MD5 calculation and file size display for Linux-based systems:
The following example illustrates this process for BSD-derived
systems:
The following example sho100ws the use of the fsum utility and the dir command on a Windows system:
Note: The use of the fsum utility is for illustrative purposes only and should not be interpreted as an endorsement of the tool. Image File Information Using Cisco IOS Upgrade PlannerOnce the MD5 hash and file size for a Cisco IOS software image has been collected, network administrators can verify authenticity of the image using information provided by the Cisco IOS Upgrade Planner tool during the download process. The Cisco IOS Upgrade Planner tool requires a valid Cisco.com account and provides details about each publicly available IOS image. Network administrators must identify their Cisco IOS software release (this can be done by using information obtained from output provided by the show version command) and navigate through the Cisco IOS Upgrade Planner tool to locate the image in use on the Cisco IOS device. Network administrators should verify that the CCO Hash calculated by the Cisco IOS verify command (part of the Cisco IOS "Image Verification" feature), the MD5 hash calculated by the verify /md5 command (part of the "MD5 File Validation" Cisco IOS feature), or the MD5 hash calculated by a third-party utility matches the MD5 hash that is provided by the Cisco IOS Upgrade Planner tool. If the MD5 hash value for the whole Cisco IOS image file does not match the MD5 hash provided by Cisco, network administrators should download the Cisco IOS image file from the Cisco IOS Upgrade Planner and use the file verification methods described in this document to verify integrity of the Cisco IOS image file. The following is an example of the information provided by the Cisco IOS Upgrade Planner tool during one of the steps required for downloading a Cisco IOS software image file from www.cisco.com. Table 1. IOS Software Image Information
ConclusionBest practices require that network administrators know and trust the tools that can be used to verify the authenticity of a Cisco IOS software image. This document explains those tools and highlights methods to minimize risk. AcknowledgmentsTim Sammut (tsammut@cisco.com) Joseph Karpenko (jkarpenk@cisco.com) Tim Sammut and Joseph Karpenko are members of the Security Intelligence Engineering organization at Cisco. Additional content produced by Security Intelligence Engineering is located in the Security Intelligence Best Practices section of Cisco Security Intelligence Operations. ReferencesCisco Guide to Harden Cisco IOS Devices Cisco Security Vulnerability Policy Cisco IOS Security Configuration Guide MD5 File Validation Image Verification Loading and Managing System Images http://www.cisco.com/en/US/docs/ios/fundamentals/configuration/guide/cf_system_images_ps6350_TSD_Products_Configuration_Guide_Chapter.html
This document is part of Cisco Security Intelligence Operations. This document is provided on an "as is" basis and does not imply any kind of guarantee or warranty, including the warranties of merchantability or fitness for a particular use. Your use of the information on the document or materials linked from the document is at your own risk. Cisco reserves the right to change or update this document at any time. |
|||||||||||||||
