メインコンテンツへスキップ

FAQ:ONTAPの管理用カスタムロール

Views:
371
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
core
Last Updated:

 

環境

  • ONTAP 9
  • ロールベースアクセス制御(RBAC)

回答

この記事では、ONTAP 9でクラスタおよびVserver管理者向けのカスタムロールを作成する際に関係するさまざまな側面について説明します。これにより、カスタマイズされたロールの作成に役立ちます。

前提条件
  • ONTAP コマンドラインインターフェイス(CLI)の知識。
  • クラスタ管理者の管理者権限。
用語: 

コマンドディレクトリ

CLI 内のディレクトリを参照します。

例:
volume

コマンドサブディレクトリ

 ディレクトリ内のディレクトリを参照します。

例:
volume snapshot

コマンド

 特定の実行可能コマンドを参照します。

例: volume show -または- volume offline.

固有コマンド

すべてのディレクトリに対して、以下が組み込みコマンドとして定義されています:

  • 作成
  • 変更
  • 削除
  • 表示

非固有コマンド

 

custrole

 この記事で説明されているすべての例におけるカスタムロールを指します。

ロール

ロールとは、機能または権限の集合です。ロールには複数のルールが含まれ、各ルールは 1 つ以上の機能を指定します。機能は、「コマンドディレクトリ」または「コマンド」に対する「アクセス制御」として指定されます。 

ロール定義の構文

ルールは次のパラメータで構成されます:

  • Vserver名:カスタムロールが属するデータ/管理Vserverの名前。
  • ロール名:新しいカスタムロールの名前。例: storage_admin_role
  • コマンドディレクトリ (または) コマンド:コマンドディレクトリ(または)コマンド。
  • アクセス制御:3つのオプションがあります: all、 readonly、および none。 

次のロール定義の例を考えてみましょう。

(vs1.example.com, custrole, "volume", all)
(vs1.example.com, custrole, "volume snapshot", readonly)
(vs1.example.com, custrole, "volume clone", none) 

上記の例では、ロール「custrole」はVserver vs1.example.com に属しており、3つのルールが含まれています。 

ロール定義のセマンティクス:

ディレクトリ/コマンドとアクセス制御の組み合わせは 6 つあります。次の表は、それぞれの組み合わせの意味をまとめたものです。 

機能

アクセス

概要

ディレクトリ

all

指定されたディレクトリ、そのサブディレクトリ、およびコマンドへのアクセスを許可します

ディレクトリ

readonly

指定されたディレクトリとそのすべてのサブディレクトリへの read-only アクセスを許可します。組み込みコマンドのうち、 show のみが使用可能で、組み込みでないコマンドは使用できません。

ディレクトリ

None

指定されたディレクトリ、そのサブディレクトリ、およびコマンドへのアクセスを拒否します。

コマンド

all

指定されたコマンドの実行を許可します。

コマンド

readonly

無効。この組み合わせは使用しないことをお勧めします。例えば、 volume offline with access as readonly は無効です。

コマンド

none

指定されたコマンドの実行を拒否します

アクセス制御の仕組み
  1. アクセス制御の動作は階層的です:
  2. ルールがディレクトリを使用する場合、そのルールはすべてのサブディレクトリに適用されます。たとえば、このタプル(vs1, custrole, "volume", all)は、 volume ディレクトリとそのすべてのサブディレクトリへのアクセスを許可します。
  3. サブディレクトリアクセスは親ディレクトリアクセスよりも優先されます:
  4. 親ディレクトリに特定のアクセス制御があり、そのサブディレクトリに別のアクセス制御が指定されている場合、サブディレクトリのアクセス制御が親ディレクトリのアクセス制御よりも優先されます。

例:次の 2 つのルールを考えてみましょう。

(vs1, custrole, "volume", all)
(vs1, custrole, "volume snapshot", readonly)

最初のルールは、 volume ディレクトリおよびそのすべてのサブディレクトリへのフルアクセスを有効にします。しかし、2番目のルールは、 volume snapshot ディレクトリへのアクセスを readonlyに制限します。この場合、 volume snapshot が readonly アクセスで、 volume をフルアクセス制御で上書きします。したがって、 volume snapshot ディレクトリおよびそのすべてのサブディレクトリは readonly アクセスを持ち、 all アクセスではありません。

例:次の 2 つのルールを考えてみましょう。

(vs1, custrole, "vserver", readonly)
(vs1, custrole, "vserver nfs", all)

最初のルールは、 vserver ディレクトリとそのすべてのサブディレクトリを readonlyに制限します。ただし、2番目のルールは vserver nfs から allへのアクセスを指定します。この場合、フルアクセス権を持つ vserver nfs が親ディレクトリの readonly アクセス制御を上書きします。したがって、 vserver nfs ディレクトリとそのすべてのサブディレクトリは all アクセス権を持ち、 readonly アクセス権は持ちません。

固有コマンドの使用に関する制限

create、 modify、 delete、および show コマンドは組み込みコマンドであり、アクセス制御のためにこれらのコマンドを個別に指定することはできません。たとえば、次のルールは無効です:(vs1, custrole, "volume snapshot create", all)。  このコマンドは警告を発しますが、 modify、 delete、および show も有効にします。 

