第3章 グループメンバーによるデータエクスポートの許可およびグループメンバーの 1 人としてのエクスポート実行
グループのメンバーに、データをエクスポートするパーミッションを設定できます。スクリプトに cn=Directory Manager の認証情報を設定する必要がなくなるため、セキュリティーが向上します。また、グループを変更して、エクスポートのパーミッションを簡単に許可し、取り消しすことができます。
3.1. グループによるデータエクスポートの許可 リンクのコピーリンクがクリップボードにコピーされました!
この手順を使用して、cn=export_users,ou=groups,dc=example,dc=com グループを追加し、このグループのメンバーがエクスポートタスクを作成することを許可します。
手順
cn=export_users,ou=groups,dc=example,dc=comグループを作成します。dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" group create --cn export_users
# dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" group create --cn export_usersCopy to Clipboard Copied! Toggle word wrap Toggle overflow cn=export_users,ou=groups,dc=example,dc=comグループのメンバーがエクスポートタスクを作成することを許可するアクセス制御手順 (ACI) を追加します。Copy to Clipboard Copied! Toggle word wrap Toggle overflow ユーザーを作成します。
ユーザーアカウントを作成します。
dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" user create --uid="example" --cn="example" --uidNumber="1000" --gidNumber="1000" --homeDirectory="/home/example/" --displayName="Example User"
# dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" user create --uid="example" --cn="example" --uidNumber="1000" --gidNumber="1000" --homeDirectory="/home/example/" --displayName="Example User"Copy to Clipboard Copied! Toggle word wrap Toggle overflow ユーザーアカウントのパスワードを設定します。
dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" account reset_password "uid=example,ou=People,dc=example,dc=com" "password"
# dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" account reset_password "uid=example,ou=People,dc=example,dc=com" "password"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
uid=example,ou=People,dc=example,dc=comユーザーをcn=export_users,ou=groups,dc=example,dc=comグループに追加します。dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" group add_member export_users uid=example,ou=People,dc=example,dc=com
# dsidm -D "cn=Directory manager" ldap://server.example.com -b "dc=example,dc=com" group add_member export_users uid=example,ou=People,dc=example,dc=comCopy to Clipboard Copied! Toggle word wrap Toggle overflow
検証
cn=configエントリーに設定された ACI を表示します。ldapsearch -o ldif-wrap=no -LLLx -D "cn=directory manager" -W -H ldap://server.example.com -b cn=config aci= aci -s base* dn: cn=config aci: (target = "ldap:///cn=export,cn=tasks,cn=config")(targetattr="*")(version 3.0 ; acl "permission: Allow export_users group to export data" ; allow (add, read, search) groupdn = "ldap:///cn=export_users,ou=groups,dc=example,dc=com";) aci: (target = "ldap:///cn=config")(targetattr = "objectclass || cn || nsslapd-suffix || nsslapd-ldifdir")(version 3.0 ; acl "permission: Allow export_users group to access ldifdir attribute" ; allow (read,search) groupdn = "ldap:///cn=export_users,ou=groups,dc=example,dc=com";) ...
# ldapsearch -o ldif-wrap=no -LLLx -D "cn=directory manager" -W -H ldap://server.example.com -b cn=config aci= aci -s base* dn: cn=config aci: (target = "ldap:///cn=export,cn=tasks,cn=config")(targetattr="*")(version 3.0 ; acl "permission: Allow export_users group to export data" ; allow (add, read, search) groupdn = "ldap:///cn=export_users,ou=groups,dc=example,dc=com";) aci: (target = "ldap:///cn=config")(targetattr = "objectclass || cn || nsslapd-suffix || nsslapd-ldifdir")(version 3.0 ; acl "permission: Allow export_users group to access ldifdir attribute" ; allow (read,search) groupdn = "ldap:///cn=export_users,ou=groups,dc=example,dc=com";) ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow