2008 Tokyo/Spring OSC 2



Similar documents
Microsoft PowerPoint - OSC2009_Tokyo_Fall_1030.ppt

Dec , IS p. 1/60

Fedora Directory Server / Sun Java System Directory Server

LDAP - LDAP OpenLDAP - postfix qpopper - LDAP heartbeat mon

Microsoft PowerPoint - OSC2010_Tokyo_Spring.ppt

OpenLDAPの最新動向

<Documents Title Here>

WindowsでLDAP運用のこつ

RTX830 取扱説明書

Oracle Application Server 10g( )インストール手順書

SRT/RTX/RT設定例集

"CAS を利用した Single Sign On 環境の構築"

I j

設定例集_Rev.8.03, Rev.9.00, Rev.10.01対応

ワイヤレス~イーサネットレシーバー UWTC-REC3

RouteMagic Controller RMC-MP200 / MP Version

fx-9860G Manager PLUS_J

¥Í¥Ã¥È¥ï¡¼¥¯¥×¥í¥°¥é¥ß¥ó¥°ÆÃÏÀ

untitled

RouteMagic Controller RMC-MP200 / MP Version

帯域を測ってみよう (適応型QoS/QoS連携/帯域検出機能)

GM-F520S/GM-F470S/GM-F420S

リング型IPカメラ監視ソリューション(マルチキャスト編)

INR-HG5579a_Netshut_Guide_Linux-Solaris_.doc

