Cisco Router: startup auto secure

AutoSecure

auto secure

推奨セキュリティ設定機能。
ネットワークエンジニアは普通使わないとのこと。

R1#auto secure
                --- AutoSecure Configuration ---

*** AutoSecure configuration enhances the security of
the router, but it will not make it absolutely resistant
to all security attacks ***

AutoSecure will modify the configuration of your device.
All configuration changes will be shown. For a detailed
explanation of how the configuration changes enhance security
and any possible side effects, please refer to Cisco.com for
Autosecure documentation.
At any prompt you may enter '?' for help.
Use ctrl-c to abort this session at any prompt.

Gathering information about the router for AutoSecure

Is this router connected to internet? [no]:

Securing Management plane services...

Disabling service finger
Disabling service pad
Disabling udp & tcp small servers
Enabling service password encryption
Enabling service tcp-keepalives-in
Enabling service tcp-keepalives-out
Disabling the cdp protocol

Disabling the bootp server
Disabling the http server
Disabling the finger service
Disabling source routing
Disabling gratuitous arp

Here is a sample Security Banner to be shown
at every access to device. Modify it to suit your
enterprise requirements.

Authorized Access only
  This system is the property of So-&-So-Enterprise.
  UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED.
  You must have explicit permission to access this
  device. All activities performed on this device
  are logged. Any violations of access policy will result
  in disciplinary action.

Enter the security banner {Put the banner between
k and k, where k is any character}:

k
k
Enable secret is either not configured or
 is the same as enable password
Enter the new enable secret:
Confirm the enable secret :
Enter the new enable password:
Choose a password that's different from secret
Enter the new enable password:
Choose a password that's different from secret
Enter the new enable password:
Confirm the enable password:

Configuration of local user database
Enter the username: wataru
Enter the password:
Confirm the password:
Configuring AAA local authentication
Configuring Console, Aux and VTY lines for
local authentication, exec-timeout, and transport
Securing device against Login Attacks
Configure the following parameters

Blocking Period when Login Attack detected: 1

Maximum Login failures with the device:
Device not secured against 'login attacks'.


Configure SSH server? [yes]:
Enter the domain-name:
% No defaulting allowed
Enter the domain-name:
だるくなってきたので ^C で中断
R1#

auto secure no-interact

フルオートで running-config に設定が反映されていくとのこと。
稼働環境で使うのは禁忌らしい。

R1#terminal length 0
R1#sh run
Building configuration...

Current configuration : 1398 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  hidekeys
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/0
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial0/1
 no ip address
 shutdown
 clock rate 2000000
!
interface FastEthernet1/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial2/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 shutdown
 serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end
R1#auto secure no-interact
                --- AutoSecure Configuration ---

*** AutoSecure configuration enhances the security of
the router, but it will not make it absolutely resistant
to all security attacks ***

AutoSecure will modify the configuration of your device.
All configuration changes will be shown. For a detailed
explanation of how the configuration changes enhance security
and any possible side effects, please refer to Cisco.com for
Autosecure documentation.

Securing Management plane services...

Disabling service finger
Disabling service pad
Disabling udp & tcp small servers
Enabling service password encryption
Enabling service tcp-keepalives-in
Enabling service tcp-keepalives-out
Disabling the cdp protocol

Disabling the bootp server
Disabling the http server
Disabling the finger service
Disabling source routing
Disabling gratuitous arp

Configuring interface specific AutoSecure services
Disabling the following ip services on all interfaces:

 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
Disabling mop on Ethernet interfaces

Securing Forwarding plane services...

Enabling CEF (This might impact the memory requirements for your platform)

This is the configuration generated:

no service finger
no service pad
no service udp-small-servers
no service tcp-small-servers
service password-encryption
service tcp-keepalives-in
service tcp-keepalives-out
no cdp run
no ip bootp server
no ip http server
no ip finger
no ip source-route
no ip gratuitous-arps
no ip identd
security passwords min-length 6
security authentication failure rate 10 log
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
logging facility local2
logging trap debugging
service sequence-numbers
logging console critical
logging buffered
interface FastEthernet0/0
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
 no mop enabled
interface Serial0/0
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
interface FastEthernet0/1
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
 no mop enabled
interface Serial0/1
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
interface FastEthernet1/0
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
 no mop enabled
interface Serial2/0
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
interface Serial2/1
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
interface Serial2/2
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
interface Serial2/3
 no ip redirects
 no ip proxy-arp
 no ip unreachables
 no ip directed-broadcast
 no ip mask-reply
ip cef
!
end


Applying the config generated to running-config

R1#sh run
Building configuration...

Current configuration : 2328 bytes
!
version 12.4
no service pad
service tcp-keepalives-in
service tcp-keepalives-out
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
service sequence-numbers
!
hostname R1
!
boot-start-marker
boot-end-marker
!
security authentication failure rate 10 log
security passwords min-length 6
logging buffered 4096
logging console critical
!
no aaa new-model
memory-size iomem 5
no ip source-route
no ip gratuitous-arps
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip bootp server
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
archive
 log config
  logging enable
  hidekeys
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
interface FastEthernet0/0
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 duplex auto
 speed auto
 no mop enabled
!
interface Serial0/0
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 clock rate 2000000
!
interface FastEthernet0/1
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 duplex auto
 speed auto
 no mop enabled
!
interface Serial0/1
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 clock rate 2000000
!
interface FastEthernet1/0
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 duplex auto
 speed auto
 no mop enabled
