[Adobeアカウント連携]その2 User Sync Tool for Linux

◆ Live配信スケジュール ◆
サイオステクノロジーでは、Microsoft MVPの武井による「わかりみの深いシリーズ」など、定期的なLive配信を行っています。
⇒ 詳細スケジュールはこちらから
⇒ 見逃してしまった方はYoutubeチャンネルをご覧ください
【5/21開催】Azure OpenAI ServiceによるRAG実装ガイドを公開しました
生成AIを活用したユースケースで最も一番熱いと言われているRAGの実装ガイドを公開しました。そのガイドの紹介をおこなうイベントです!!
https://tech-lab.connpass.com/event/315703/

こんにちは、サイオステクノロジーの小川です。今回はUser Syncの検証を行いましたので設定方法について掲載します。

User Sync ツールは、ユーザーとグループの情報を組織のエンタープライズディレクトリシステムから Adobe Admin Console 内の組織のディレクトリに移すためのツールです。User Syncを利用することで、源泉のLDAPでアカウントの一元管理が可能になります。

構成

ツールバージョン役割
User Sync Tool2.6.0Adobeアカウント連携機能

ここからUser Syncの実行アプリケーションファイル(user-sync-v<バージョン>-centos7.tar.gz)と構成ファイル(examples.tar.gz)を取得します。

※User SyncはCentoOS8でも動作していることを確認しています。

サーバーにUser Sync用のディレクトリを作成します。

# mkdir /usr/local/usersync

作成したディレクトリにUser Syncの実行ファイル、構成ファイルを配置します。

[root@usersync usersync]# ll
total 15008
drwxr-xr-x. 3 root root 63 Aug 26 14:35 certs
-rw-r--r--. 1 root root 13325 Aug 26 14:45 connector-ldap.yml
-rw-r--r--. 1 root root 4750 Aug 26 14:39 connector-umapi.yml
-rwxr-xr-x. 1 root root 15323088 May 1 07:58 user-sync
-rw-r--r--. 1 root root 18476 Aug 26 14:42 user-sync-config.yml
  • certs                                //certsディレクトリを作成し、配下に証明書を配置
  • connector-ldap.yml           //LDAP接続、フィルター、属性設定ファイル
  • connector-umapi.yml        //User Management API接続設定ファイル
  • user-sync-config.yml        //User Sync構成ファイル
  • user-sync                        //User Sync実行アプリ

証明書の作成

access_token プロセスの取得にあたって JWT の正当性を証明するためのキーペアを作成します。

User Sync実行アプリケーションのディレクトリに移動し、以下コマンドを実行します。

[root@usersync usersync]# ./user-sync certgen

Enter information as required to generate the X509 certificate/key pair for your organization. 
This information is used only for authentication with UMAPI and does not need to reflect 
an SSL or other official identity. Specify values as you deem fit.

Expiration date (mm/dd/yyyy) [09/08/2030]:
Country Code [US]: JP
State [Your State]: <stateを入力>
City [Your City]: <cityを入力>
Organization [Company]: <組織を入力>
Common Name [Your Name]: <server FQDN>
Email [email@company.com]:
----------------------------------------------------
Success! Files were created at:
/usr/local/usersync/private.key
/usr/local/usersync/certificate_pub.crt

カレントディレクトリに証明書と秘密鍵が作成されます。

certsディレクトリに証明書と秘密鍵を移動します。

# mv -v certificate_pub.crt /usr/local/usersync/certs/
# mv -v private.key /usr/local/usersync/certs/

Adobe APIの追加

Adobe開発者コンソールにシステム管理者アカウントでログインします。

連携する組織を選択し、プロジェクトを作成します。

Add to Projectを選択し、APIからUser Management APIを追加します。

作成した公開鍵をOption2のUpload your public keyにアップロードします。

クライアントID、クライアントシークレット、テクニカルアカウントID、組織IDの値を控えます。

User Sync設定

Adobe接続設定

User Management APIの接続情報をUser Syncのconnector-umapi.ymlファイルで設定します。

[root@usersync usersync]# vim connector-umapi.yml

# [NOTE: the priv_key_path setting can be an absolute or relative pathname;
# if relative, it is interpreted relative to this configuration file.]
enterprise:
  org_id: "組織IDを設定"
  api_key: "クライアントIDを設定"
  client_secret: "クライアントシークレットを設定"
  tech_acct: "テクニカルアカウントIDを設定"
  priv_key_path: "/usr/local/usersync/certs/private.key" //User Management APIに登録した公開鍵の秘密鍵パスを設定

