
In the modern world of unlimited power of technology, more and more attention is paid to the
confidentiality ,
integrity and
availability of stored or transmitted data. And this is understandable, because who wants information that is considered personal or secret got to third parties or (God forbid) competitors or even enemies.
So what is protected information in the field of data networks? An absolutely secure network does not exist and cannot be, and it can be considered fully protected, probably only if you disconnect each device from the network (or even, perhaps, it is better to turn it off, for reliability). But who needs such a network, in which data is not transmitted? True, no one. Thus, the question arises of how to make it as protected as possible, taking into account at the same time all those possible vulnerabilities, again and again thrown up by the manufacturers (soft / hard) war.
')
In this article, I will tell / show some of the nuances of configuring Cisco devices in such a way as to be able to control who has access to these devices, as one of the main network nodes, and what kind of access this will be.
Three main subtopics:
- Setting up access "by roles"
where it will be discussed about the so-called views, which determine which teams can be used (read “available”) for one or another authorized user
- Means to increase the security of the authorization process
where it will be told about the improvements that can be introduced to the user authorization process, such as how many attempts to enter incorrect data can be made, logging the authorization process, etc.
- Protecting iOS images and existing configuration files
where it will be told about the protection and restoration of deleted IOS and configuration files, yes, yes, and it happens.
1. Setting up access by roles.
So, in simple terms, setting the role-based access allows you to create profiles of secondary administrators for configurable devices with limited access and a set of commands.
The process of creating a view (profile template):
- Enable AAA (Authorization, Authentication, Accounting)
Router (config) #
aaa new-model- Enable Root View (a mode that is one step above Privilege Mode, it is from it and only from it you can create other view templates)
Router #
enable viewnote: after executing the above command, the device will ask the secret password when trying to log in to the root view, which can be pre-set using the command:
enable secret [password] . After the execution, a corresponding message of the console type should appear:
* Oct 17 20: 53: 57.203:% PARSER-6-VIEW_SWITCH: successfully set to view 'root'.
- Create a new View.
(we will create, for example, one view-template ST_ONLY, with access only to commands starting with “show ...” and “telnet ...”, as well as view-template SP_ONLY with access to the commands “show ...” and “ping” ) and assign a password to the created View (note, not the user, but the view-template) and the set of available commands
Router (config) #
parser view ST_ONLY* Oct 17 20: 58: 12.943:% PARSER-6-VIEW_CREATED: view 'S_ONLY' successfully created.
Router (config-view) #
secret pass2stRouter (config-view) #
commands exec include all showRouter (config-view) #
commands exec include all telnetRouter (config) #
parser view SP_ONLY* Oct 17 21: 00: 12.771:% PARSER-6-VIEW_CREATED: view 'SP_ONLY' successfully created.
Router (config-view) #
secret pass2spRouter (config-view) #
commands exec include showRouter (config-view) #
commands exec include pingNow, in the case when it is necessary, you can create a so-called super view, combining several other, simple view-templates:
Router (config) #
parser view SUP_VIEW superviewRouter (config-view) #
secret pass2sviewRouter (config-view) #
view ST_ONLYRouter (config-view) #
view SP_ONLYAfter that, you can create users of the local device database. Each created user is assigned a default view, whose commands will be available to this user:
Router (config) #
username st_admin view ST_ONLY secret cisco1Router (config) #
username sp_admin view SP_ONLY secret cisco2Router (config) #
username sview_admin view SUP_VIEW secret cisco3A complete example of a working configuration:
Router> enable
Router # configure terminal
Enter configuration commands, one per line. End with CNTL / Z.
Router (config) #
aaa new-modelRouter (config) #
enable secret supersecretciscopasswordRouter (config) #
exit* Oct 17 21: 13: 37.511:% SYS-5-CONFIG_I: Configured from console by console
Router #
enable viewPassword:
Router #
* Oct 17 21: 13: 56.035:% PARSER-6-VIEW_SWITCH: successfully set to view 'root'.
Router #
configure terminalEnter configuration commands, one per line. End with CNTL / Z.
Router (config) #
parser view ST_ONLY* Oct 17 21: 14: 41.699:% PARSER-6-VIEW_CREATED: view 'ST_ONLY' successfully created.
Router (config-view) #
secret pass2stRouter (config-view) #
commands exec include all showRouter (config-view) #
commands exec include all telnetRouter (config-view) #
exitRouter (config) #
Router (config) #
parser view SP_ONLY* Oct 17 21: 15: 32.279:% PARSER-6-VIEW_CREATED: view 'SP_ONLY' successfully created.
Router (config-view) #
secret pass2spRouter (config-view) #
commands exec include all showRouter (config-view) #
commands exec include all pingRouter (config-view) #
exitRouter (config) #
Router (config) #
parser view SUP_VIEW superview* Oct 17 21: 16: 31.783:% PARSER-6-SUPER_VIEW_CREATED: super view 'SUP_VIEW' successfully created.
Router (config-view) #
secret pass2sviewRouter (config-view) #
view ST_ONLY* Oct 17 21: 17: 39.451:% PARSER-6-SUPER_VIEW_EDIT_ADD: view ST_ONLY added to superview SUP_VIEW.
Router (config-view) #
view SP_ONLY* Oct 17 21: 17: 44.083:% PARSER-6-SUPER_VIEW_EDIT_ADD: view SP_ONLY added to superview SUP_VIEW.
Router (config-view) #
exitRouter (config) #
username st_admin view ST_ONLY secret cisco1Router (config) #
username sp_admin view SP_ONLY secret cisco2Router (config) #
username sview_admin view SUP_VIEW secret cisco3Router (config) #
aaa authentication login default localRouter (config) #
aaa authorization exec default localRouter (config) #
aaa authorization consoleRouter (config) #
exitRouter #
wrBuilding configuration ...
* Oct 17 21: 23: 19.771:% SYS-5-CONFIG_I: Configured from console by console [OK]
Router #
Now, after logging in, the users of st_admin, sp_admin and sview_admin have a very limited number of commands:
User Access Verification
Username:
st_adminPassword:
Router>
?Exec commands:
enable turn on privileged commands
exit Exit from the EXEC
show Show running system information
telnet Open a telnet connection
Router> User Access Verification
Username:
sp_adminPassword:
Router>
?Exec commands:
enable turn on privileged commands
exit Exit from the EXEC
ping send echo messages
show Show running system information
Router> User Access Verification
Username:
sview_adminPassword:
Router>
?Exec commands:
enable turn on privileged commands
exit Exit from the EXEC
ping send echo messages
show Show running system information
telnet Open a telnet connection
2. Means to increase the security of the authorization process

