はじめに
- 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など、管理ユーザー乗っ取りの対策となる機能は豊富なので、多層的な対策を実施していきましょう。