查看跟DN下的aci

  ldapsearch -h hostname -p port -D "cn=Directory Manager" -w - -b "BASE_DN" "(objectclass=*)" aci

Aci语法:

  aci: [list of (target)](version 3.0; acl "name";[list of "permission bindRules;"])

  参数说明:   

    target:可以使条目,属性,多个条目或者属性,可以通过filter进行匹配的条目和属性。该属性可选,如果没有指定,则针对子树(subtree)下所有条目。

    name:用于却分每个aci唯一标识,但是对名字没有限制。尽量保持aci名字的唯一性,不要重复。当不能确定aci是否生效可以通过Get Effective Rights查看,这时aci的名字就起作用了。

    permission:aci对应的可操作权限

    bindRules:指定那些条目具有使用该aci。

Aci targets语法

  (keyword = " expression")

  Keyword :可以使如下:target ,tartetattr,targetfilter,targettrfilters,targetscope
  expression:可以使用“=”和“!=” 但是当keyword是targettrfilters和targetscope时不能使用"!="
例如:
  (target = "ldap:///uid=bjensen,ou=People,dc=example,dc=com") :目标条目为uid=bjensen的条目的所有属性,
    使用如下filter均可匹配该条目
  (target= "ldap:///uid=bj*,ou=people,dc=example,dc=com")
  (target= "ldap:///uid=*,ou=people,dc=example,dc=com") 
  (target= "ldap:///*,ou=people,dc=example,dc=com")
  (target= "ldap:///uid=bjensen,*,dc=com")
  (target= "ldap:///uid=bjensen*")

Aci targetattr语法
  (targetattr = "attribute") or (targetattr != "attribute")
  如果targetattr没有出现则表示不匹配任何属性;如果要匹配所有属性需写:targetattr="*"
  匹配多个属性书写规则如下:
  (targetattr = "attribute1 || attribute2|| ... attributeN")
Aci targetfilter语法
  根据filter来搜索所有匹配的条目:(targetfilter = "(standard LDAP search filter)")
  例如:
  (targetfilter = "(|(status=contractor)(fulltime<=79))") :status=contractor并且filltime小于等于79的条目
Aci targattrfilters语法
  指定哪些属性的值可以被添加,删除,修改:(targattrfilters="add=attr1:F1 && attr2:F2... && attrn:Fn, del=attr1:F1 && attr2:F2 ... && attrn:Fn")
  参数说明:
  add
    添加属性值
  del
    删除属性值
  attrn
    替换或更新属性值
  Fn
    仅对关联的属性生效
Aci targetscope语法
  (targetscope="base")

  base
    aci仅作用于目标资源
  onelevel
    aci仅作用于目标资源和他的第一个子树
  subtree
    aci作用于目标资源和所有子树
  如果targetscope关键字没有指定,默认值为subtree。
Aci rights
  read ,write,add,delete,search,compare,selfwrite,proxy,import,export,All

Aci 示例

  1)允许匿名访问除userPassword之外的所有条目的属性:

    aci: (targetattr !="userPassword")(version 3.0; acl "Anonymous example"; allow (read, search, compare)userdn= "ldap:///anyone" ;)

  2) 允许自己修改自己的部分属性:

    aci: (targetattr="homePhone || homePostalAddress")(version 3.0; acl "Write Example.com"; allow (write) userdn="ldap:///self" ;)

  3)允许cn=HRGroup的组访问所有ou=People,dc=example,dc=cr下的所有条目(假设aci在ou=People,dc=example,dc=cr下):

    aci: (targetattr="*") (version 3.0; acl "HR"; allow (all)  groupdn= "ldap:///cn=HRgroup,ou=Groups,dc=example,dc=com";)

  4)允许ou=People下任何用户在ou=Social Committee,dc=example,dc=com下添加组(可以自己的需求更改objectClass对应的类,达到添加动态组和静态组):

    aci: (targetattr="*") (targattrfilters="add=objectClass:(|(objectClass=groupOfNames)(objectClass=top))")(version 3.0; acl "Create Group"; allow (read,search,add) userdn= "ldap:///uid=*,ou=People,dc=example,dc=com") and dns="*.Example.com";)

    从aci的权限可以看出,词条aci并没有赋予用户修改权限,即只能添加,不能修改

  5)允许组管理员修改,删除组操作ou=Social Committee,dc=example,dc=com下的组,假设该条aci在ou=Social Committee,dc=example,dc=com下:

    aci: (targetattr = "*") (targattrfilters="del=objectClass:(objectClass=groupOfNames)") (version 3.0; acl "Delete Group"; allow (write,delete) userattr="owner#GROUPDN";)

  6)允许用户自己修改自己的member属性,假设该aci添加在ou=Social Committee,dc=example,dc=com条目下:

    aci: (targettattr="member")(version 3.0; acl "Group Members"; allow (selfwrite) (userdn= "ldap:///uid=*,ou=People,dc=example,dc=com") ;)

  可以根据自己的需要做适当调整,来满足对用户权限的控制。