In this part, I will give a set of commands aimed at improving the security of the user authorization process on a Cisco device and briefly explain their purpose.
Completely disables the possibility of authorization on the device for a given number of time {sec1} after a certain number of {num} failed attempts during the taken time interval {sec2}.
Router (config) #
login block-for {sec1} attempts {num} within {sec2}Allows a group of devices specified by the access list to access the router even if the authorization feature is blocked by the previous “login block-for ...” command. That is, in other words - in the case when the attacker is trying to find a password by brute force, so that we ourselves could still be able to log in.
Router (config) #
access-list 10 permit 10.0.0.0Router (config) #
login quite-mode access-class 10Sets the interval between authorization attempts in seconds {sec}.
Router (config) #
login delay {sec}Logging failed / successful authorization attempts in SYSLOG.
Router (config) #
login on-failure log every {num}Router (config) #
login on-success log every {num}The minimum password length allowed when a user changes a password.
Router (config) #
security password min-length {num}Time-out after which the user is "thrown out" of the system.
Router (config-line) #
exec-timeout {min} {sec}Encryption stored in the password configuration.
Router (config) #
service password-encryption3. Protecting an IOS image and existing configuration files

If someone still logged into the device and erased the IOS and configuration file, it can lead to a long enough downtime (while IOS download, while config backup is found, if it exists), in certain areas it is simply unacceptable.
Two teams of savior, meet:
This command enables IOS security (creates an unrecoverable copy of IOS)
Router (config) #
secure boot-imageThis command enables protection of the configuration file (creates an uninstallable copy of startup-config)
Router (config) #
secure boot-confignote: a router with a PCMCIA slot is required for being able to restore ISO
In rommon mode, we specify the device to boot from PCMCIA and the image name
rommon>
boot slot: c3745-js2-mz.binRestore device configuration to a temporary file
Router (config) #
secure boot-config restore flash: rescue-cfgcopy the temporary file to the configuration file and after that
Router #
copy flash: rescue-cfg startup-configand reboot.
This article was written under the impression of viewing CCNA Security CBT_Nuggets for generalization and systematization of knowledge, as well as for subsequent preparation for exams.