LDAP とは
LDAP は軽量ディレクトリアクセスプロトコル(Lightweight Directory Access Protocol)です。LDAP の主な機能は、組織や人物などに関するデータをユーザーが検索できるようにすることです。この目的を達成するために、LDAP は LDAP ディレクトリにデータを格納し、このディレクトリにアクセスするユーザーを認証します。LDAP は、Active Directory(AD)など、ほとんどのベンダーディレクトリサービスで動作します。これにより、ユーザー、サービス、システム、ネットワーク、およびアプリケーションに関する情報をディレクトリサービスから他のアプリケーションやサービスに共有する機能を実装しやすくなります。
ColdFusion では、ColdFusion Administrator 内から LDAP サーバーのユーザーまたはグループを統合できます。ColdFusion の以前のリリースでは、ColdFusion Administrator を使用してユーザーマネージャーを作成できました。これは、ユーザーを作成してユーザーに一度に一つずつ権限を割り当てるのに役立ちます。
ColdFusion では、以下を行うことができます。
- LDAP ユーザーストアの設定 - 接続とユーザー/グループの読み込みに必要なすべてのデータを保存するのに役立ちます。
- ユーザーストアからの LDAP ユーザーおよびグループの読み込み - 選択したユーザー/グループを、追加したユーザーストアから読み込むのに役立ちます。
- ユーザーおよびグループへの権限の付与
外部認証タイプの追加
セキュリティ/Administrator で「別のユーザー名とパスワードで認証する (複数のユーザーを許可する)」オプションを選択すると、外部認証タイプを追加できます。
外部認証を追加するには:
SAML
LDAP
SAML/LDAP の設定
LDAP
セキュリティ/Administrator/外部認証で、または setAdminLdapConfiguration 関数を使用して、LDAP 設定の詳細を追加します。
次に、セキュリティ/ユーザーマネージャーページで、LDAP 認証タイプを選択し適切な役割を指定して、ユーザーを CF Admin に追加します。
その後、Administrator ログインページからログインすることができます。
ユーザーの追加(LDAP)
SAML
まず、セキュリティ/IdP 設定ページおよびセキュリティ/SP 設定ページから、SAML IdP および SP 設定を追加します。
次に、セキュリティ/ユーザーマネージャーページで、SAML 認証タイプを選択し適切な役割を指定して、ユーザーを CF Admin に追加します。
これで、ログインページに SSO ログインというオプションが表示されるようになります。
このオプションをクリックすると、ID プロバイダーログインページにリダイレクトされます。そこでログインに成功したら、ColdFusion Administrator ページ内に戻ります。
ユーザーの追加(SAML)
SAML および LDAP 用の管理 API
例
SAML
<cfscript> adminObj = CreateObject("component","CFIDE.adminapi.administrator"); adminObj.login("Adm1n$","admin"); secCFC = CreateObject("component","CFIDE.adminapi.security"); // SP 設定を追加 secCFC.addSpMetadata ( alias="#okta_sp_alias#", entityid="#okta_sp_entityid#", acsurl="#okta_sp_acsurl#", slourl="#okta_sp_slourl#", signrequests="true", wantassertionssigned="true", logoutresponsesigned="true", signkeystorepath="#okta_sp_signkeystorepath#", signkeystorepassword="#okta_sp_signkeystorepassword#", signkeystorealias="#okta_sp_signkeystorealias#" ) // IDP 設定を追加 secCFC.addIdpMetadata(alias = "#okta_idp_alias#", url="#okta_idp_url#"); // 新しい SAML ユーザーを追加 secCFC.setUser("saml_username", "", "", ["coldfusion.administrator","coldfusion.adminapi"], true, true, false, [],[],[], false, false, false, true, false); config = { idpName = "#okta_idp_alias#", spName = "#okta_sp_alias#", groupName = "#group_Name" } // 外部認証のタイプを SAML に設定し、ID プロバイダーの IdP、SP および groupName 属性名で構成される設定を渡す secCFC.setExternalAuthentication("Saml",config); // 追加された SAML 設定の詳細を取得 saml_config = secCFC.getAdminSamlConfig(); writeDump(saml_config); </cfscript>
LDAP
<cfscript> adminObj = CreateObject("component","CFIDE.adminapi.administrator"); adminObj.login("Adm1n$","admin") secCFC = CreateObject("component","CFIDE.adminapi.security") // LDAP 設定を追加 secCFC.setAdminLdapConfiguration(ads_ldap_host, ads_ldap_port, ads_ldap_userBaseContext, ads_ldap_groupBaseContext, ads_ldap_usernameAttr, ads_ldap_groupnameAttr, ads_ldap_timeout, ads_ldap_userConfig, ads_ldap_groupConfig, ads_ldap_userbindDN, ads_ldap_userbindPass, ads_ssl_enabled, ads_starttls); // LDAP 設定の詳細を取得 ldap_conf_details = secCFC.getAdminLdapConfiguration(); // 適切な役割を持つユーザーを追加 secCFC.setUser(ldap_admin_username, ldap_admin_password, "", ["coldfusion.administrator","coldfusion.adminapi"], true, true, false, [],[],[], false, false, true, false, false); // 外部認証のタイプを LDAP に設定 secCFC.setExternalAuthentication("ldap"); // 新しく追加された LDAP ユーザーを使用してログイン adminObj_new = CreateObject("component","CFIDE.adminapi.administrator"); if(adminObj_new.login(ldap_admin_password,ldap_admin_username)==true) writeOutput("Logged in User #ldap_admin_username1#"); // LDAP 設定を削除 secCFC.deleteLdapConfiguration(); </cfscript>
ID プロバイダーでアプリケーションを作成する際に追加される ACS URL は、次の形式にする必要があります。
<cfadmin_host>:<cfadmin_port>/CFIDE /administrator/saml/acs.cfm
SAML および LDAP をセットアップするための CFSetup コマンド
外部認証タイプとして SAML/LDAP を有効にするには、マルチユーザー認証タイプが有効になっている必要があります。また、SAML/LDAP の設定も存在する必要があります。
- cfsetup で samlconfig/ldapconfig の add コマンドを使用して、SAML/LDAP 設定を追加します。
- セキュリティカテゴリでは、他のパラメーターの中でも、adminAuthType を MULTIUSER に、externalAuth を SAML/LDAP にそれぞれ設定します。
SAML
設定の追加
- add samlconfig idpName=admin_login_idp spName=admin_login_sp groupName=groupName cfusion
設定の削除
- delete samlconfig default cfusion
設定の詳細の表示
- show samlconfig cfusion
設定の更新
- set samlconfig groupName=admin_login_idp idpName=admin_login_idp spName=admin_login_sp cfusion
設定の取得
- get samlconfig spName cfusion
設定の書き出し
- export samlconfig saml.json cfusion
設定の読み込み
- import samlconfig saml.json cfusion
LDAP
設定の追加
- add ldapconfig host=localhost port=10646 groupBaseContext="ou=Group,dc=example,dc=com" userBaseContext="ou=User,dc=example,dc=com" groupnameAttr=cn usernameAttr=cn timeout=6000 cfusion
設定の更新
- set ldapconfig host=localhost port=10389 groupBaseContext="ou=Group,dc=example,dc=com" userBaseContext="ou=User,dc=example,dc=com" usernameAttr=uid timeout=6000 cfusion
設定の取得
- get ldapconfig host cfusion
設定の削除
- delete ldapconfig default cfusion
設定の書き出し
- export ldapconfig ldap.json cfusion
設定の読み込み
- import ldapconfig ldap.json cfusion
ユーザー操作
ユーザーの表示
- show user user_name
ユーザーの更新
- set user isLdap=false
別のユーザーの追加
- add user=user2 isLdap=true isSaml=false isGroup=true
ユーザーの削除
- delete user user1
ユーザーの詳細情報の取得
- get user user_name isldap
ユーザーデータの書き出し
- export user user1details.json
ユーザーデータの読み込み
- import user userdetails.json