Oracle Application Server 10g(9

アライドテレシス ディストリビューション・スイッチ AT-x600シリーズで実現するMicrosoft® NAP

リング型IPカメラ監視ソリューション

RouteMagic Controller( RMC ) 3.6 RMC RouteMagic RouteMagic Controller RouteMagic Controller MP1200 / MP200 Version 3.6 RouteMagic Controller Version 3



SLAMD導入手順

<Documents Title Here>

I TCP 1/2 1

VNX for Fileでの監査ツールの構成および使用

"CAS を利用した Single Sign On 環境の構築"

MOTIF XF 取扱説明書

Microsoft PowerPoint v01_L3seminor.ppt

UsersGuide_INR-HG5497c_.doc

ScreenOS 5.0 ScreenOS 5.0 Deep Inspection VLAN NetScreen-25/-50/-204/-208 HA NetScreen-25 HA Lite NetScreen-25 NetScreen-50) ALG(Application Layer Gat

<Documents Title Here>

~~~~~~~~~~~~~~~~~~ wait Call CPU time 1, latch: library cache 7, latch: library cache lock 4, job scheduler co

untitled

Packet Tracer: 拡張 ACL の設定 : シナリオ 1 トポロジ アドレステーブル R1 デバイスインターフェイス IP アドレスサブネットマスクデフォルトゲートウェイ G0/ N/A G0/

TM-m30 詳細取扱説明書

CG-SSW indb

owners.book

Jlspec

FS900S_B

RT300/140/105シリーズ 取扱説明書

2

TM-m30 詳細取扱説明書

Express5800/320Fc-MR

TM-m30 詳細取扱説明書

グローバル タイトル変換テーブルの編集

Express5800/R110a-1Hユーザーズガイド

Mac OS X Server Windows NTからの移行

e164.arpa DNSSEC Version JPRS JPRS e164.arpa DNSSEC DNSSEC DNS DNSSEC (DNSSEC ) DNSSEC DNSSEC DNS ( ) % # (root)

HA8000シリーズ ユーザーズガイド ~BIOS編~ HA8000/RS110/TS10 2013年6月~モデル

ODBC ドライバ ここでは SLAPD-SQL の設定で ODBC ドライバとして unixodbc を利用する例を示す unixodbc は にあり Linux でも使える ここでは unixodbc ドライバがインストールされていることを前提に

Teradici Corporation # Canada Way, Burnaby, BC V5G 4X8 Canada p f Teradici Corporation Teradi

Compatibility list: vTESTstudio/CANoe

FUJITSU ULTRA LVD SCSI Host Bus Adapter Driver 3.0 説明書

RT300i/RT140x/RT105i 取扱説明書

Microsoft Word - Meta70_Preferences.doc

DocuWide 2051/2051MF 補足説明書

自動シャットタ<3099>ウンクイックインストールカ<3099>イト<3099>.indb

WIDE 1

PRIMERGY BX900 S1 シャーシ 環境設定シート

SRX IDP Full IDP Stateful Inspection 8 Detection mechanisms including Stateful Signatures and Protocol Anomalies Reassemble, normalize, eliminate ambi

TM-T88VI 詳細取扱説明書

untitled

GA-1190J

SR-X324T1/316T1 サーバ収容スイッチ ご利用にあたって

コンピュータ概論

ES1018V2_24V2_MG.book

FileMaker Server 8 Administrator’s Guide

Epson Print Admin

<Documents Title Here>

untitled

Northern Lights Server

2008

!!!!!

dvi

Express5800/320Fa-L/320Fa-LR/320Fa-M/320Fa-MR

HA8000-bdシリーズ RAID設定ガイド HA8000-bd/BD10X2

fuzzing

rndc BIND DNS 設定 仕組み

ŠŸŠp”Ò„ü‡¯†E1

A : kerl kerl Erlang/OTP Erlang/OTP 2 2 Elixir/Phoenix URL 2 PDF A.2 Bash macos.bash_profile exp

SR-X324T2/316T2 サーバ収容スイッチ ご利用にあたって

nakayama15icm01_l7filter.pptx

Express5800/R320a-E4/Express5800/R320b-M4ユーザーズガイド

5. sendmail.cf

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb

ksocket Documentation

NEC Storage series NAS Device

Si-R180 ご利用にあたって

Ver.1 1/17/2003 2

ヤマハ ルーター ファイアウォール機能~説明資料~

XMLアクセス機能説明書

Transcription:

2009 Tokyo/Spring OpenLDAP LDAP 1

2008 Tokyo/Spring OSC 2

LDAP? 3

LDAP LDAP 4

LDAP LDAP 5

? 6

7

OpenLDAP - Cent OS 5.x - OpenLDAP 2.4.x 8

OpenLDAP loglevel 256 ( ) loglevel 256 ( ) Accept close BIND BIND RESULT Case 1: SRCH SEARCH RESULT Case 2: (ADD/MOD slapd.conf) Case 3: Case 4: 9

Case 1: Case 2: Case 3: Case 4: 10

OpenLDAP loglevel 256 ( ) loglevel 256 ( ) Accept close BIND BIND RESULT Case 1: SRCH SEARCH RESULT Case 2: (ADD/MOD slapd.conf) Case 3: Case 4: 11

OpenLDAP -Syslog -Access_log overlay 12

Step 1. OpenLDAP LOCAL4 Syslog LOCAL4 # vi /etc/syslog.conf [ ] local4.* [ ] /var/log/ldap.log Syslog 13

Step 2. ( ) # vi slapd.conf include [ ] loglevel 256 [ ] loglevel 256(0x100 stats) DB Slapd 14

( ) Level (10 ) -1 0 1 2 4 8 16 32 Level (16 ) 0x0 0x1 0x2 0x4 0x8 0x10 0x20 Level ( ) any trace packet args conns BER filter enable all debugging no debugging trace function calls debug packet handling heavy trace debugging (function args) connection management print out packets sent and received search filter processing 15

( ) (2) Level (10 ) 64 128 256 512 1024 2048 16384 32768 Level (16 ) 0 40 0x80 0x100 0x200 0x400 0x800 0x4000 0x8000 Level ( ) config ACL stats stats2 shell parse sync none configuration file processing access control list processing stats log connections/operations/results stats log entries sent print communication with shell backends entry parsing LDAPSync replication only messages that get logged whatever log level is set 16

loglevel 2 1: 10 16 2: 10 16 loglevel 129 loglevel 0x81 loglevel 128 1 loglevel 0x80 0x1 loglevel acl trace loglevel 129 17

: ( ) Disk Battery Back Write Cache / (DiskI/O ) # time ldapsearch -x OpenLDAP localhost 24 loglevel 1 loglevel 1 loglevel 256 Syslog 80.601(sec) 0.647(sec) 0.151(sec) loglevel 256 0.133(sec) 18

: (2) ( ) syslog # vi /etc/syslog.conf mail.* -/var/log/maillog [ ] local4.* -/var/log/ldap.log 19

OpenLDAP loglevel 256 ( ) loglevel 256 ( ) Accept close BIND BIND RESULT Case 1: SRCH SEARCH RESULT Case 2: (ADD/MOD slapd.conf) Case 3: Case 4: 20

loglevel 256 ( ) OpenLDAP (loglevel 256) LDAP 21

loglevel 256 ldapsearch ldapsearch -x -D DN -w passwd filter attr # ldapsearch -x -D uid=test1001,ou=people,dc=my-domain,dc=com -w 3edcvfr4 uid=test1001 dn -LLL dn: uid=test1001,ou=people,dc=my-domain,dc=com tail -f /var/log/ldap.log Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 fd=13 ACCEPT from IP=127.0.0.1:38379 (IP=0.0.0.0:389) Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=0 BIND dn="uid=test1001,ou=people,dc=my-domain,dc=com" method=128 Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=0 BIND dn="uid=test1001,ou=people,dc=my-domain,dc=com" mech=simple ssf=0 Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=0 RESULT tag=97 err=0 text= Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=1 SRCH base="dc=my-domain,dc=com" scope=2 deref=0 filter="(uid=test1001)" Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=1 SRCH attr=dn Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text= Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=2 UNBIND Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 fd=13 closed 22

Step 1. ) Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 fd=13 ACCEPT Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=0 BIND Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=0 BIND Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=0 RESULT Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=1 SRCH Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=1 SRCH Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=1 SEARCH RESULT Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 op=2 UNBIND Feb 14 04:39:44 CentOSa slapd[9733]: conn=5 fd=13 closed conn# (connection conn# op# (operation ) 23

