Openldap slapd.conf

slapd.conf
負責slapd,slurpd,slap系列工具的組態資訊

………….
#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
以下是全域區段參數

引用schema
include /usr/local/etc/openldap/schema/core.schema

設定log等級
loglevel 296 //此值表示8(連線管理),32(搜尋過濾器處理過程),256(連線操作及結果的統計)

設定pid和args file
pidfile /usr/local/var/slapd.pid
argsfile /usr/local/var/slapd.args

設定sasl的選項
sasl-host
sasl-realm
sasl=secprops

設定tls的選項
TLSCipherSuite
TLSCertificateFile
TLSCertifateKeyFile

…….

其他安全相關選項
security //指定一般的安全強度因子

require value
value有以下
none
authc
bind
LDAPv3
SASL
strong

allow value
啟用特定的安全特性,value有以下
none 預設值
tls_2_anon 允許tls強迫目前的session進入匿名狀態

disallow value
停用特定的安全特性,value有以下
bind_v2 停用ldap2連結
bind_anon 停用匿名連結
bind_anon_cred dn空白則停用匿名連結
bind_anon_dn dn非空白則停用匿名連結
bind_simple 停用簡易連結
bind_krbv4 停用kerberos4連結
bind_authc 用戶端經認證,則停用starttls

password-hash //指定屬性userpassword的預定密碼加密機制


#######################################################################
# database definitions
#######################################################################
以下是資料庫區段參數

設定資料庫,可選擇以下
bdb 效能較好,建議使用
ldbm 較舊版的bdb
passwd
shell 使用外部資料庫
ex:
database bdb

設定root suffix(根尾碼)
suffix “dc=study,dc=net”

設定superuser
rootdn “cn=manager,dc=study,dc=net”
rootpw

更新相關參數
lastmod
readonly

bdb資料庫專屬參數
directory /var/ldap/study.net //設定資料庫檔案的目錄
mode 0600 //設定資料庫檔案權限為0600
cachesize 3000 //資料庫調校參數

設定索引維護用參數
格式為
index 屬性 索引類型
索引類型有以下
approx 近似比對
eq 精確比對
pres 存在比對
sub 子字串比對
ex:
index objectClass eq //此設定可提升效能
index uid pres,eq
index uidNumber pres,eq
index gidNumber pres,eq


########################################
# permissions
#######################################

acl參數如下

設定acl用的格式
access to 對象
by 使用者 存取等級
ex:
access to *
by self write
by dn=”cn=Manager,dc=systw,dc=net” write
by * read

沒有指定acl時,預設存取等級,格式為
defaultaccess 存取等級
ex:
defaultaccess read

使用者有以下5種形式
* 所有使用者
self 己連線的使用者
anonymous 未經認證的使用者
users 經認證的使用者
RE(regular expression,正規表示法) 用RE指定的使用者

存取等級有以下形式
write 可更新
read 可讀取
search 可使用搜尋過濾器
compare 可比對屬性
auth 可進行認證
none 無法存取
ps:高層存取等級會擁有低層次存取等級的能力

對象有以下形式
RE,格式為dn.targestyle=regex
搜尋過濾器,格式為filter=ldapfilter
屬性名稱清單,格式為attrs=attributelist