如何集成 Oracle Label Security 与 Oracle Internet Directory

方法文档

如何集成 Oracle Label Security 与 Oracle Internet Directory

日期:2005 年 10 月 28 日

简介

Oracle Identity Management 的核心是集成了 Oracle Label Security 与 Oracle Internet Directory,这样可以整合集中式用户管理与基于标签的访问控制的效率,从而以较低的成本增强了安全性。

前提条件:

  1. 安装 Oracle Application Server 10g (10.1.2.),包括 Identity Management 选项
  2. 安装 Oracle 数据库 10g
  3. 安装 Oracle Label Security
  4. 使用 Oracle Label Security
  5. 企业用户安全性设置

将您的意见发送给我们

配置 Oracle Label Security 以使用 Oracle Internet Directory:

如果您的数据库中已经以‘独立’模式安装了 Oracle Label Security,则不能将其转换为与 OID 集成。您需要先删除 OLS,然后将其配置为与 OID 一同工作(运行 catnools.sql 后,所有标签都将丢失,您的表将不再受 OLS 保护除非在 Oracle Internet Directory 中重新创建这些表,本文将对此进行说明):

  1. 运行脚本“catnools.sql”,它位于 $OH/rdbms/admin 中:

  2. 退出 SQL*Plus,启动 dbca 配置 OLS:

  3. 单击 "Next":

  4. 选择 "Configure Database Options",然后单击 "Next":

  5. 选择您的数据库并单击 "Next":

  6. 选择 "No, keep the database registered" 并单击 "Next":

  7. 选中 "Oracle Label Security" 并单击 "Customize...":

  8. 选择 "Yes, configure with OID",输入 "cn=dbcreator,cn=users,dc=us,dc=oracle,dc=com" 和口令;单击 "OK":

  9. 单击 "Next":

  10. 单击 "Finish":

  11. 单击 "OK":

  12. 单击 "OK":

  13. 配置过程中:

  14. 单击 "No" 从 dbca 中退出

    dbca 完成 OLS 的 OID 配置后,它创建一个“供应配置文件”,将目录中的策略更改重新同步到所有连接的数据库。现有的策略也被复制到新注册的数据库:

    每数据库都有一个供应配置文件。

编辑供应配置文件:

根据 Enterprise Security Manager,我们的数据库的识别名称 ("dn") 定义如下:"cn=orcl,cn=OracleContext,dc=us,dc=oracle,dc=com";在 OID 中注册该数据库的用户为 "cn=dbcreator,cn=users,dc=us,dc=oracle,dc=com"。

将 OID 中的策略更改同步到连接的数据库的默认时间段(“调度”)为 3,600 秒 – 每小时一次。我们将其更改为 60 秒。“停机”期间发生的事件不会丢失,它们将在配置文件再次启用时立即载入。

  1. 返回您的终端,输入下列三个命令,每个命令一行(没有回车符等),在 OID 中编辑供应配置文件:

    oidprovtool operation=disable ldap_host=dlsun25 ldap_port=389 ldap_user='cn=dbcreator,cn=users,dc=us,dc=oracle,dc=com' ldap_user_password=welcome application_dn='cn=orcl,cn=OracleContext,dc=us,dc=oracle,dc=com' organization_dn='dc=us,dc=oracle,dc=com'

    oidprovtool operation=modify ldap_host=dlsun25 ldap_port=389 ldap_user='cn=dbcreator,cn=users,dc=us,dc=oracle,dc=com' ldap_user_password=welcome application_dn='cn=orcl,cn=OracleContext,dc=us,dc=oracle,dc=com' organization_dn='dc=us,dc=oracle,dc=com' schedule=60

    oidprovtool operation=enable ldap_host=dlsun25 ldap_port=389 ldap_user='cn=dbcreator,cn=users,dc=us,dc=oracle,dc=com' ldap_user_password=welcome application_dn='cn=orcl,cn=OracleContext,dc=us,dc=oracle,dc=com' organization_dn='dc=us,dc=oracle,dc=com'

由于安全原因,"LBACSYS" 和 "DIP" 的帐户均被锁定;使用以下命令取消对它们的锁定:
connect / as sysdba;
alter user dip identified by dip account unlock;
(*)
alter user lbacsys identified by elcaro1 account unlock;
(*):如果要更改 "dip" 的口令,不要使用 "alter user" 命令;该操作需要使用 "oidprovtool" 命令完成。

另一个 Oracle 示例说明如何创建 OLS 策略,以在 OLS 的独立配置(无 OID)中以 "hr" 模式保护 LOCATIONS 表。

本示例的 OLS 标签仅包含级别(SENSitive、CONFidential、PUBlic),不包含区或组。

