Securing IOS Passwords
- AAAサーバがあればそれを使いましょう
- 以下、ない場合の話
note
-
transport input ssh
でtelnet禁止、sshのみ許可することを検討しよう- デフォルト
all
- telnetは平文のパスワードが流れてしまう
- デフォルト
Encrypting Older IOS Passwords with service password-encryption
- passwordで設定したパスワードはconfig内に平文で保存される
sw2#show running-config | section line vty 0
line vty 0
password Cisco
login
service password-encryption
でconfig内のパスワードを暗号化できる
sw2(config)#service password-encryption
sw2(config)#end
%SYS-5-CONFIG_I: Configured from console by console
sw2#show running-config | section line vty 0
line vty 0
password 7 0822455D0A16
login
sw1>telnet 10.0.0.2
Trying 10.0.0.2 ...Open
User Access Verification
Password: (cisco)
sw2>
- ただし、簡単に復号できてしまい、強度はよろしくない
Encoding the Enable Passwords with Hashes
enable password
の代わりにenable secret
使え
Interactions Between Enable Password and Enable Secret
enable password
とenable secret
両方設定した場合、enable secret
が勝つ
sw2(config)#enable password hoge
sw2(config)#enable secret piyo
sw2(config)#^Z
sw2#
%SYS-5-CONFIG_I: Configured from console by console
sw2#
sw2#show running-config | section enable
enable secret 5 $1$mERr$8uVJh5HjzLjx/K599zVX00
enable password 7 082943490C
sw2#exit
sw2>enable
Password: (piyo)
sw2#
Making the Enable Secret Truly Secret with a Hash
- ハッシュ関数の話。略
Improved Hashes for Cisco’s Enable Secret
sw2(config)#enable secret ?
0 Specifies an UNENCRYPTED password will follow
5 Specifies an ENCRYPTED secret will follow
LINE The UNENCRYPTED (cleartext) 'enable' secret
level Set exec level password
- ハッシュアルゴリズムのタイプを指定できる
enable secret <type> piyo
enable algorithm-type <algorithm-type> secret piyo
- 【補】PacketTracerでは後者の書き方はできなかった
- 指定しない場合デフォルトMD5
<algorithm-type> |
<type> |
Algorithm |
---|---|---|
0 | 平文 | |
md5 | 5 | MD5 |
sha256 | 8 | SHA-256 |
scrypt | 9 | SHA-256 |
Encoding the Passwords for Local Usernames
sw2(config)#username foo secret bar
sw2(config)#line vty 0
sw2(config-line)#login local
-
enable
同様password
よりもsecret
を使う- ハッシュアルゴリズムを指定できる
Controlling Password Attacks with ACLs
access-class
でACLを設定できる
sw2(config)#line vty 0
sw2(config-line)#access-class 1 in
sw2(config)#access-list 1 permit 10.0.0.1 0.0.0.0
- SW1 (10.0.0.1)からはtelnet接続可能
sw1#telnet 10.0.0.2
Trying 10.0.0.2 ...Open
User Access Verification
Username: foo
Password: (bar)
sw2>exit
- SW3 (10.0.0.3)からはtelnet接続不可能
sw3#ping 10.0.0.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
sw3#telnet 10.0.0.2
Trying 10.0.0.2 ...Open
[Connection to 10.0.0.2 closed by foreign host]
sw3#
access-class
コマンドでout
を指定すると、telnet/ssh接続先に基づいてマッチングが行われることに注意
Firewalls and Intrusion Prevention Systems
Traditional Firewalls
-
ACLと似ているところ
- source/destination IPアドレスやポート番号に基づいてマッチングを行う
- ACLと異なるところ
-
アプリケーション層の知識ももつ
- HTTPリクエストのURIなど
-
ステートフル
- 履歴情報に基づいて、「少数のクライアントから大量のTCP接続要求が来ているのでDoSだな」といったことがわかる
Security Zones
- 「社内から外側へTCPコネクションを張る(initiate)のは許可する」(outbound)
- 「外側から社内へ張るのは禁止する」(inbound)
- といったときの「内側」をZone Inside、「外側」をZone Outside という
-
Webブラウザのようなinboundアクセスを許可しなければならないものは Zone DMZ: Demilitarized Zoneに置く
- DMZから社内へのコネクションは禁止する
Intrusion Prevention Systems (IPS)
- ACLやFirewallとはパケットのフィルタリングロジックが異なる
- exploit signaturesデータベースに照らして、ロギング、パケットの破棄、追調査などを行う
- アンチウイルスソフトと似ているが、ネットワーク上でパケットの破棄を行うので、より迅速に新型の脅威に対応できうる
Cisco Next-Generation Firewalls
-
AVC: Application Visibility and Control
- well-knownポートをふさぐだけでは、攻撃者はポートスキャンを仕掛けて侵入を試みてくる
- NGFWではポート番号ではなくアプリケーション層のデータに基づいて判断するように
-
Advanced Malware Protection
- FW上でアンチマルウェア機能を動かすなど
- URL Filtering
-
NGIPS (Next-Generation IPS)
- NGIPS連携
Cisco next-generation IPS
- AVC
-
Contextual Awareness
- 従来のIPSではセキュリティイベント通知が膨大すぎて、読むのが困難だった
- NGFWからホストの情報を受け取り、その情報に基づいて実際に問題となる脆弱性に絞ることで、通知を大幅に減らせるように
- Reputation-Based Filtering
- Event Impact Level