Dell Networking SONiCユーザーロールベースのアクセス制御

Summary: この記事では、Dell Networking SONiCでのロール ベースのアクセス制御について説明します。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

ロールベースのアクセス制御とは何ですか?

RBAC(ロール ベースのアクセス制御)は、アクセスと許可を制御します。ユーザーには、定義されたロールに基づいて権限が付与されます。管理者は、ユーザーに適切なシステム アクセスを許可するジョブ機能に基づいてユーザー ロールを作成できます。

RBACでは、タスクをパーティション分割できるように、各ロールの権限に制限があります。
ユーザー ロールは、ログイン時にユーザーを認証および許可し、ユーザーをEXECモードにします。
各ユーザー ロールは、ユーザーが入力できるコマンドと、ユーザーが実行できるアクションを決定する権限を割り当てます。RBACは、ユーザー権限を効率的に管理する方法を提供します。


Dell Networking SONiCで使用可能なユーザーロール

ロール アクセス権
Admin 管理者ユーザーは、システムへの完全な読み取り/書き込みアクセス権を持っています。つまり、すべての show コマンド、Linuxシェル、設定にフル アクセスできます。 
演算子 オペレーターは、システムへの読み取りアクセスが制限されています。つまり、一部のshowコマンドにアクセスすることはできますが、スイッチで構成を実行することはできません。

メモ: Dell SONiC 4.1では、2つの新しいユーザー ロールが導入され、同じユーザーが複数のロールを持つことができます。
 
ロール アクセス権
Secadmin secadminユーザーは、システム内のすべてのセキュリティ関連コマンドにアクセスできます。
Netadmin netadminユーザーは、スイッチを通過するトラフィックを管理する構成機能にアクセスできます。


構成構文:

Configuration 説明
admin@DELLSONiC:~$ sonic-cli Dell SONiC CLIの入力
DELLSONiC# ターミナルの設定 設定モードに入ります。
DELLSONiC(config)# username password role ユーザー名、パスワード、ロールを構成します。 

構成されたユーザーの役割を確認するには、 show users configured コマンドを使用します。このコマンドは、ローカルに構成されたユーザーとロールを表示します。
 
出力例:
DELLSONiC # show users configured
----------------------------------------------------------------------
User                              Role(s)
----------------------------------------------------------------------
admin1                            admin
oper                              operator
Dell SONiC 4.1では、1人のユーザーに複数の役割を設定できます。1人のユーザーに複数のロールを構成する方法の例を以下に示します。
DELLSONiC (config)# username testuser password testuser role operator,netadmin,secadmin
DELLSONiC(config)# exit

DELLSONiC # show users configured
----------------------------------------------------------------------
User                              Role(s)
----------------------------------------------------------------------
testuser                          netadmin,operator,secadmin

例:
ユーザー ロールについて説明するために、異なるロールを持つ2人のユーザーを作成します。

  • ユーザー 操作 にオペレーター ロールが割り当てられる
  • ユーザー admin1 に管理者ロールが割り当てられている


Operator ロールの oper でログインします。

メモ: オペレーター、secadmin、またはnetadminユーザーとしてログインすると、Dell Management Framework CLIに配置されます。

オペレーターの役割を持つユーザー オペレーションとしてスイッチにログインしてみましょう。「 ? 」を使用できます。」をクリックして、特定のモードでユーザー ロールでサポートされているコマンドを確認します。
sonic login: oper
Password:
Linux sonic 5.10.0-8-2-amd64 #1 SMP Debian 5.10.46-5 (2021-09-23) x86_64
You are on
  ____   ___  _   _ _  ____
/ ___| / _ \| \ | (_)/ ___|
\___ \| | | |  \| | | |
  ___) | |_| | |\  | | |___
|____/ \___/|_| \_|_|\____|

-- Software for Open Networking in the Cloud --

Unauthorized access and/or use are prohibited.
All access and/or use are subject to monitoring.

Help:    http://azure.github.io/SONiC/

sonic# ?
  copy         Perform file operations
  delete       Delete the file from local filesystem
  dir          Show folder contents
  exit         Exit from the CLI
  ls           Show folder contents
  ping         Send ICMP ECHO_REQUEST to network hosts
  ping6        Send ICMPv6 ECHO_REQUEST to network hosts
  show         Display running system information
  terminal     Set terminal settings
  traceroute   Print the route packets take to the host
  traceroute6  Print the route packets take to the IPv6 host
User oper には演算子の役割があります。オペレーターは、システムへの読み取りアクセス権のみを持っています。したがって、user oper は構成を実行できません。また、オペレーターは、adminユーザーのようなすべてのshowコマンドを実行することはできません。
 
メモ: Dell Networking SONiC 4.0.5以前のバージョンでは、Operatorロールを持つユーザーが設定モードに入る可能性があります。ただし、設定モードで実行されたコマンドは拒否されます。