Step 1. ldapsearch OpenLDAP server conn=5 BIND( ) BIND( ) UNBIND op=0 op=1 op=2 24

Step 2. fd=13 ACCEPT from IP=127.0.0.1:38379 (IP=0.0.0.0:389) op=0 BIND dn="uid=test1001,ou=people,dc=my-domain,dc=com" method=128 op=0 BIND dn="uid=test1001,ou=people,dc=my-domain,dc=com" mech=simple ssf=0 op=0 RESULT tag=97 err=0 text= op=1 SRCH base="dc=my-domain,dc=com" scope=2 deref=0 filter="(uid=test1001)" op=1 SRCH attr=dn op=1 SEARCH RESULT tag=101 err=0 nentries=1 text= op=2 UNBIND fd=13 closed 25

Step 2. ldapsearch OpenLDAP server DN=test1001 op=0 conn=5 DN sub op=1 1 UNBIND op=2 26

- statslog 27

statslog contrib/slapd-tools perl loglevel 256 (stats) # # cd openldap-2.4.xx/contrib/slapd-tools #./statslog --usage 28

statslog (2) ) 2 TLS # cd openldap-2.4.xx/contrib/slapd-tools #./statslog -i ^Feb.*err=49 -i TLS /var/log/ldap.log Feb 7 00:28:51 CentOSa slapd[7376]: conn=3 fd=15 ACCEPT from IP=127.0.0.1:52996 (IP=0.0.0.0:636) Feb 7 00:28:52 CentOSa slapd[7376]: conn=3 fd=15 TLS established tls_ssf=256 ssf=256 Feb 7 00:28:52 CentOSa slapd[7376]: conn=3 op=0 BIND dn="cn=manager,dc=my-domain1,dc=com" method=128 Feb 7 00:28:52 CentOSa slapd[7376]: send_ldap_result: conn=3 op=0 p=3 Feb 7 00:28:52 CentOSa slapd[7376]: conn=3 op=0 RESULT tag=97 err=49 text= Feb 7 00:28:52 CentOSa slapd[7376]: connection_closing: readying conn=3 sd=15 for close Feb 7 00:28:53 CentOSa slapd[7376]: conn=3 fd=15 closed (connection lost) Feb 14 05:57:14 CentOSa slapd[9978]: conn=0 fd=15 ACCEPT from IP=127.0.0.1:50294 (IP=0.0.0.0:636) Feb 14 05:57:14 CentOSa slapd[9978]: conn=0 fd=15 TLS established tls_ssf=256 ssf=256 Feb 14 05:57:14 CentOSa slapd[9978]: conn=0 op=0 BIND dn="uid=test1001,ou=people,dc=my-domain,dc=com" method=128 Feb 14 05:57:14 CentOSa slapd[9978]: conn=0 op=0 RESULT tag=97 err=49 text= Feb 14 05:57:14 CentOSa slapd[9978]: conn=0 fd=15 closed (connection lost) 29