!
interface Serial2/0
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 serial restart-delay 0
!
interface Serial2/1
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 serial restart-delay 0
!
interface Serial2/2
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 serial restart-delay 0
!
interface Serial2/3
 no ip address
 no ip redirects
 no ip unreachables
 no ip proxy-arp
 shutdown
 serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
logging trap debugging
logging facility local2
no cdp log mismatch duplex
no cdp run
!
!
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end

差分を比較するとこうなる。

--- D:/junk/startup-config-a.txt    Sat Jan 06 09:58:24 2018
+++ D:/junk/startup-config-b.txt    Sat Jan 06 09:58:32 2018
@@ -1,27 +1,38 @@
 R1#sh run
 Building configuration...

-Current configuration : 1398 bytes
+Current configuration : 2328 bytes
 !
 version 12.4
-service timestamps debug datetime msec
-service timestamps log datetime msec
-no service password-encryption
+no service pad
+service tcp-keepalives-in
+service tcp-keepalives-out
+service timestamps debug datetime msec localtime show-timezone
+service timestamps log datetime msec localtime show-timezone
+service password-encryption
+service sequence-numbers
 !
 hostname R1
 !
 boot-start-marker
 boot-end-marker
 !
+security authentication failure rate 10 log
+security passwords min-length 6
+logging buffered 4096
+logging console critical
 !
 no aaa new-model
 memory-size iomem 5
+no ip source-route
+no ip gratuitous-arps
 no ip icmp rate-limit unreachable
 ip cef
 !
 !
 !
 !
+no ip bootp server
 no ip domain lookup
 !
 multilink bundle-name authenticated
@@ -48,6 +59,7 @@
 !
 archive
  log config
+  logging enable
   hidekeys
 !
 !
@@ -60,49 +72,79 @@
 !
 interface FastEthernet0/0
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  duplex auto
  speed auto
+ no mop enabled
 !
 interface Serial0/0
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  clock rate 2000000
 !
 interface FastEthernet0/1
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  duplex auto
  speed auto
+ no mop enabled
 !
 interface Serial0/1
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  clock rate 2000000
 !
 interface FastEthernet1/0
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  duplex auto
  speed auto
+ no mop enabled
 !
 interface Serial2/0
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  serial restart-delay 0
 !
 interface Serial2/1
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  serial restart-delay 0
 !
 interface Serial2/2
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  serial restart-delay 0
 !
 interface Serial2/3
  no ip address
+ no ip redirects
+ no ip unreachables
+ no ip proxy-arp
  shutdown
  serial restart-delay 0
 !
@@ -112,7 +154,10 @@
 no ip http server
 no ip http secure-server
 !
+logging trap debugging
+logging facility local2
 no cdp log mismatch duplex
+no cdp run
 !
 !
 !
@@ -143,3 +188,4 @@
 !
 !
 end
+

References

  1. Ciscoルータ – はじめての起動

Cisco Router

  • Cisco ISR(Integrated Services Router)
  • Cisco ISR G2

サービス統合型ルータ

G2 は +100 で見た目がもっとかっこよくなっている。

能力の記述がいい意味で中二病入っていて面白い。
ガンダムかな?と思う

License

GNS3 では IOS 12 系なので確認できなかった。
VIRL 1.2.64 でもコマンド入力できなかった。

Catalyst 3750 なら確認できるかと思ったけど、だめだった。
サポートしてないって。

DSW2#sh ver
Cisco IOS Software, C3750 Software (C3750-IPSERVICESK9-M), Version 15.0(2)SE4, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Wed 26-Jun-13 02:41 by prod_rel_team

ROM: Bootstrap program is C3750 boot loader
BOOTLDR: C3750 Boot Loader (C3750-HBOOT-M) Version 12.2(53r)SEY4, RELEASE SOFTWARE (fc1)

DSW2 uptime is 21 minutes
System returned to ROM by power-on
System image file is "flash:/c3750-ipservicesk9-mz.150-2.SE4/c3750-ipservicesk9-mz.150-2.SE4.bin"


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

cisco WS-C3750V2-24TS (PowerPC405) processor (revision T0) with 131072K bytes of memory.
Processor board ID FDO1729Y0FV
Last reset from power-on
1 Virtual Ethernet interface
24 FastEthernet interfaces
2 Gigabit Ethernet interfaces
The password-recovery mechanism is enabled.

512K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address       : C0:8C:60:45:52:00
Motherboard assembly number     : 73-12635-01
Power supply part number        : 341-0328-02
Motherboard serial number       : FDO172905K2
Power supply serial number      : DCA1727M23E
Model revision number           : T0
Motherboard revision number     : G0
Model number                    : WS-C3750V2-24TS-E
System serial number            : FDO1729Y0FV
Top Assembly Part Number        : 800-33979-03
Top Assembly Revision Number    : C0
Version ID                      : V08
CLEI Code Number                : COMKM10DRB
Hardware Board Revision Number  : 0x01


Switch Ports Model              SW Version            SW Image
------ ----- -----              ----------            ----------
*    1 26    WS-C3750V2-24TS    15.0(2)SE4            C3750-IPSERVICESK9-M


Configuration register is 0xF

DSW2#sh license
% License not supported on this device
DSW2#sh license feature
% Incomplete command.

DSW2#sh license feature ?
  switch  Switch license information

DSW2#sh license feature switch
% Incomplete command.

DSW2#sh license feature switch ?
  <1-9>  Switch number

DSW2#sh license feature switch 1
% License not supported on this device

おじさんはがっかりだよ。

References

  1. Ciscoルータ – ISRシリーズ/ISR G2シリーズ
  2. Cisco IOSイメージ – ライセンス