LDAP接続

connector-ldap.ymlでLDAP接続、属性についての設定を行います。

[root@usersync usersync]# vim connector-ldap.yml

LDAPの接続情報を記載します。
@@ 16行目
# connection settings (required)
# You must specify all four of these settings.  Consult with your
# enterprise directory administrators to get suitable values.
# These access credentials are sensitive and must be protected.
username: "cn=Manager,dc=example,dc=com"
password: "********"
host: "ldap://ldapserver"
base_dn: "dc=example,dc=com"

LDAPからフェッチするページサイズを設定します。(デフォルト1000)
@@ 56行目
# search_page_size specifies the result page size requested when
# fetching values from the directory.
search_page_size: 1000

LDAPの証明書の検証を強制しない設定にします。(デフォルト)
@@ 61行目
# require_tls_cert forces the ldap connection to use TLS security with cerficate
# validation.  Allowed values are True (require) or False (don't require).
require_tls_cert: False

ユーザーのフィルター条件を設定します。
@@ 70行目
# The default value specified here is appropriate for Active Directory, which has a
# special field that is used to enable and disable users.  The value for OpenLDAP
# directories might be much simpler: "(&(objectClass=person)(objectClass=top))"
all_users_filter: "(&(uid=*)(objectClass=inetOrgPerson)(objectClass=person))"

グループのフィルター条件を設定します。
@@ 81行目
# You will likely want to replace it with a simpler query customized for your directory,
# such as this one for Active Directory: "(&(objectCategory=group)(cn={group}))"
# or this one for OpenLDAP: "(&(|(objectClass=groupOfNames)(objectClass=posixGroup))(cn={group}))"
group_filter_format: "(&(|(objectClass=groupOfNames)(objectClass=posixGroup))(cn={group}))"

グループに所属するメンバーのフィルター条件を設定します。
@@ 90行目
# not those who are "indirectly" members by virtue of membership in a group
# that is contained in the group.  If you want indirect containment, then
# use this value instead of the default:
# group_member_filter_format: "(memberOf:1.2.840.113556.1.4.1941:={group_dn})"
group_member_filter_format: "(memberOf={group_dn})"

ユーザーのメール属性、ユーザー名を設定します。
@@ 155行目
# NOTE: for this and every format setting, the constant strings must be in
# the encoding specified by the string_encoding setting, above.
user_email_format: "{mail}"

ユーザーの名の属性を設定(デフォルトはgivenName)
@@ 181行目
# The default value used here is simple, and suitable for OpenLDAP systems.
# NOTE: for this and every format setting, the constant strings must be in
# the encoding specified by the string_encoding setting, above.
#user_given_name_format: "{givenName}"

ユーザーの姓の属性を設定(デフォルトはsn)
@@ 191行目
# The default value used here is simple, and suitable for OpenLDAP systems.
# NOTE: for this and every format setting, the constant strings must be in
# the encoding specified by the string_encoding setting, above.
#user_surname_format: "{sn}"

ユーザーの国名を設定(デフォルトはc)
@@ 201行目
# The default value used here is simple, and suitable for OpenLDAP systems.
# NOTE: for this and every format setting, the constant strings must be in
# the encoding specified by the string_encoding setting, above.
user_country_code_format: "{c}"

User Sync連携設定

LDAPとAdobeの接続の設定が完了したら、連携処理の詳細なオプションをuser-sync-config.ymlで設定します。

[root@usersync usersync]# vim user-sync-config.yml

Adobe連携時に処理を除外するアカウントの設定
@@ 13行目
Adobe_users:

  exclude_identity_types:
    - adobeID

  exclude_adobe_groups:
    #- “Sample Product Profile”
    #- “Sample User Group”

  exclude_users:
    #- ".*@special.com"
    #- "freelancer-[0-9]+.*"

連携するユーザーに関する設定を行います。
@@ 73行目
directory_users:

  連携するIDタイプを設定します。
  @@ 86行目
  user_identity_type: federatedID

  国名を設定します。
  @@ 97行目
  default_countory_code: JP

  グループ連携の設定をします。
  @@ 153行目
  groups:
    - directory_group: "ldapgroup1"   //LDAPのグループのcn名
     adobe_groups:
       - "adobegroup1"    //Adobeのユーザーグループ名
    - directory_group: "ldapgroup2"   //LDAPのグループのcn名
     adobe_groups:
       - "adobegourp2"    //Adobeのユーザーグループ名