OpenLDAP loglevel 256 ( ) loglevel 256 ( ) Accept close BIND BIND RESULT Case 1: SRCH SEARCH RESULT Case 2: (ADD/MOD slapd.conf) Case 3: Case 4: 30

loglevel 256 ( ) 1 3 -Case 1: -Case 2: -Case 3: 31

ACCEPT close 32

ACCEPT close ldapsearch OpenLDAP server conn=5 BIND( ) BIND( ) UNBIND op=0 op=1 op=2 33

ACCEPT close fd=13 ACCEPT from IP=127.0.0.1:38379 (IP=0.0.0.0:389) File Descriptor# fd=13 closed Socket IP Port# IP Port# close SSL / TLS #636 fd=14 ACCEPT from IP=127.0.0.1:38379 (IP=0.0.0.0:636) fd=14 TLS established tls_ssf=256 ssf=256 34

syslog slapd tcpdump lsof fuser netstat /var/log/messages TCP Wrappers SSL/TLS 35

BIND BIND RESULT 36

BIND BIND RESULT ldapsearch OpenLDAP server BIND( ) BIND( ) op=0 conn=5 UNBIND op=1 op=2 37

BIND BIND dn="uid=test1001,ou=people,dc=my-domain,dc=com" method=128 BIND( ) DN dn= " " BIND( ) 128= / 163=SASL BIND dn="uid=test1001,ou=people,dc=my-domain,dc=com" mech=simple ssf=0 SASL DIGEST-MD5 / CRAM-MD5 / SIMPLE Security Strength Factors ( ) 0 SASL mech=digest-md5 sasl_ssf=128 ssf=128 38

BIND RESULT RESULT tag=97 err=0 text= (2) # ( : include/ldap.h) 0 (0x0) = (Success ) ( : include/ldap.h) BIND REQUEST=96 (0x60) BIND RESULT=97 (0x61) SEARCH REQUEST=99 (0x63) SEARCH RESULT=101 (0x65) 49 (0x31) = Invalid credentials 49 BIND # DN ACL 39

Case 1: = (49) Invalid credentials? 40

DN(ID) (BIND) DN(ID) stats BIND (BIND) ACL (anonymous) (auth) acl BIND 41

loglevel acl stats ACL access to userpassword by self write (auth) : access_allowed: no res from state (userpassword) : => acl_mask: access to entry "uid=test1009,ou=people,dc=my-domain,dc=com", attr "userpassword" requested : => acl_mask: to value by "", (=0) : <= check a_dn_pat: self : <= acl_mask: no more <who> clauses, returning =0 (stop) : => access_allowed: auth access denied by =0 : conn=0 op=0 RESULT tag=97 err=49 text= : conn=0 fd=15 closed (connection lost) 42