出力例:
DELLSONiC# show version | grep Soft
Software Version  : 4.0.5-Enterprise_Base

DELLSONiC(config)# interface-naming standard 
% Error: Client is not authorized to perform this operation
DELLSONiC(config)# hostname DeLLSoNiC
% Error: Client is not authorized to perform this operation
DELLSONiC(config)# exit
DELLSONiC# clear logging 
DELLSONiC# show logging count
DELLSONiC# show audit-log 
%Error: Client is not authorized to perform this operation

DELLSONiC# show users
oper     ttyS0        2023-08-02 21:03

これは、管理者ロールを持つユーザーがアクセスできる監査ログにも表示されます。


管理者の役割である admin1 でログインします。

メモ: adminユーザーとしてログを記録すると、Linuxシェルに配置されます。プロンプトは admin@sonic:~$です。Dell Management Framework CLIにアクセスするには、 sonic-cli コマンドを使用する必要があります。
Debian GNU/Linux 10 DELLSONiC ttyS0

DELLSONiC login: admin1
Password: 
admin1@DELLSONiC:~$ sonic-cli
DELLSONiC# show version | grep Soft
Software Version  : 4.0.5-Enterprise_Base

DELLSONiC# show audit-log
Aug 02 21:06:01.052692+00:00 2023 DELLSONiC INFO mgmt-framework#clish[146]: User "admin1" command "startup" status - success
Aug 02 21:05:53.366544+00:00 2023 DELLSONiC INFO login[27960]: pam_unix(login:session): session opened for user admin1 by LOGIN(uid=0)
Aug 02 21:05:46.787657+00:00 2023 DELLSONiC INFO systemd[1]: Stopped Serial Getty on ttyS0.
Aug 02 21:05:46.203662+00:00 2023 DELLSONiC INFO login[4203]: pam_unix(login:session): session closed for user oper
Aug 02 21:05:45.855977+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "exit" status - success
Aug 02 21:05:09.966551+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "show users" status - success
Aug 02 21:04:52.730615+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "show audit-log" status - failure
Aug 02 21:04:46.843617+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "show logging count" status - success
Aug 02 21:04:43.031486+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "clear logging" status - success
Aug 02 21:04:39.074016+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "exit" status - success
Aug 02 21:04:26.504755+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "hostname DeLLSoNiC" status - failure
Aug 02 21:04:11.674915+00:00 2023 DELLSONiC INFO mgmt-framework#clish[134]: User "oper" command "interface-naming standard" status - failure


間違った認証情報でログインします。

次に、管理者ロールを持つ admin1 ユーザーの認証情報を間違えてログインしてみましょう。
 
メモ: 監査ログにアクセスできるのは、管理者ユーザーのみです。 
DELLSONiC login: admin1
Password:                            ==========>Wrong password is given

Login incorrect
DELLSONiC login: admin1
Password: 
Last login: Wed Aug  2 21:05:53 UTC 2023 on ttyS0
Linux DELLSONiC 4.19.0-9-2-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64
You are on
  ____   ___  _   _ _  ____
/ ___| / _ \| \ | (_)/ ___|
\___ \| | | |  \| | | |
  ___) | |_| | |\  | | |___
|____/ \___/|_| \_|_|\____|

-- Software for Open Networking in the Cloud --

Unauthorized access and/or use are prohibited.
All access and/or use are subject to monitoring.

Help:    http://azure.github.io/SONiC/
**Note the login failure for admin1
admin1@DELLSONiC:~$ sonic-cli

DELLSONiC# show audit-log
Aug 02 21:07:28.896480+00:00 2023 DELLSONiC INFO mgmt-framework#clish[155]: User "admin1" command "startup" status - success
Aug 02 21:07:20.219496+00:00 2023 DELLSONiC INFO login[7169]: pam_unix(login:session): session opened for user admin1 by LOGIN(uid=0)
Aug 02 21:07:12.635575+00:00 2023 DELLSONiC NOTICE login[7169]: FAILED LOGIN (1) on '/dev/ttyS0' FOR 'admin1', Authentication failure
Aug 02 21:07:08.763918+00:00 2023 DELLSONiC NOTICE login[7169]: pam_unix(login:auth): authentication failure; logname=LOGIN uid=0 euid=0 tty=/dev/ttyS0 ruser= rhost=  user=admin1

Affected Products

Enterprise SONiC Distribution, PowerSwitch E3200-ON Series, Dell EMC Networking N3200-ON, PowerSwitch S5212F-ON, PowerSwitch S5224F-ON, PowerSwitch S5232F-ON, PowerSwitch S5248F-ON, PowerSwitch S5296F-ON, PowerSwitch Z9100-ON, PowerSwitch Z9264F-ON , PowerSwitch Z9332F-ON, PowerSwitch Z9432F-ON ...
Article Properties
Article Number: 000216535
Article Type: How To
Last Modified: 19 Sep 2023
Version:  8
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.