連携実行時のadobeユーザーの削除時の一括削除最大可能数を設定(整数値)
@@ 229行目
limits:
  max_adobe_only_users: 200

ログ出力に関する設定
@@ 250行目
logging:
ログファイルを生成するか
  log_to_file: True

  出力ログディレクトリを指定
  file_log_directory: /var/log/usersync

  出力ログフォーマット
  file_log_name_format: 'UserSync.log'

  ファイルの出力ログレベル
  file_log_level: info

  コンソールの出力ログレベル
  console_log_level: info

連携の詳細な実行オプションを設定(主なオプションの設定値については以下に記載)
@@ 319行目
invocation_defaults:
  # For argument --adobe-only-user-action, the default is 'preserve'.
  adobe_only_user_action: delete
  # For argument --adobe-only-user-list, the default is empty (no value).
  adobe_only_user_list:
  # For argument --adobe-users, the default is 'all'.
  # if you want to specify group manually. Valid value format is
  # ['group', 'groupA,groupB']
  adobe_users: all
  # For argument --connector, the default is 'ldap'.
  connector: ldap
  # For argument --exclude_unmapped_users, the default is False (include all).
  # If you set this default to True, UST will automatically skip user creation
  # on user that is not part of any mapped group.
  # --include-unmapped-users to override the default.
  exclude_unmapped_users: No
  # For argument --process-groups, the default is False (don't process).
  # If you set this default to True, you can supply the argument
  # --no-process-groups to override the default.
  process_groups: Yes
  # For argument --strategy, the default is 'sync'.
  strategy: sync
  # For argument --test-mode (or -t), the default is False (live run).
  # if you set this default to True, you can supply the argument
  # --no-test-mode (or -T) to override the default.
  test_mode: No
  # For argument --update-user-info, the default is False (don't update).
  # If you set this default to True, you can supply the argument
  # --no-update-user-info to override the default.
  update_user_info: Yes
  # For argument --user-filter, the default is empty (no value).
  # Because regular expression notation uses special characters,
  # any default you set should almost certainly be single-quoted.
  user_filter:
  # For argument --users, the default is 'all'.
  # for CSV input, use an array - ['file', 'users.csv']
  users: mapped

invocation_defaultsの主なオプションの設定値

  •  adobe_only_user_action:adobeのみのユーザーの連携処理の設定
    • exclude:連携対象としない
    • preserve:削除に関する処理は行わない
    • remove:論理削除(ユーザーからは削除されるが、ディレクトリユーザには残る)
    • delete:物理削除(ユーザーからもディレクトリユーザーからも削除される)
  • process_groups
    • Yes:グループメンバーシップ情報を更新する
    • No:グループメンバーシップ情報を更新しない
  • update_user_info
    • Yes:ユーザー情報の更新をする
    • No:ユーザー情報の更新をしない
  • users
    • all:連携対象のユーザーすべてを連携する
    • mapped:連携対象かつグループのメンバーユーザーを連携する

連携実行

Adobeへのアカウント連携を実行するにはUser Syncの実行アプリケーションのフォルダへ移動します。

以下コマンドを実行します。

[root@usersync usersync]#./user-sync

Adobe管理コンソールでアカウントが作成されたことを確認します。

テスト実行を行うには-tオプションをつけて実行します。

[root@usersync usersync]#./user-sync -t

User Sync for Linuxのメリット

User Syncにはメール通知機能、ログ世代管理機能がありません。

shellでアカウント連携実行時に結果をメール通知するスクリプトを作成し、cronで定期実行を行うことが可能です。

logrotateでログのローテーション、世代管理が容易にできます。

アバター画像
About 小川雄大 27 Articles
IDaaSプロジェクトを担当。
ご覧いただきありがとうございます! この投稿はお役に立ちましたか?

役に立った 役に立たなかった

0人がこの投稿は役に立ったと言っています。


ご覧いただきありがとうございます。
ブログの最新情報はSNSでも発信しております。
ぜひTwitterのフォロー&Facebookページにいいねをお願い致します!



>> 雑誌等の執筆依頼を受付しております。
   ご希望の方はお気軽にお問い合わせください!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


質問はこちら 閉じる