cluster1::> security login role create -vserver svm1 -role snap_create -cmddirname "volume snapshot create" -access all

Warning: This operation will also affect the following commands:
   "volume snapshot modify"
   "volume snapshot show"

cluster1::>security login role show -vserver svm1 -role snap_create
           Role          Command/                                      Access
Vserver    Name          Directory                               Query Level
---------- ------------- --------- ----------------------------------- --------
svm1       snap_create   DEFAULT                                       none
                         volume snapshot create                        all
                         volume snapshot modify                        all
                        volume snapshot show                          all

この DEFAULT ルールとは何ですか?また、なぜ作成されるのですか?

DEFAULT ルールは、残りのルールを構築するベースを指定します。データ / 管理 Vserver カスタムロールの場合、 DEFAULT ルールアクセスは noneに設定されます。DEFAULT ルールは自動的に作成されます。 

カスタム RBAC ロールで個々のコマンドを指定するにはどうすればよいですか。

次のような固有コマンド create / modify / delete は指定できません。たとえば、 modify オプションのみをロールに指定することはできません。 

カスタム RBAC ロールで組み込みコマンドを使用する場合は、ディレクトリで次のいずれかのオプションを指定します:

  • all -   すべての create / modify / delete / show コマンドを許可します
  • readonly show コマンドのみを許可します
  • none -ディレクトリ全体へのアクセスを拒否します 

非固有コマンドは、ロールに対して許可または拒否できます。例えば、 volume online は非固有コマンドです。コマンドの場合、アクセスは許可または拒否できます。コマンド権限はアクセス allを使用して有効にすることができます。コマンド拒否はアクセス noneを使用して有効にすることができます。アクセス readonly は個々のコマンドには適用されないため、使用は推奨されません。

特定の ZAPI をロールに対して有効にするにはどうすればよいですか?

カスタムロールに特定の ZAPI を指定する場合は、ロール仕様で同等の CLI コマンドを指定します。たとえば、カスタムロールの volume-offline ZAPI を有効にする場合は、同等の CLI volume offline ルールをロール仕様に追加します。

たとえば、次のコマンドを実行します: security login role create –vserver vs1.example.com –role custrole –command "volume offline"–access all

検証の目的でカスタムロールの許可されたコマンドをすべて一覧表示するにはどうすればよいでしょうか? 
  • security login create コマンドを使用して、ユーザーアカウント「fred」を作成します
  • 管理Vserver用にSSHを使用してログインするか、 vserver context コマンドを実行してデータVserverの特定のユーザーに切り替えます。

例: vserver context –vserver vs1.example.com –username fred

  • security login role show-ontapi コマンドを使用して、カスタムロールのすべての CLI と同等の ZAPI を列挙します。

注記: security login role show-ontapi コマンドがカスタムロールに対して有効になっていることを確認してください。

特定のコマンド(または)ZAPI がカスタムロールに対して有効になっているかどうかを確認する方法を教えてください。

show-ontapi -command <command-name>  コマンドを使用して、指定されたコマンドがカスタムロールに対して許可されているかどうかを確認します。出力には同等の ZAPI も表示されます。

CLI コマンドが与えられた場合、同等の ZAPI を取得する方法(または)指定された ZAPI で同等の CLI を取得する方法を教えてください。 

show-ontapi -ontapi "<ZAPI-name>" コマンドを使用して、指定された ZAPI がカスタムロールに対して許可されているかどうかを確認します。出力には同等の CLI も表示されます。

ロールのコピーまたは複製に役立つ role copy (または) role clone コマンドはありますか?

いいえ、この機能は ONTAP 9 ではサポートされていません。

データ Vserver カスタムロールに任意のコマンドを割り当てることはできますか?

いいえ、すべてのコマンドをデータVserverカスタムロールに割り当てることはできません。  –vserver をオプションとして持つコマンドのみ、Vserverカスタムロールに割り当てることができます。  たとえば、 system node reboot コマンドは、 –vserver をオプションとして持たないため、データVserverカスタムロールに割り当てることはできません。 

カスタムロールの例

例:管理者がシステム内のすべてのログインアカウントを表示できるようにするカスタムロールを作成します。 

たとえば、この役割の名前を次のようにします login_accts_ro。 

許可されるコマンドは security login showです。コマンドディレクトリは security loginです。

security login アクセス権を持つ readonly ディレクトリが必要になります。

ルールタプルは次のとおりです:

(clus1, login_accts_ro, "security login", readonly). 

このタプルは、 readonly 権限を security login ディレクトリだけでなく、他のサブディレクトリにも付与でき、 readonly 権限を持つディレクトリは次のようになります:

security login domain-tunnel、 security login publickey、 security login role

これら 3 つのディレクトリへのアクセスを禁止する必要があります。したがって、次のルールを追加する必要があります:

(clus1, login_accts_ro, "security login domain-tunnel", none)
(clus1, login_accts_ro, "security login publickey", none)
(clus1, login_accts_ro, "security login role", none) 