loglevel acl stats (2) ACL OK NG access to userpassword by self write by anonymous auth (auth) : access_allowed: no res from state (userpassword) : => acl_mask: access to entry "uid=test1009,ou=people,dc=my-domain,dc=com", attr "userpassword" requested : => acl_mask: to value by "", (=0) : <= check a_dn_pat: self : <= check a_dn_pat: anonymous : <= acl_mask: [2] applying auth(=xd) (stop) : <= acl_mask: [2] mask: auth(=xd) : => access_allowed: auth access granted by auth(=xd) : conn=3 op=0 RESULT tag=97 err=49 text= 43

loglevel acl stats (3) ACL OK access to userpassword by self write by anonymous auth (auth) access_allowed: no res from state (userpassword) : => acl_mask: access to entry "uid=test1009,ou=people,dc=my-domain,dc=com", attr "userpassword" requested : => acl_mask: to value by "", (=0) : <= check a_dn_pat: self : <= check a_dn_pat: anonymous : <= acl_mask: [2] applying auth(=xd) (stop) : <= acl_mask: [2] mask: auth(=xd) : => access_allowed: auth access granted by auth(=xd) : conn=4 op=0 BIND dn="uid=test1009,ou=people,dc=my-domain,dc=com" mech=simple ssf=0 : conn=4 op=0 RESULT tag=97 err=0 text= 44

- slapacl 45

slapacl slapacl ACL slapd.conf access to ACL OpenLDAP # slapacl -b "uid=test1003,ou=people,dc=my-domain,dc=com" > "userpassword/auth" -d acl [ ] <= check a_dn_pat: anonymous [ ] => access_allowed: auth access granted by auth(=xd) auth access to userpassword: ALLOWED 46

SRCH SEARCH RESULT 47

SRCH SEARCH RESULT ldapsearch OpenLDAP server conn=5 BIND( ) BIND( ) UNBIND op=0 op=1 op=2 48

SRCH SRCH base="dc=my-domain,dc=com" scope=2 deref=0 filter="(uid=test1001)" alias 0 : base ( ) 1 : one ( 1 ) 2 : sub ( ) 3 : children ( ) SRCH attr=dn attr=+ 49

(2) SEARCH RESULT SEARCH RESULT tag=101 err=0 nentries=1 text= ( : include/ldap.h) BIND REQUEST=96 (0x60) # ( : include/ldap.h libraries/libldap/error.c) BIND RESULT=97 (0x61) 0 (0x0) = Success SEARCH REQUEST=99 (0x63) 4 (0x04) = Size limit exceeded SEARCH RESULT=101 (0x65) 32 (0x20) = No such object 50

Case 2: - - (3) Time Limit Exceeded? (4) Size Limit Exceeded? (32) No Such Object? 51

# http://www.openldap.org/doc/admin24/appendix-ldap-result-codes.html http://tools.ietf.org/html/rfc4511#section-4.1.9 ldapsearch /etc/openldap/ldap.conf ldapsearch OpenLDAP /etc/ldap.conf nss_ldap pam_ldap 52

- ldapsearch -d <#> - getent 53

LDAP debug OpenLDAP Level (10 ) -1 0 1 2 4 8 16 32 Level (16 ) 0x0 0x1 0x2 0x4 0x8 0x10 0x20 Level ( ) any trace packet args conns BER filter LIBRARY / SERVER enable all debugging no debugging trace function calls debug packet handling LIBRARY / SERVER LIBRARY / SERVER heavy trace debugging (function LIBRARY / SERVER args) connection LIBRARY management / SERVER print out packets sent and LIBRARY / SERVER received SERVER ONLY search filter processing 54

