はじめに
- ONTAPのデフォルトの管理者ユーザーが
adminであることは、ONTAPに馴染みがある方であればご存じかと思います。 - サイバー攻撃を仕掛けてくる攻撃者も、ONTAPのデフォルトの管理者ユーザーが
adminであることを知っています。彼らがネットワークに侵入してONTAPを見つけたら、とりあえずadminユーザーを使った侵入を試みるはずです。 - RBACの機能で最小権限を付与したユーザーを使って運用することが望ましいですが、ユーザー管理が煩雑になるし、
adminのような何でもできるユーザーがあると色々便利という気持ちは分かります。 - という訳で、せめてもの抵抗として、デフォルトの
adminは使用不可にして、別名で何でもできるユーザーを作りましょう。本記事では、何でもできる人の代名詞としてshohei-ohtaniという名前のユーザーを作ります。
やってみた
adminと同じ権限を持つユーザーを作成
- SSHにてONTAPクラスタに
adminでログインします。(cluster1は名前解決済みのONTAPクラスタ名)
コマンド
ssh admin@cluster1
-
adminユーザーの設定を確認します。
コマンド
security login show -user-or-group-name admin -instance
実行結果
Vserver: cluster1
User Name or Group Name: admin
Application: amqp
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: admin
Application: console
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: admin
Application: http
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: admin
Application: ontapi
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: admin
Application: service-processor
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: admin
Application: ssh
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
6 entries were displayed.
- これと同じ設定のユーザー
shohei-ohtaniを作成します。(とりあえずapplicationはamqpを指定して作成)
コマンド
security login create -user-or-group-name shohei-ohtani -role admin -authentication-method password -application amqp
- パスワードの設定を求められるので入力します。
実行結果
Please enter a password for user 'shohei-ohtani':
Please enter it again:
- その他の
applicationも設定していきます。
コマンド
security login create -user-or-group-name shohei-ohtani -role admin -authentication-method password -application console
コマンド
security login create -user-or-group-name shohei-ohtani -role admin -authentication-method password -application http
コマンド
security login create -user-or-group-name shohei-ohtani -role admin -authentication-method password -application ontapi
コマンド
security login create -user-or-group-name shohei-ohtani -role admin -authentication-method password -application service-processor
コマンド
security login create -user-or-group-name shohei-ohtani -role admin -authentication-method password -application ssh
-
shohei-ohtaniユーザーの設定が、adminと同じであることを確認します。
コマンド
security login show -user-or-group-name shohei-ohtani -instance
実行結果
Vserver: cluster1
User Name or Group Name: shohei-ohtani
Application: amqp
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: shohei-ohtani
Application: console
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: shohei-ohtani
Application: http
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: shohei-ohtani
Application: ontapi
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: shohei-ohtani
Application: service-processor
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
Vserver: cluster1
User Name or Group Name: shohei-ohtani
Application: ssh
Authentication Method: password
Remote Switch IP Address: -
Role Name: admin
Account Locked: no
Comment Text: -
Whether Ns-switch Group: no
Second Authentication Method: none
LDAP Fastbind Authentication: no
6 entries were displayed.
-
adminからログアウトします。
コマンド
exit
-
shohei-ohtaniでログインします。
コマンド
ssh shohei-ohtani@cluster1
実行結果
Password:
This is your first recorded login.
adminユーザーをロック
-
adminユーザーをロックします。
コマンド
security login lock -vserver cluster1 -username admin
-
adminユーザーがロックされていること(=「Acct Locked」がyesになっていること)を確認します。
コマンド
security login show -user-or-group-name admin
実行結果
Vserver: cluster1
Second
User/Group Authentication Acct Authentication
Name Application Method Role Name Locked Method
-------------- ----------- ------------- ---------------- ------ --------------
admin amqp password admin yes none
admin console password admin yes none
admin http password admin yes none
admin ontapi password admin yes none
admin service-processor
password admin yes none
admin ssh password admin yes none
6 entries were displayed.
- 実際に
adminでログインを試みると、アカウントがロックされている旨のメッセージが表示されました。
コマンド
ssh admin@cluster1
実行結果
Password:
Error: Account currently locked. Contact the storage administrator to unlock it.
Connection to cluster1 closed.
まとめ
- ついついデフォルトの
adminユーザーを使い回してしまいがちですが、同じ権限でも異なるユーザー名にしておくことでONTAPの管理ユーザー乗っ取りのリスクを大幅に下げることができます。 - ONTAPには、ほかにもMFA、MAV、Tamperproof Snapshotなど、管理ユーザー乗っ取りの対策となる機能は豊富なので、多層的な対策を実施していきましょう。