メインコンテンツまでスキップ

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

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

すべてのとおり  

環境

  • ONTAP 9
  • role-based access control(RBAC;ロールベース アクセス制御)

回答

この記事では、ONTAP 9でクラスタ管理者およびSVM管理者用のカスタムロールを作成する際に必要なさまざまな要素について説明します。これらの要素は、カスタマイズされたロールを作成するのに役立ちます。

前提条件: :
  • ONTAP のコマンドラインインターフェイス( CLI )に精通していること。
  • クラスタ管理者の管理者権限。
用語 

コマンドディレクトリ

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

例:
volume

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

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

例:
volume snapshot

コマンド

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

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

組み込みコマンド

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

  • 作成
  • 変更
  • 削除
  • show

Non-Intrinsicコマンド

 

管理者ロール

 この記事に記載されているすべての例で、カスタムロールを参照します。

ロール

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

ロール定義の構文

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

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

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

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

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

ロール定義の意味:

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

仕様

アクセス

説明

ディレクトリ

all

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

ディレクトリ

readonly

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

ディレクトリ

None

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

コマンド

all

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

コマンド

readonly

無効です。この組み合わせは使用しないことをお勧めします。volume offline たとえば、アクセス AS はreadonly無効です。

コマンド

none

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

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

例:次の 2 つのルールについて考えてみます。

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

最初volumeのルールでは、ディレクトリとそのすべてのサブディレクトリへのフルアクセスが有効になります。ただし、 2 番目volume snapshot readonlyのルールでは、ディレクトリへのアクセスが制限されます。この場合volume snapshotreadonly、フルvolumeアクセス制御では、アクセスによってが上書きされます。そのためvolume snapshot 、ディレクトリとそのサブディレクトリにreadonlyはアクセス権がallあり、アクセス権はありません。

例:次の 2 つのルールについて考えてみます。

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

最初vserver readonlyのルールでは、ディレクトリとそのすべてのサブディレクトリがに制限されます。ただし、 2 番目vserver nfsallのルールでは、へのアクセスが指定されています。vserver nfsこの場合、フルアクセスでは親ディレクトリreadonlyのアクセス制御が上書きされます。そのためvserver nfs 、ディレクトリとすべてall readonly のサブディレクトリにアクセスでき、アクセスできません。

組み込みコマンドの使用に関する制限事項

createmodifydeleteshowおよびコマンドは組み込みコマンドであり、これらのコマンドはアクセス制御用に個別に指定することはできません。たとえば、次vs1, custrole, "volume snapshot create", allのルールは無効です。 ()  このコマンドmodifydeleteshowでは警告が表示されますが、、、、なども有効になります。 

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

このデフォルトのルールとは何ですか。また、なぜこのルールが作成されるのですか。

デフォルトのルールは、残りのルールを作成するベースを指定します。Data/Admin Vserver カスタムロールの場合none、デフォルトのルールアクセスはに設定されます。デフォルトのルールが自動的に作成されます。 

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

create//などの組み込みコマンドmodifydeleteは指定できません。たとえばmodify、ロールを指定するオプションのみを指定することはできません。 

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

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

組み込みコマンド以外のコマンドは、ロールに対して許可または拒否できます。たとえばvolume online、は組み込みコマンドではありません。コマンドの場合、アクセスを許可(または拒否)することができます。コマンド権限allnoneは、 access を使用してイネーブルにできます。コマンド拒否は、 access を使用してイネーブルにできます。アクセスはreadonly 個々のコマンドには適用されないため、使用することは推奨されません。

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

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

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

検証目的でカスタムロールに許可されているすべてのコマンドを一覧表示するにはどうすればよいですか。 
  • security login createコマンドを使用して、ユーザアカウント「 fred」 を作成します。
  • admin 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ではサポートされていません。

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

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

カスタムロールの例

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

たとえば、このロールにはlogin_accts_roという名前を付けます。 

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

security loginreadonlyアクセスできるディレクトリが必要です。

次に、ルールのタプルを示します。

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

このタプルでreadonlysecurity loginは、ディレクトリだけでreadonlyなく他のサブディレクトリも許可され、権限を持つディレクトリは次のようになります。

security login domain-tunnelsecurity login publickeysecurity 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) 

CLIsecurity 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 licenseallアクセスできるディレクトリが必要です。

次のタプルがあります。

(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
 

例:ファイルシステム管理のみを許可する Data 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.