LBACSYS 是 OLS 策略的默认 DBA,但是他将执行权利授给另外两名管理员,以实现职责的彻底分离:
"sec_admin":执行 SA_COMPONENTS、SA_POLICY_ADMIN、SA_LABEL_ADMIN
"HR_sec":执行 SA_USER_ADMIN

有权访问 hr.LOCATIONS 表的最终用户是:

  • Steven King (sking):PUB、CONF、SENS
  • Karen Partners (kpartner):PUB、CONF
  • Louise Doran (ldoran):PUB
在此新的基于 OID 的 OLS 演示中,我们将继续保护 hr.LOCATIONS 表,但是用户和 OLS 策略将在 OID 中集中管理。

LBACSYS <—> polcreator
sec_admin/HR_sec <—> poladmin

创建管理用户 "polcreator" 和 "poladmin":

  1. 由于 "polcreator" 和 "poladmin" 尚未存在,我们需要首先在 OID 中以企业用户的身份创建它们。

    在浏览器中访问 http://<OIDhost>:7777/oiddas/ui/oideushome/

    单击右上角的 "Login" 按钮:

  2. 输入 "orcladmin" 和 "welcome1" 作为凭证:

  3. 单击 "Users and Groups" 选项卡并单击 "create":

  4. 输入 "poladmin" 的一些详细信息,向下滚动:

  5. 向下滚动并单击 "submit":

  6. 确认并单击 "Create Another User":

  7. 添加 "polcreator" 的一些详细信息,向下滚动并点击 "submit"。

    在下一页,确认创建 "polcreator";关闭浏览器。

