Sun Java System Directory Server Enterprise Edition 6.3 管理指南

创建和配置请求过滤策略和搜索数据隐藏规则

有关请求过滤策略的概述,请参见《Sun Java System Directory Server Enterprise Edition 6.3 Reference》中的“Request Filtering Policies for Connection Handlers”。有关搜索数据隐藏规则的概述,请参见《Sun Java System Directory Server Enterprise Edition 6.3 Reference》中的“Search Data Hiding Rules in the Request Filtering Policy”

有关如何创建和配置请求过滤策略和搜索数据隐藏规则的信息,请参见以下过程。

Procedure创建请求过滤策略

可使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。

  1. 创建请求过滤策略。


    $ dpconf create-request-filtering-policy policy-name
    
  2. 将请求过滤策略与某个连接处理程序关联。


    $ dpconf set-connection-handler-prop -h host -p port connection-handler-name \
     request-filtering-policy:policy-name
    

Procedure配置请求过滤策略

可使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。

  1. 查看请求过滤策略的属性。


    $ dpconf get-request-filtering-policy-prop -h host -p port policy-name
    

    请求过滤策略的默认属性如下所示:


    allow-add-operations                :  true
    allow-bind-operations               :  true
    allow-compare-operations            :  true
    allow-delete-operations             :  true
    allow-extended-operations           :  true
    allow-inequality-search-operations  :  true
    allow-modify-operations             :  true
    allow-rename-operations             :  true
    allow-search-operations             :  true
    allowed-comparable-attrs            :  all
    allowed-search-scopes               :  base
    allowed-search-scopes               :  one-level
    allowed-search-scopes               :  subtree
    allowed-subtrees                    :  ""
    description                         :  -
    prohibited-comparable-attrs         :  none
    prohibited-subtrees                 :  none
  2. 通过设置步骤 1 中列出的一个或多个属性来配置请求过滤策略。


    $ dpconf set-request-filtering-policy-prop -h host -p port policy-name \
      property:value [property:value ...]

    通过设置步骤 1 中列出的属性,可以配置请求过滤策略的以下功能:

    • 允许客户端执行的操作类型

    • 对客户端公开或隐藏的子树

    • 搜索操作的范围

    • 搜索过滤器的类型

    • 可以或无法在搜索和比较操作中进行比较的属性类型

Procedure创建搜索数据隐藏规则

可使用 DSCC 执行此任务。有关信息,请参见目录服务控制中心界面和 DSCC 联机帮助。

  1. 为请求过滤策略创建一个或多个搜索数据隐藏规则。


    $ dpconf create-search-data-hiding-rule -h host -p port policy-name rule-name \
     [rule-name ...]
  2. 查看搜索数据隐藏规则的属性。


    $ dpconf get-search-data-hiding-rule-prop policy-name rule-name
    

    搜索数据隐藏规则的默认属性如下所示:


    attrs                              :  -
    rule-action                        :  hide-entry
    target-attr-value-assertions       :  -
    target-dn-regular-expressions      :  -
    target-dns                         :  -
  3. 通过设置步骤 2 中列出的一个或多个属性来配置搜索数据隐藏规则。


    $ dpconf set-search-data-hiding-rule-prop -h host -p port policy-name rule-name \
      property:value [property:value ...]

    可以使用以下规则操作之一:

    hide-entry

    不返回目标条目。

    hide-attributes

    返回目标条目,但过滤掉指定的属性。

    show-attributes

    返回目标条目,但过滤掉未指定的属性。

    此规则可应用于以下条目:

    target-dns

    具有指定 DN 的条目

    target-dn-regular-expressions

    具有指定 DN 模式的条目

    target-attr-value-assertions

    具有指定属性名称和属性值对 (attrName#attrValue) 的条目

    以下配置定义了用于隐藏 inetorgperson 类型条目的搜索数据隐藏规则。


    $ dpconf set-search-data-hiding-rule-prop -h host1 -p port my-policy my-rule \
      target-attr-value-assertions:objectclass#inetorgperson

请求过滤策略和搜索数据隐藏规则的示例

以下示例包含请求过滤策略和搜索数据隐藏规则。当请求过滤策略与搜索数据隐藏规则相结合时,将限制对数据的访问,如下所示:


示例 26–1 请求过滤策略的样例


allow-add-operations                :  false
allow-bind-operations               :  true
allow-compare-operations            :  true
allow-delete-operations             :  false
allow-extended-operations           :  false
allow-inequality-search-operations  :  true
allow-modify-operations             :  false
allow-rename-operations             :  false
allow-search-operations             :  true
allowed-comparable-attrs            :  all
allowed-search-scopes               :  base
allowed-search-scopes               :  one-level
allowed-search-scopes               :  subtree
allowed-subtrees                    :  ou=people,dc=sun,dc=com
description                         :  myRequestFilteringPolicy
prohibited-comparable-attrs         :  none
prohibited-subtrees                 :  none


示例 26–2 搜索数据隐藏规则的样例


attrs                              :  -
rule-action                        :  hide-entry
target-attr-value-assertions       :  objectclass:inetorgperson
target-dn-regular-expressions      :  -
target-dns                         :  -