login_accts_ro には、現在のユーザーのパスワードを変更するアクセス権が必要です。

ルールは次のとおりです:

(clus1, login_accts_ro, "security login password", all) 

CLI security login role show-ontapi を使用して、現在のユーザーの機能を表示できます。このコマンドを追加して、機能を検証することができます。

(clus1, login_accts_ro, "security login role show-ontapi", all) 

ルールの概要は次のとおりです:

(clus1, login_accts_ro, "security login", readonly)
(clus1, login_accts_ro, "security login domain-tunnel", none)
(clus1, login_accts_ro, "security login publickey", none)
(clus1, login_accts_ro, "security login role", none)
(clus1, login_accts_ro, "security login password", all)
(clus1, login_accts_ro, "security login role show-ontapi", all) 

次のコマンドセットを使用して、 login_accts_ro ロールを作成できます: 

role create -vserver clus1 -role login_accts_ro -cmddirname "security login" -access readonly
role create -vserver clus1 -role login_accts_ro -cmddirname "security login domain-tunnel" -access none
role create -vserver clus1 -role login_accts_ro -cmddirname "security login publickey" -access none
role create -vserver clus1 -role login_accts_ro -cmddirname "security login role" -access none
role create -vserver clus1 -role login_accts_ro -cmddirname "security login password" -access all

例:ライセンス管理のみを許可するカスタムロールを作成する 

例えば、これを次のように名付けます role license_role 

許可されるコマンドディレクトリは system licenseです。

system licenseディレクトリと all アクセスが必要になります。

タプルは次のとおりです:

(clus1, license_role, "system license", all). 

license_roleには、現在のユーザーのパスワードを変更するアクセス権が必要です。

ルールは次のようになります:

(clus1, license_role, "security login password", all) 

security login role show-ontapiコマンドを使用して、現在のユーザーの機能を表示できます。このコマンドを追加して機能を検証できます。

(clus1, license_role, "security login role show-ontapi", all) 

ルールの概要は次のとおりです:

(clus1, license_role, "system license", all)
(clus1, license_role, "security login password", all)

(clus1, license_role, "security login role show-ontapi", all) 

次のコマンドセットを実行して、 license_roleを作成します: 

role create -vserver clus1 -role license_role  -cmddirname "system license" -access all
role create -vserver clus1 -role license_role  -cmddirname "security login password" -access all
role create -vserver clus1 -role license_role  -cmddirname "security login role show-ontapi" -access all
 

例:ファイルシステム管理のみを許可するデータVserverカスタムロールを作成する 

例えば、この役割を  filesys_admin_roleと呼びます。 

次のコマンドディレクトリが許可されます:

"vserver nfs"
"vserver cifs"
"vserver export-policy"
"vserver locks"
"vserver services ldap"
"vserver services nis-domain"
"vserver services unix-group"
"vserver services unix-user"

タプルは次のとおりです:

(vs1.example.com, filesys_admin_role, "vserver nfs", all)
(vs1.example.com, filesys_admin_role, "vserver cifs", all)
(vs1.example.com, filesys_admin_role, "vserver export-policy", all)
(vs1.example.com, filesys_admin_role, "vserver locks", all)
(vs1.example.com, filesys_admin_role, "vserver services ldap", all)
(vs1.example.com, filesys_admin_role, "vserver services nis-domain", all)
(vs1.example.com, filesys_admin_role, "vserver services unix-group", all)
(vs1.example.com, filesys_admin_role, "vserver services unix-user", all) 

filesys_admin_role  は、現在のユーザーのパスワードを変更するアクセス権を持っている必要があります。

ルールは次のようになります:

(vs1.example.com, filesys_admin_role, "security login password", all) 

CLI security login role show-ontapi は、現在のユーザーの機能を表示するために使用できます。このコマンドを追加して機能を検証できます。

(vs1.example.com, filesys_admin_role, "security login role show-ontapi", all) 

ルールの概要は次のとおりです:

(vs1.example.com, filesys_admin_role, "vserver nfs", all)
(vs1.example.com, filesys_admin_role, "vserver cifs", all)
(vs1.example.com, filesys_admin_role, "vserver export-policy", all)
(vs1.example.com, filesys_admin_role, "vserver locks", all)
(vs1.example.com, filesys_admin_role, "vserver services ldap", all)
(vs1.example.com, filesys_admin_role, "vserver services nis-domain", all)
(vs1.example.com, filesys_admin_role, "vserver services unix-group", all)
(vs1.example.com, filesys_admin_role, "vserver services unix-user", all)
(vs1.example.com, filesys_admin_role, "security login password", all)
(vs1.example.com, filesys_admin_role, "security login role show-ontapi", all) 

以下は、 filesys_admin_roleを作成するためのコマンドセットです:

role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver nfs" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver cifs" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver export-policy" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver locks" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver services ldap" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver services nis-domain" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver services unix-group" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "vserver services unix-user" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "security login password" -access all
role create -vserver vs1.example.com -role filesys_admin_role  -cmddirname "security login role show-ontapi" -access all

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.