问题描述
你好,汤姆,
我已经在12.2.0.1.0 Oracle数据库上实现了DB Vault。我创建了一个Vault策略来阻止使用数据库工具 (如Toad等) 对应用程序架构的自组织访问。该策略应仅允许从具有IP 192.168.1.10的应用程序服务器到DB的应用程序连接,并限制从其他任何地方连接到应用程序架构。但是这里的模块因素似乎不起作用,因为它允许从192.168.1.10服务器的临时工具进行连接。除了登录触发器之外,还有什么替代方法可以用来实现这一点?
下面提供的代码是用于实现vault策略的代码。
我已经在12.2.0.1.0 Oracle数据库上实现了DB Vault。我创建了一个Vault策略来阻止使用数据库工具 (如Toad等) 对应用程序架构的自组织访问。该策略应仅允许从具有IP 192.168.1.10的应用程序服务器到DB的应用程序连接,并限制从其他任何地方连接到应用程序架构。但是这里的模块因素似乎不起作用,因为它允许从192.168.1.10服务器的临时工具进行连接。除了登录触发器之外,还有什么替代方法可以用来实现这一点?
下面提供的代码是用于实现vault策略的代码。
BEGIN DBMS_MACADM.CREATE_RULE_SET( rule_set_name => 'Limit_SQL_Plus_Access', description => 'Limits access to SQL*Plus for Apps Schemas', enabled => DBMS_MACUTL.G_YES, eval_options => DBMS_MACUTL.G_RULESET_EVAL_ALL, audit_options => DBMS_MACUTL.G_RULESET_AUDIT_OFF, fail_options => DBMS_MACUTL.G_RULESET_FAIL_SHOW, fail_message => 'ad-hoc access denied for Apps Schemas', fail_code => 20461, handler_options => DBMS_MACUTL.G_RULESET_HANDLER_OFF, handler => NULL); END; / BEGIN DBMS_MACADM.CREATE_FACTOR( factor_name => 'MODULE', factor_type_name => 'Application', description => 'Stores client program name that connects to database', rule_set_name => 'Limit_SQL_Plus_Access', validate_expr => NULL, get_expr => 'UPPER(SYS_CONTEXT(''USERENV'',''MODULE''))', identify_by => DBMS_MACUTL.G_IDENTIFY_BY_METHOD, labeled_by => 0, eval_options => DBMS_MACUTL.G_EVAL_ON_SESSION, audit_options => DBMS_MACUTL.G_AUDIT_OFF, fail_options => DBMS_MACUTL.G_FAIL_WITH_MESSAGE); END; / BEGIN DBMS_MACADM.CREATE_FACTOR( factor_name => 'PROGRAM', factor_type_name => 'Application', description => 'Stores client program name that connects to database', rule_set_name => 'Limit_SQL_Plus_Access', validate_expr => NULL, get_expr => 'UPPER(SYS_CONTEXT(''USERENV'',''CLIENT_PROGRAM_NAME''))', identify_by => DBMS_MACUTL.G_IDENTIFY_BY_METHOD, labeled_by => 0, eval_options => DBMS_MACUTL.G_EVAL_ON_ACCESS, audit_options => DBMS_MACUTL.G_AUDIT_OFF, fail_options => DBMS_MACUTL.G_FAIL_WITH_MESSAGE); END; / BEGIN DBMS_MACADM.CREATE_RULE( rule_name => 'Rule_Connect', rule_expr => 'UPPER(DVF.F$MODULE) in (''APPS.WINSERVICE.EXE'') AND DVF.F$SESSION_USER IN (''APPS'') AND DVF.F$CLIENT_IP IN (''192.168.1.10') AND UPPER(DVF.F$PROGRAM) in (''APPS.WINSERVICE.EXE'')'); END; / BEGIN DBMS_MACADM.ADD_RULE_TO_RULE_SET( rule_set_name => 'Limit_SQL_Plus_Access', rule_name => 'Rule_Connect' ); END; / BEGIN DBMS_MACADM.CREATE_CONNECT_COMMAND_RULE( rule_set_name => 'Limit_SQL_Plus_Access', user_name => 'APPS' enabled => DBMS_MACUTIL.G_YES, scope => DBMS_MACUTIL.G_SCOPE_LOCAL); END;复制
专家解答
我不熟悉数据库保险库。因此,我联系了数据库保管库的PM Alan Williams。他这样说:
I notice they are using factors – that’s not necessary and I recommend just using rules to access context directly. Factors adds another layer of complication and since it’s rarely (if at all used), may not be as well understood.
I recommend creating the connection command rule/rule set and then taking it step by step
- Create rule set (as below)
- Create command rule (as below)
- Use the out of the box ‘enabled’ and ‘disabled’ rules to make sure the command rule is working as anticipated
- Then replace the OOTB rule with the IP rule and test
- Then test with another rule (setting aside the IP rule) and test the new rule independently
- In fact, test with each rule independently to make sure each rule is working as anticipated
- Then start concatenating rules together
If they aren’t sure if the parameter values are correct, they can use the new 12.2 simulation mode to capture the factors first
- Create rule set/command rule/enabled command rule – set to simulation mode
- Connect as the user from the application
- Review the simulation log and look into the factor column to review the factors that were used
I notice they are using factors – that’s not necessary and I recommend just using rules to access context directly. Factors adds another layer of complication and since it’s rarely (if at all used), may not be as well understood.
I recommend creating the connection command rule/rule set and then taking it step by step
- Create rule set (as below)
- Create command rule (as below)
- Use the out of the box ‘enabled’ and ‘disabled’ rules to make sure the command rule is working as anticipated
- Then replace the OOTB rule with the IP rule and test
- Then test with another rule (setting aside the IP rule) and test the new rule independently
- In fact, test with each rule independently to make sure each rule is working as anticipated
- Then start concatenating rules together
If they aren’t sure if the parameter values are correct, they can use the new 12.2 simulation mode to capture the factors first
- Create rule set/command rule/enabled command rule – set to simulation mode
- Connect as the user from the application
- Review the simulation log and look into the factor column to review the factors that were used
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle DataGuard高可用性解决方案详解
孙莹
529次阅读
2025-03-26 23:27:33
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
500次阅读
2025-04-15 17:24:06
墨天轮个人数说知识点合集
JiekeXu
411次阅读
2025-04-01 15:56:03
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
409次阅读
2025-04-08 09:12:48
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
392次阅读
2025-04-18 14:18:38
Oracle SQL 执行计划分析与优化指南
Digital Observer
391次阅读
2025-04-01 11:08:44
Oracle 19c RAC更换IP实战,运维必看!
szrsu
351次阅读
2025-04-08 23:57:08
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
345次阅读
2025-04-20 10:07:02
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
320次阅读
2025-04-15 14:48:05
oracle定时任务常用攻略
virvle
320次阅读
2025-03-25 16:05:19