查看aci是否生效

  当完成一个aci的定义并把aci添加到对应的作用范围后,如果不确定aci是否生效可以使用view effective rights,使用ldapsearch命令可以查看对应的作用域下的所有条目该aci是否生效,操作命令如下:

  ldapsearch -J "1.3.6.1.4.1.42.2.27.9.5.2" -h host1.Example.com -p 389 -D "uid=Directory Manager" -w - -b "dc=example,dc=com" "(objectclass=*)" aclRights

  参数说明:  

    -J:默认值

    -D:使用搜索绑定的用户

    -b:base DN

  搜索结果类似如下:如果用户对条目没有操作权限,则不会显示出来。  

  dn: dc=example,dc=com
  aclRights;entryLevel: add:0,delete:0,read:1,write:0,proxy:0
  dn: ou=Groups, dc=example,dc=com
  aclRights;entryLevel: add:0,delete:0,read:1,write:0,proxy:0

  如果通中类型的aci较多,也可以使用宏匹配的方式进行。具体可以参考:docs.oracle.com/cd/E29127_01/doc.111170/e28972/ds-access-control.htm

  

  


 

ldap数据库--ODSEE--ACI的更多相关文章

  1. ldap数据库--ODSEE--suffix

    ldap数据库的suffix是建立ldap之间复制协议的基础,suffix的创建也可以通过管理界面进行,也可以通过命令行进行.不同点是通过管理界面创建的suffix会自动创建一条对应该suffix的匿 ...

  2. ldap数据库--ODSEE--安装

    在安装之前最好查看一下服务器硬件是否满足要求,是否需要更改一些系统配置来达到使用ldap数据库的最有性能.实际使用的ldap数据库是oracle的产品,DS70即ODSEE. 安装环境:solaris ...

  3. ldap数据库--ODSEE--复制协议

    简单介绍一下ODSEE的复制拓扑的建立,复制协议可以通过管理界面进行创建,也可以通过命令行创建.在此之前需要了解一些复制协议的相关概念,这里针对OESEE. 1,复制角色 master(提供者,也可以 ...

  4. ldap数据库--ldapsearch,ldapmodify

    简单介绍一下ldapsearch命令,在ldap搜索条目时很有用,只要适当调整filter就可以. 命令如下: ldapsearch -h hostname -p port -b baseDN -D ...

  5. ldap数据库--ODSEE--schema

    ldap服务器包含上百个对象类型(object class)和属性,这些对象类和属性都可以满足大部分需求,如果你想定义自己的schema,你只能继承扩展现有的schema进行操作. tip: 增加的新 ...

  6. ldap数据库--ODSEE--卸载

    针对ldap实例的卸载,即删除,可以通过管理界面进行操作也可以通过命令行进行操作.卸载顺序为ldap实例--agent--ads.这里主要介绍命令操作步骤 1,ldap实例卸载 从ads注销,即不在需 ...

  7. LDAP分布式数据库的介绍和安装使用

     目录服务 目录是一个为查询.浏览和搜索而优化的专业分布式数据库,它呈树状结构组织数据,就好象Linux/Unix系统中的文件目录一样.目录数据库和关系数据库不同,它有优异的读性能,但写性能差,并且没 ...

  8. LDAP介绍

    摘自: http://www.blogjava.net/allen-zhe/archive/2007/03/19/104740.html LDAP介绍 原文:http://ldapman.org/ar ...

  9. LDAP协议介绍

    LDAP协议基础概念  1. 从用途上阐述LDAP,它是一个存储静态相关信息的服务,适合"一次记录多次读取".经常使用LDAP服务存储的信息: 公司的物理设备信息(如打印机,它的I ...

随机推荐

  1. Springboot - 学习笔记 ②

    前言 这一篇是关于spring boot中的配置(configuration)的介绍,我们接下来要说的男主就是 “application.properties”. “男神”默认是生成在“/src/ma ...

  2. 705. New Distinct Substrings spoj(后缀数组求所有不同子串)

    705. New Distinct Substrings Problem code: SUBST1 Given a string, we need to find the total number o ...

  3. http://codeforces.com/contest/834

    A. The Useless Toy time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  4. EnCase missed some usb activities in the evidence files

    My friend is a developer and her colleague May was suspected of stealing the source code of an impor ...

  5. OpenVPN CentOS7 安装部署配置详解

    一 .概念相关 1.vpn 介绍 vpn 虚拟专用网络,是依靠isp和其他的nsp,在公共网络中建立专用的数据通信网络的技术.在vpn中任意两点之间的链接并没有传统的专网所需的端到端的物理链路,而是利 ...

  6. Ansible(三) - playbook简介

    Ⅰ. Playbook介绍 Playbook其实就是ansible的一个任务列表,各任务按次序逐个在hosts中指定的所有主机上执行,即在所有主机上完成第一个任务后再开始第二个.在顺序运行某playb ...

  7. 最常用前端框架BootStrap——栅格系统

      前  言   Bootstrap 提供了一套响应式.移动设备优先的流式栅格系统,随着屏幕或视口(viewport)尺寸的增加,系统会自动分为最多12列.它包含了易于使用的预定义类,还有强大的mix ...

  8. dos攻击命令

    net user //查看有哪些用户 net start //查看开启了哪些服务项目 net send ip "文本信息" //向对方发送消息(如果对方关了信使有可能会收不到) n ...

  9. IDL 存储数组

    IDL中的数组在内存中是按行存储的,这是因为IDL最初设计的设计目的是用来处理行扫描卫星数据. 1.一维数组 m个元素的一维数组arr[m]的存储方式为 arr[0]→arr[1]→...→arr[m ...

  10. 如何在Windows系统中配置Mysql群集(Mysql Cluster)

    MySQL群集技术在分布式系统中为MySQL数据提供了冗余特性,增强了安全性,使得单个MySQL服务器故障不会对系统产生巨大的负面效应,系统的稳定性得到保障. Mysql群集(Cluster)简介 M ...