このセクションのタスクと例では、ユーザーにデフォルトで付与される権利に権利を追加します。権利の詳細については、権利を使用したユーザーとプロセスの制御についてを参照してください。
信頼できるユーザーに認証権利プロファイルを割り当てる – 使用例 13、使用例 35
サードパーティーアプリケーションの管理者の権利プロファイルを作成する – 使用例 19
権利プロファイルを変更する – 使用例 25
ユーザーまたは役割が root 所有ファイルを編集できるようにする – 使用例 48
新しい承認が含まれている権利プロファイルを割り当てる – 使用例 50
セキュリティー管理者が、DHCP を管理できるユーザーを作成します。
# useradd -K profiles="DHCP Management" -s /usr/bin/pfbash -S ldap jdoe
ユーザーには pfbash ログインシェルが割り当てられるため、DHCP Management 権利プロファイル内の権利は常に評価され、DHCP 管理コマンドが正常に完了します。
使用例 13 ユーザーに対し DHCP 管理の前にパスワード入力を求めるこの例では、セキュリティー管理者が jdoe に対し、DHCP を管理する前にパスワードを入力するよう求めます。
# usermod -K auth_profiles="DHCP Management" profiles="Edit Administrative Files" jdoe
jdoe が DHCP コマンドを入力すると、パスワードプロンプトが表示されます。jdoe の認証後に DHCP コマンドが完了します。検索順序に従って、通常のプロファイルの前に認証権利プロファイルが処理されます。
jdoe$ dhcpconfig -R 120.30.33.7,120.30.42.132
Password: xxxxxxxx
/** Command completes **/
使用例 14 ユーザーへの承認の直接割り当て
この例では、セキュリティー管理者が、画面の明るさを制御できるローカルユーザーを作成します。
# useradd -c "Screened KDoe, local" -s /usr/bin/pfbash \ -K auths=solaris.system.power.brightness kdoe
この承認は、ユーザーの既存の承認の割り当てに追加されます。
使用例 15 役割への承認の割り当てこの例では、セキュリティー管理者が DNS サーバーサービスの構成情報を変更できる役割を作成します。
# roleadd -c "DNS administrator role" -m -K auths="solaris.smf.manage.bind" dnsadmin使用例 16 ユーザーへの特権の直接割り当て
この例では、セキュリティー管理者が、システム時間に影響を及ぼすきわめて特殊な特権をユーザー kdoe に委ねます。特権を役割に割り当てるには、使用例 10を参照してください。
# usermod -K defaultpriv='basic,proc_clock_highres' kdoe
既存の値が defaultpriv キーワードの値で置き換えられます。このため、ユーザーが basic 特権を保持するために、値 basic が指定されます。デフォルトの構成では、すべてのユーザーが基本特権を保持します。基本特権のリストについては、特権の一覧表示を参照してください。
ユーザーは追加された特権とその定義を表示できます。
kdoe% ppriv -v $$ 1800: pfksh flags = <none> E: file_link_any,…,proc_clock_highres,sys_ib_info I: file_link_any,…,proc_clock_highres,sys_ib_info P: file_link_any,…,proc_clock_highres,sys_ib_info L: cpc_cpu,dtrace_kernel,dtrace_proc,dtrace_user,...,win_upgrade_sl % ppriv -vl proc_clock_highres Allows a process to use high resolution timers.使用例 17 役割の基本特権への追加
次の例では、役割 realtime に日時のプログラムを処理する特権が直接割り当てられます。使用例 10で proc_clock_highres を realtime に割り当てました。
# rolemod -K defaultpriv='basic,sys_time' realtime
% su - realtime Password: xxxxxxxx # ppriv -v $$ 1600: pfksh flags = <none> E: file_link_any,...,proc_clock_highres,sys_ib_info,sys_time I: file_link_any,...,proc_clock_highres,sys_ib_info,sys_time P: file_link_any,...,proc_clock_highres,sys_ib_info,sys_time L: cpc_cpu,dtrace_kernel,dtrace_proc,dtrace_user,...,sys_time使用例 18 役割パスワードでのユーザー独自のパスワード使用の有効化
デフォルトでは、ユーザーが役割になるには、その役割のパスワードを入力する必要があります。ユーザーパスワードを要求することで、管理者は Linux 環境での役割の引き受けと同様に Oracle Solaris で役割を引き受けられるようにします。
# rolemod -K roleauth=user auditrev
割り当てられたユーザーは、この役割を引き受けるために、その役割用に特別に作成されたパスワードではなく、自分のパスワードを使用できるようになります。
ユーザーにほかの役割が割り当てられている場合は、ユーザーのパスワードによってそれらの役割への認証も行われます。
使用例 19 サードパーティーアプリケーションの管理者の権利プロファイルの作成通常、サードパーティーアプリケーションの管理者に root 特権は与えられません。アプリケーションが Oracle Solaris 権利プロファイルに含まれていないコマンドを使用する場合、root 管理者は、アプリケーション管理者の権利プロファイルを作成するようにしてください。この例は、ユーザー管理コマンドが User Management および User Security 権利プロファイル内の Oracle Solaris コマンドに依存するアプリケーションの権利プロファイルを示しています。このアプリケーションはまた、特権を必要とする方法で mv、rm、および cp コマンドも使用します。
cp、mv、および rm コマンドにどの特権が必要であるかを判定するために、この管理者は、プログラムが必要とする特権を判断する方法で説明されているようにアプリケーションをテストしました。
# profiles -p "Application User Management" profiles:Application User Management> set desc="Application User Management Profile" profiles:Application User Management> add profiles="User Management,User Security" profiles:Application User Management> add cmd=/usr/bin/cp profiles:Application User Management:cp> set privs=zone profiles:Application User Management:cp> end profiles:Application User Management> add cmd=/usr/bin/mv profiles:Application User Management:mv> set privs=zone profiles:Application User Management:mv> end profiles:Application User Management> add cmd=/usr/bin/rm profiles:Application User Management:rm> set privs=zone profiles:Application User Management:rm> end profiles:Application User Management> add cmd=/opt/Appl/bin/addusr profiles:Application User Management:addusr> set privs=zone profiles:Application User Management:addusr> end profiles:Application User Management> add cmd=/opt/Appl/bin/addgrp profiles:Application User Management:addgrp> set privs=zone profiles:Application User Management:addgrp> end profiles:Application User Management> commit profiles:Application User Management> info name=Application User Management desc=Application User Management Profile profiles=User Management,User Security cmd=/usr/bin/cp ... profiles:Application Administrator> exit使用例 20 ユーザーが役割パスワードとして独自のパスワードを使用できるようにするための権利プロファイルの変更
# profiles -p "Local System Administrator" profiles:Local System Administrator> set roleauth="user" profiles:Local System Administrator> end profiles:Local System Administrator> exit
Local System Administrator 権利プロファイルが割り当てられているユーザーがその役割を引き受ける場合、そのユーザーはパスワードの入力を求められます。次のシーケンスでは、役割名は admin です。
% su - admin
Password: xxxxxxxx
# /** You are now in a profile shell with administrative rights**/
使用例 21 LDAP リポジトリ内の役割の roleauth の値を変更する
この例では、root 役割によって、役割 secadmin を引き受けることができるすべてのユーザーが役割の引き受け時に自分のパスワードを使用できるようになります。この機能は、LDAP サーバーによって管理されるすべてのシステムでこれらのユーザーに付与されます。
# rolemod -S ldap -K roleauth=user secadmin使用例 22 信頼できるユーザーによる拡張アカウントファイル読み取りの有効化
信頼できるユーザーまたはユーザーグループによる、root アカウントが所有するファイルの読み取りを可能にできます。この権利は、root 所有ファイルを含む管理アプリケーションを実行できるユーザーにとって役立ちます。この例では、1 つまたは複数の Perl スクリプトを Extended Accounting Net Management 権利プロファイルに追加します。
管理者は root 役割を引き受けたあとで、名前が network で始まるアカウンティングファイルの読み取り機能を追加する権利プロファイルを作成します。
次のプロファイルは、拡張特権ポリシーを使用して file_dac_read 特権をスクリプトに付与し、これによりこのスクリプトは /var/adm/exacct/network* ファイルのみにアクセスできるようになります。このプロファイルは既存の Extended Accounting Net Management 権利プロファイルを補助プロファイルとして追加します。
# profiles -p "Extended Accounting Perl Scripts" profiles:Extended Accounting Perl Scripts > set desc="Perl Scripts for Extended Accounting" ... Scripts> add profiles="Extended Accounting Net Management" ... Scripts> add cmd=/usr/local/bin/exacctdisp.pl ... Scripts:exacctdisp.pl> set privs={file_dac_read}:/var/adm/exacct/network* ... Scripts:exacctdisp.pl> end ... Scripts> commit ... Scripts> exit
サンプルスクリプトについては、Oracle Solaris 11.3 でのリソースの管理 の libexacct に対する Perl インタフェースの使用を参照してください。
管理者は、権利プロファイルエントリで、スペルミス、省略、繰り返しなどのエラーがないかどうかを確認してから、Extended Accounting Perl Scripts 権利プロファイルを役割またはユーザーに割り当てます。
# profiles -p "Extended Accounting Perl Scripts" info Found profile in files repository. name=Extended Accounting Perl Scripts desc=Perl Scripts for Extended Accounting profiles=Extended Accounting Net Management cmd=/usr/local/bin/exacctdisp.pl privs={file_dac_read}:/var/adm/exacct/network*
# rolemod -K profiles+="Extended Accounting Perl Scripts" rolename # usermod -s /usr/bin/pfbash -K profiles+="Extended Accounting Perl Scripts" username使用例 23 root 以外のアカウントによる root 所有ファイルの読み取りの有効化
この例では、管理者が拡張特権ポリシーを使用する権利プロファイルを作成し、認証されるユーザーと役割が、root が所有する /var/adm/sulog ファイルを読み取ることができるようにします。管理者は、ユーザーがファイルの読み取りに使用できるコマンドを追加します。head コマンドなど、リストにないコマンドを使用不可にすることはできません。
# profiles -p "Read sulog File" profiles:Read sulog File set desc="Read sulog File" ... File> add profiles="Read Log Files" ... File> add cmd=/usr/bin/cat ... File:cat> set privs={file_dac_read}:/var/adm/sulog ... File:cat> end ... File> add cmd=/usr/bin/less ... File:less> set privs={file_dac_read}:/var/adm/sulog ... File:less> end ... File> add cmd=/usr/bin/more ... File:more> set privs={file_dac_read}:/var/adm/sulog ... File:more> end ... File> add cmd=/usr/bin/page ... File:page> set privs={file_dac_read}:/var/adm/sulog ... File:page> end ... File> add cmd=/usr/bin/tail ... File:tail> set privs={file_dac_read}:/var/adm/sulog ... File:tail> end ... File> add cmd=/usr/bin/view ... File:head> set privs={file_dac_read}:/var/adm/sulog ... File:head> end ... File> commit ... File> exit
view コマンドは、ユーザーによるファイル読み取りを可能にしますが、編集はできません。