LDAP debug(2) OpenLDAP Level (10 ) 64 128 256 512 1024 2048 16384 32768 Level (16 ) 0 40 0x80 0x100 0x200 0x400 0x800 0x4000 0x8000 Level ( ) config ACL stats stats2 shell parse sync none SERVER ONLY configuration file processing SERVER ONLY access control list processing stats log connections/operations/results SERVER ONLY stats log entries sent SERVER ONLY print communication with shell SERVER backends ONLY entry parsing LDAPSync replication LIBRARY / SERVER SERVER ONLY only messages that get logged whatever LIBRARY log level / is SERVER set 55

LDAP debug ldapsearch debug -d 1 OpenLDAP slapd.conf loglevel OpenLDAP OpenLDAP -d ldapsearch OpenLDAP LIBRARY 56

NSS PAM debug nss_ldap pam_ldap /etc/ldap.conf debug 1 nss_ldap OpenLDAP LIBRARY # getent passwd test1001 2>/tmp/nss_ldap_debug.log test1001:x:1001:1001:test1001:/home/test1001:/bin/bash # less /tmp/nss_ldap_debug.log [ ] ldap_connect_to_host: Trying 127.0.0.1:389 [ ] put_filter: "(&(objectclass=posixaccount)(uid=test1001))" 57

Case 3: - - (21) Invalid Syntax? (68) Entry Already Exists? (80) Internal ( ) error? 58

( ) # http://www.openldap.org/doc/admin24/appendix-ldap-result-codes.html http://tools.ietf.org/html/rfc4511#section-4.1.9 OpenLDAP FAQ Common Errors http://www.openldap.org/faq/data/cache/53.html LDAP 59

Case 4: 60

slapd.conf OpenLDAP sldap.conf # 61

- slaptest -d 64 - slurpd -d 64 62

slaptest slaptest slapd.conf slapd.conf OpenLDAP OpenLDAP # slaptest -f./etc/openldap/slapd.conf -d 64 reading config file./etc/openldap/slapd.conf line 5 (include /usr/local/openldap-2.4.11/etc/openldap/schema/core.schema) reading config file /usr/local/openldap-2.4.11/etc/openldap/schema/core.schema...[ ]... line 84 (rootdn "cn=manager,dc=my-domain,dc=com") line 88 (rootpw ***)...[ ]... config file testing succeeded 63

slurpd -d 64(OpenLDAP2.3 ) slurpd -d 64 slapd.conf slurpd slapd.conf slurpd slaptest -d 64 slurpd -d 64 # slurpd -d 64 -o -r /tmp/none-exsiting-files Config: (replogfile /var/lib/ldap/openldap-master-replog) Config: (replica host=ldap-1.example.com:389 starttls=critical bindmethod=sasl saslmech=gssapi authcid=host/ldapmaster.example.com@example.com) Config: ** successfully added replica "ldap-1.example.com:389" Config: ** configuration file successfully read and parsed Processing in one-shot mode: 0 total replication records in file, 0 replication records to process. slurpd: terminated. 64

OpenLDAP loglevel 256 ( ) loglevel 256 ( ) Accept close BIND BIND RESULT Case 1: SRCH SEARCH RESULT Case 2: (ADD/MOD slapd.conf) Case 3: Case 4: 65

Administrator's Guide 22. Troubleshooting http://www.openldap.org/doc/admin24/troubleshooting.html OpenLDAP Faq-O-Matic http://www.openldap.org/faq/data/cache/1.html Issue Tracking System http://www.openldap.org/its/ Change Log http://www.openldap.org/software/release/changes.html Release Road Map http://www.openldap.org/software/roadmap.html Project Overview http://www.openldap.org/project/ 66

OpenLDAP http://www.openldap.org/lists/#archives OpenLDAP-announce OpenLDAP-bugs OpenLDAP-commit OpenLDAP-devel OpenLDAP-software OpenLDAP-technical LDAP http://ml.ldap.jp/mailman/listinfo/ldap-users 67

- - - Berkeley DB - 68

OpenLDAP 69

70