使用 "olsadmintool" 重新构建 OID 中的策略:

  1. 首先,需要通过 "cn=orcladmin,cn=users,dc=us,dc=oracle,dc=com" 授予 "polcreator" 创建策略的权利:
    olsadmintool addpolcreator --userdn "cn=polcreator,cn=users,dc=us,dc=oracle,dc=com" -h dlsun25 -D cn=orcladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1

    然后,"polcreator" 创建策略 "ACCESS_LOCATIONS":

    olsadmintool createpolicy --name ACCESS_LOCATIONS --colname OLS_COLUMN --options "READ_CONTROL,LABEL_DEFAULT,HIDE" -h dlsun25 -p 389 -D cn=polcreator,cn=users,dc=us,dc=oracle,dc=com -w welcome1 -b dc=us,dc=oracle,dc=com

  2. "polcreator" 允许 "poladmin" 管理该策略的详细信息(比较我们独立演示中 LBACSYS 的 polcreator 与 sec_admin 的 poladmin,这里,这种级别的职责分离是通过将 <policy_name>_DBA 角色授给 sec_admin 实现的):

    olsadmintool addadmin --polname ACCESS_LOCATIONS --admindn "cn=poladmin,cn=users,dc=us,dc=oracle,dc=com" -h dlsun25 -D cn=polcreator,cn=users,dc=us,dc=oracle,dc=com -w welcome1

    级别是 "poladmin" 创建的(该演示中不包括区和组):

    olsadmintool createlevel --polname ACCESS_LOCATIONS --tag 1000 --shortname PUB --longname PUBLIC -b dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1
    olsadmintool createlevel --polname ACCESS_LOCATIONS --tag 2000 --shortname CONF --longname CONFIDENTIAL -b dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1
    olsadmintool createlevel --polname ACCESS_LOCATIONS --tag 3000 --shortname SENS --longname SENSITIVE -b dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1

  3. 由于该演示不包括区和组,我们现在就可以基于先前创建的级别创建标签。

    olsadmintool createlabel --polname ACCESS_LOCATIONS --tag 1000 --value "PUB" -h dlsun25 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1
    olsadmintool createlabel --polname ACCESS_LOCATIONS --tag 2000 --value "CONF" -h dlsun25 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1
    olsadmintool createlabel --polname ACCESS_LOCATIONS --tag 3000 --value "SENS" -h dlsun25 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1

    与独立的 OLS 相反,启用 OID 的 OLS 并不与 OID 中的用户相连;标签连接到“配置文件”,然后企业用户被添加到配置文件中;每个标签都有一个配置文件;每个配置文件没有最多用户数量限制。

    olsadmintool createprofile --polname ACCESS_LOCATIONS --profname PUB_PROFILE --maxreadlabel PUB --maxwritelabel PUB --minwritelabel PUB --defreadlabel PUB --defrowlabel PUB -b dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1
    olsadmintool createprofile --polname ACCESS_LOCATIONS --profname CONF_PROFILE --maxreadlabel CONF --maxwritelabel CONF --minwritelabel PUB --defreadlabel CONF --defrowlabel CONF -b dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1
    olsadmintool createprofile --polname ACCESS_LOCATIONS --profname SENS_PROFILE --maxreadlabel SENS --maxwritelabel SENS --minwritelabel CONF --defreadlabel SENS --defrowlabel SENS -b dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1

  4. 下一步是在 OID 中创建企业用户;在独立演示中,我们在 hr.EMPLOYEES 表中挑选 3 名员工,使其成为数据库用户(Steven King、Karen Partners 和 Louise Doran)。要创建企业用户,在浏览器中访问以下地址:

    http://<OIDhost>:7777/oiddas/ui/oideushome/

    单击右上角的 "Login" 按钮:

  5. 输入 "orcladmin" 和 "welcome1" 作为凭证:

  6. 单击 "Users and Groups" 选项卡并单击 "create":

    查询数据库中的 hr.EMPLOYEES 表获得 Steven King、Karen Partners 和 Louise Doran 的一些详细信息,填写下列表格。要创建反映他们的访问权利的等级,使 Karen 成为 Louise 的经理,Steven 成为 Karen 的经理。

  7. 输入 "Steven King" 的一些详细信息,向下滚动:

  8. 添加一些其他信息后,向下滚动并单击 "submit":

  9. 输入 "Karen Partners" 的一些详细信息,向下滚动:

  10. 单击搜索指示灯,将 Steven 定义为 Karen 的经理;向下滚动并单击 "submit":

  11. 输入 "Louise Doran" 的一些详细信息,向下滚动:

  12. 单击搜索指示灯,将 Karen 定义为 Louise 的经理;向下滚动并单击 "submit":

  13. 在搜索框中输入 'ldoran' 并单击 "Go":

  14. 单击她的 "Job Title":

  15. 确认 org-chart,关闭浏览器

  16. 下一步是按照这些员工的等级位置将他们添加到先前创建的配置文件中:

    • Steven King,CEO:SENS_PROFILE
    • Karen Partners,销售经理:CONF_PROFILE
    • Louise Doran,销售代表:PUB_PROFILE

    olsadmintool adduser --polname ACCESS_LOCATIONS --profname SENS_PROFILE --userdn cn=SKing,cn=users,dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1 -b dc=us,dc=oracle,dc=com
    olsadmintool adduser --polname ACCESS_LOCATIONS --profname CONF_PROFILE --userdn cn=KPartners,cn=users,dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1 -b dc=us,dc=oracle,dc=com
    olsadmintool adduser --polname ACCESS_LOCATIONS --profname PUB_PROFILE --userdn cn=LDoran,cn=users,dc=us,dc=oracle,dc=com -h dlsun25 -p 389 -D cn=poladmin,cn=users,dc=us,dc=oracle,dc=com -w welcome1 -b dc=us,dc=oracle,dc=com

  17. 在 OID 中创建的策略已通过供应配置文件中给出的信息复制到所有参与的数据库 ('orcl' 只是其中一个)。要对此进行验证,使用终端,以 LBACSYS 的身份登录到数据库,输入:
    select * from dba_sa_policies;

  18. 由于该策略存在于所有已注册的数据库中,因此有必要为该策略订阅数据库;该操作只能通过 "cn=poladmin,cn=users,dc=us,dc=oracle,dc=com" 完成,该用户以企业用户的身份连接到数据库:
    使用终端窗口,尝试以 "cn=poladmin" 身份连接:
    记住,在当前配置中,只有 Joe 能够连接;Nina 不能连接,因为没有将她的名字添加到在 OID 中定义的 "dbaccess_ent_role" 中。

  19. 您还需要将 "poladmin" 添加到具有 "connect" 权限的组中:

    poladmin 不能共享我们先前创建的企业角色,因为他将需要他不想要与其他 'normal' 用户(如 Steven King、Karen Partners 和 Louise Doran,当然还有 Joe)共享的特殊执行权。因此,我们将在 OID 中创建另一个全局标识的数据库角色和一个特殊的企业角色。使用终端窗口连接 "as sysdba",创建 "policy_admin_role",并为其授予 "connect" 权利:

  20. 从 SQL 提示符退出,使用 "esm" 启动 Enterprise Security Manager:

    提供 Oracle Internet Directory 的登录凭证 "cn=orcladmin",然后单击 "OK"。

  21. 导航到 "Enterprise Roles":

    单击 "Operations" 并选择 "Create Enterprise Role":

  22. 输入 Enterprise Role 的名称,例如 "policy_admin_ent_role":

    单击 "OK"

  23. 导航到新的企业角色:

    单击 "Database Global Roles" 选项卡并单击 "Add..."

  24. 单击包含全局标识角色的数据库的名称:"orcl"

  25. 输入 "system"
    的认证信息,登录到您的数据库。

  26. 从可用全局角色列表中,选出 "policy_admin_role"。

    单击 "OK"

  27. 单击 "Apply":

  28. 单击 "Users" 选项卡:

    单击 "Add..."

  29. 导航到 "cn=Users" 并搜索 "poladmin":

    突出显示 "poladmin" 并点击 "OK"

  30. 单击 "Apply"

    关闭 Enterprise Security Manager

  31. LBACSYS 将 execute on sa_policy_admin 权利授予 policy_admin_role,以便 poladmin 为数据库订阅策略:

    (仅在 OID 中使用 OLS 时才需要订阅策略;独立模式时,策略可以直接应用到表。仅当 poladmin 被配置为企业用户时,该用户才有权订阅策略!)

  32. poladmin 将策略应用到 hr.LOCATIONS 表:

  33. 当 poladmin 将策略应用到该 LOCATIONS 表后,该表增加一列。如果该策略最初是由 "polcreator" 创建的,则该列名为 "OLS_COLUMN"。该列将包含策略标签。由于该策略是使用 "READ_CONTROL" 选项创建的,因此将该策略应用到表后,任何人都不能再访问其中的行。

    将会创建一个新的企业用户 ("HR_DBA")。该用户获得与其在 OID 中的 DN 完全匹配的独占模式 (cn=HR_DBA,cn=users,dc=us,dc=oracle,dc=com)。所有其他用户通过共享模式 ("global_ident_schema_user") 连接。

    LOCATIONS 表的所有者 HR 授予该独占模式选择和更新的权限,poladmin 创建一个 OWNER 配置文件,为 HR_DBA 提供 FULL 权限。这些权限组合在一起将允许 HR_DBA 将标签添加到 OLS_COLUMN 中,而不管策略是什么:

  34. 在浏览器中访问 http://<OIDhost>:7777/oiddas/ui/oideushome/

    单击右上角的 "Login" 按钮:

  35. 输入 "orcladmin" 和 "welcome1" 作为凭证:

  36. 单击 "Users and Groups" 选项卡并单击 "create":

  37. 输入 "poladmin" 的一些详细信息,向下滚动:

    向下滚动并单击 "submit"。

  38. 确认在 OID 中创建 HR_DBA 企业用户:

    注销并关闭浏览器

  39. 从 SQL 提示符退出,使用 "esm" 启动 Enterprise Security Manager:

    提供 Oracle Internet Directory 的登录凭证 "cn=orcladmin",然后单击 "OK"。

  40. 向下导览到 "OracleDefaultDomain":

    单击 "Database Schema Mapping" 选项卡。单击 "Add..."。

  41. 突出显示独占数据库模式名称中的 HR_DBA 条目和类型,HR_DBA 将使用它们来连接数据库。

    单击 "OK"。

  42. 单击 "Apply" 并关闭 Enterprise Security Manager

  43. poladmin 将新的 OWNER_PROFILE 添加到 ACCESS_LOCATION(OID 中的策略)中,将 HR_DBA 添加到配置文件中:

  44. HR_DBA 现在是具有其自己的独占数据库模式和 OLS 'FULL' 权限的企业用户,将 OLS_COLUMN 中的 NULL 值更新为数据分类标签:

  45. 使用 "esm" 启动 Enterprise Security Manager,以便使三位员工 SKing、KPartners 和 LDoran 与 global_ident_schema_user 匹配,这样他们就可以访问和查询 hr.LOCATIONS 表了:

    提供 Oracle Internet Directory 的登录凭证 "cn=orcladmin",然后单击 "OK"。

  46. 导航到您创建的第一个企业角色:"dbaccess_ent_role",单击 "Users" 选项卡。

    突出显示 "Joe",单击 "Remove";然后单击 "Add..."

  47. 导航到 Users 子树,搜索 SKing。

    突出显示 SKing,单击 "OK";对 KPartners 和 LDoran 重复以上操作

  48. 单击 Apply

    关闭 Enterprise Security Manager

测试策略:

三名员工(SKing、KPartners 和 LDoran)全部针对 hr.LOCATIONS 表发出同一查询。但是他们的访问权限不同,当他们的访问权限控制数据分类标签时,只允许返回以下行:

  1. 以 SKing 身份连接:

    Steven 可以看到所有的 23 行(PUBLIC、CONFIDENTIAL 和 SENSITIVE)

  2. 以 KPartners 身份连接:

    Karen 可以看到 20 行(PUBLIC 和 CONFIDENTIAL)

  3. 以 LDoran 身份连接:

    Louise 可以看到 17 行(仅 PUBLIC)

寄送此页面
Printer View 打印机视图