web2ldapを使ってみよう

2015-12-18

OpenLDAP と仲間たち Advent Calendar 2015 18日目。

最近web2ldapというWEBインターフェースのLDAP管理ツールができたらしいです。 さっそく試してみましょう。

セットアップ

# apt-get install libldap2-dev
$ pip install python-ldap ipaddr pyasn1 pyasn1_modules pyweblib
$ wget http://www.web2ldap.de/download/web2ldap-1.2.44.tar.gz
$ tar xf web2ldap-1.2.44.tar.gz
$ cd web2ldap-1.2.44

実行

$ python ./sbin/web2ldap.py -d off

WARNING: Importing local config failed: No module named local
WARNING: Registering attribute type '1.3.6.1.1.1.1.0' with syntax 'AutogenUIDNumber-oid' overrides existing registration with syntax {None: 'UidNumber-oid'}
WARNING: Registering attribute type '1.3.6.1.1.1.1.1' with syntax 'AutogenGIDNumber-oid' overrides existing registration with syntax {None: 'GidNumber-oid'}
Read MIME-type mapping from file /etc/mime.types.
2015-12-17 17:50:11 Started multi-threaded web server on localhost:1760 with SSL disabled
Accepted IP address ranges: [IPv4Network('127.0.0.0/8'), IPv6Network('::1/128'), IPv6Network('fe00::/128')]

Point your favourite browser to

http://localhost:1760/web2ldap

to access the web application.

http://localhost:1760/web2ldap にアクセスすると…

  • 初期ページ

  • 接続後

動いている様子。

しかし頻繁に「Session hijacking detected. Access denied!」と表示されてログアウトしてしまう問題が発生するので、よくわからないけどCookieのチェックを外してみると正常に動作した。

diff --git a/pylib/w2lapp/handler.py b/pylib/w2lapp/handler.py
index dd25d03..ee63dee 100644
--- a/pylib/w2lapp/handler.py
+++ b/pylib/w2lapp/handler.py
@@ -335,8 +335,8 @@ class AppHandler:
if ls.cookie:
# Check whether HTTP_COOKIE contains the cookie of this particular session
cookie_name = ''.join((self.form.cookie_name_prefix,str(id(ls))))
-            if not (cookie_name in self.form.cookies and ls.cookie[cookie_name].value==self.form.cookies[cookie_name].value):
-              raise w2lapp.session.WrongSessionCookie()
+#            if not (cookie_name in self.form.cookies and ls.cookie[cookie_name].value==self.form.cookies[cookie_name].value):
+#              raise w2lapp.session.WrongSessionCookie()
if w2lapp.cnf.misc.session_paranoid and \
current_access_time-last_session_timestamp>w2lapp.cnf.misc.session_paranoid:
# Store session with new session ID
  • ツリー表示

  • ユーザーエントリーの表示

Recent Entries

マイナちゃんピオンシップ・かがわ 2022 参加レポ

認証器としてのキーボード

Using LDAP directory for FIDO 2.0

パスポートのセキュリティ

55億円詐欺と本人確認

マイナンバーカードでPAM認証

マイナンバーカードでmacOSにログイン

マイナンバーカードでSSHする

Python Flaskでつくる LDAPログインページ

GitHub EnterpriseとLDAPで認証連携する

Hot Entries