OCA读书笔记(11) - 实现Oracle数据库审计
11 Implementing Oracle Database Auditing
描述DBA对于安全和审计的职责
使能标准的数据库审计
安全审计选项
查看审计信息
维护审计路径
最小权限原则
只在计算机上安装所需软件
只在计算机上激活所需服务
只允许需要访问的用户访问操作系统和数据库
限制对 root 或管理员帐户的访问
限制对 SYSDBA 和 SYSOPER 帐户的访问
只允许用户访问完成工作所需的数据库对象
O7_DICTIONARY_ACCESSIBILITY的作用:
1. 保护数据字典
演示:当参数为false时,即使赋予普通用户select any table的权限,普通用户也不能访问数据字典;当参数为true时,赋予普通用户同等权限,普通用户才可以访问数据字典。
sqlplus / as sysdba;
show parameter O7;
grant select any table to oe;
alter user oe account unlock identified by oe;
conn oe/oe;
select count(*) from dba_objects; --error
conn / as sysdba;
alter system set O7_DICTIONARY_ACCESSIBILITY=true scope=spfile;
startup force;
show parameter o7;
conn oe/oe;
select count(*) from dba_objects;
conn / as sysdba;
alter system set O7_DICTIONARY_ACCESSIBILITY=false scope=spfile;
startup force;
强制审计
对具有sysdba和sysoper的用户的登录行为进行审计,审计的内容存放的位置:audit_file_dest的值
sqlplus / as sysdba;
show parameter audit_file_dest
select spid from v$process where addr=(select paddr from v$session where sid=(select distinct sid from v$mystat))
cd $ORACLE_BASE/admin/orcl/adump
ls *<spid>*
vi orcl_ora_<spid>.aud
SYSDBA (and SYSOPER)审计
show parameter audit_sys
alter system set audit_sys_operations=true scope=spfile
startup force
ls *7689*
vi orcl_ ... aud
以上内容放置在操作系统文件。
标准数据库审计
show parameter audit_trail
11g 默认打开
审计信息放置在aud$中
desc aud$
查看:
desc dba_audit_trail
grant select any table to scott;
audit select any table by sott by session;
truncate table aud$;
select count(*) from dba_audit_trail;
conn scott/tiger;
conn / as sysdba;
select count(*) from dba_audit_trail;
select username, timestamp, ses_actions, obj_name, action_name, sql_text from dba_audit_trail where username='SCOTT';
alter ssytem set audit_trail=db,extended scope=spfile;
startup force;
noaudit select any table by scott;
audit update on scott.emp;
update scott.emp set sal=sal+100;
select username, timestamp, ses_actions, obj_name, action_name, sql_text from dba_audit_trail where username='HR';
SQL语句审计
AUDIT table;
audit table by hr whenever not successful;
系统权限审计
audit select any table, create any trigger;
audit select any table by hr by session;
对象权限审计
audit all on hr.employees;
audit update,delete on hr.employees by access;
细粒度审计(FGA)
对某个表的某一行或者某列或某行某列进行操作时才进行审计。
通过dbms_fga增加策略来开启细粒度审计,与标准审计没有关系。
dbms_fga.add_policy (
object_schema => 'HR',
object_name => 'EMPLOYEES',
policy_name => 'audit_emps_salary',
audit_condition=> 'department_id=10',
audit_column => 'SALARY,COMMISSION_PCT',
handler_schema => 'secure',
handler_module => 'log_emps_salary',
enable => TRUE,
statement_types => 'SELECT,UPDATE');
审计内容
fga_log$
dba_
conn scott/tiger;
删除审计
exec dbms_fga.drop_policy('scott','emp','audit_emp')
基于值的审计
通过触发器进行审计
创建一个存放审计数据的表
conn / as sysdba
create table system.audit_employees(os_user
varchar2(30),ins_date date,ip_address
varchar2(20),context varchar2(100));
创建触发器
create or replace trigger system.audit_salary
after update of salary on hr.employees
referencing new as new old as old
for each row
begin
if :old.salary != :new.salary then
insert into system.audit_employees
values(sys_context('userenv','os_user'),sysdate,sys_context('userenv','ip_address'),
:new.employee_id||' salary changed from '||:old.salary||' to '||:new.salary);
end if;
end;
验证:
conn hr/hr
update employees set SALARY=SALARY+1000 where EMPLOYEE_ID=190;
SQL> commit;
.bash_profile
userenv
conn system/a
SQL> select * from system.audit_employees;
OCA读书笔记(11) - 实现Oracle数据库审计的更多相关文章
- OCA读书笔记(1) - 浏览Oracle数据库架构
Objectives: List the major architectural components of Oracle DatabaseExplain the memory structuresD ...
- OCA读书笔记(2) - 安装Oracle软件
Objectives: •Describe your role as a database administrator (DBA) and explain typical tasks and tool ...
- OCA读书笔记(6) - 配置Oracle网络环境
6.Configuring the Oracle Network Environment su - grid装grid时自动创建了监听netca--创建新的监听 vi $ORACLE_HOME/net ...
- 机器学习实战 - 读书笔记(11) - 使用Apriori算法进行关联分析
前言 最近在看Peter Harrington写的"机器学习实战",这是我的学习心得,这次是第11章 - 使用Apriori算法进行关联分析. 基本概念 关联分析(associat ...
- 强化学习读书笔记 - 11 - off-policy的近似方法
强化学习读书笔记 - 11 - off-policy的近似方法 学习笔记: Reinforcement Learning: An Introduction, Richard S. Sutton and ...
- OCA读书笔记(7) - 管理数据库存储结构
7.Managing Database Storage Structures 逻辑结构 数据库的存储结构有物理结构和逻辑结构组成的 物理结构:物理上,oracle是由一些操作系统文件组成的 SQL&g ...
- oracle数据库审计
Oracle使用大量不同的审计方法来监控使用何种权限,以及访问哪些对象.审计不会防止使用这些权限,但可以提供有用的信息,用于揭示权限的滥用和误用. 下表中总结了Oracle数据库中不同类型的审计. 审 ...
- 【学习笔记】Y2-1-1 Oracle数据库基础
Oracle 简介关系型(二维表)数据库 用来存储海量数据在大数据量的并发检索的情况下,性能要高于其他同类数据库产品一般运行环境是Linux和UnixOracle版本中的I(Internet) G(G ...
- OCA读书笔记(9) - 管理数据同步
9.Managing Data Concurrency 描述锁机制以及oracle如何管理数据一致性监控和解决锁冲突 管理数据的并发--管理锁数据的不一致:脏读更改丢失幻影读 脏读:数据是指事务T2修 ...
随机推荐
- IE6 png图片实现半透明的方法
IE6中支持PNG半透明图片完美解决方法-divcss5亲測 从IE7及IE7以上版本号都支持PNG半透明格式图片,而只有IE6不支持png格式透明图片,而GIF半透明效果不及png半透明格式图片,由 ...
- 如何使用不同dll的相同namespace下的相同接口
问题: 程序里加载了2个dll,这2个dll里都声明了同样的命名空间(这个不违法),然后在这个同样的命名空间下,他俩又定义了同名的interface. 然后我程序里直接using这个命名空间,使用这个 ...
- 数学之路-python计算实战(14)-机器视觉-图像增强(直方图均衡化)
我们来看一个灰度图像,让表示灰度出现的次数,这样图像中灰度为 的像素的出现概率是 是图像中全部的灰度数, 是图像中全部的像素数, 实际上是图像的直方图,归一化到 . 把 作为相应于 的累计概率 ...
- SMTP命令 发送邮件 DOS命令
1.实例:从qq邮箱 发送到其他地址的邮箱 >telnet smtp.qq.com 25 >helo qq.com >auth login >NzI3MTU0MTg3QHFxL ...
- Windows Phone 8初学者开发的翻译终于过半
从2013年7月19日开始,到2013年12月9日,一共花了143天时间完成了18篇Windows Phone 8初学者开发的翻译,还剩下17篇文章需要翻译,看到了完成的希望! I love Wind ...
- 读取中兴3G告警log告警文件到集合
1.文件格式 ALARM_ID=102305_404205 EVENT_TIME=-- :: NOTIFICATION_TYPE= MANAGED_OBJECT_INSTANCE=NodeId=,Bs ...
- 稳定婚姻问题和Gale-Shapley算法(转)
什么是算法?每当有人问作者这样的问题时,他总会引用这个例子:假如你是一个媒人,有若干个单身男子登门求助,还有同样多的单身女子也前来征婚.如果你已经知道这些女孩儿在每个男孩儿心目中的排名,以及男孩儿们在 ...
- 基于visual Studio2013解决面试题之1002公共子串
题目
- EasyUI - DateBox组件
效果: html代码: <input type ="text" id ="box" /> JS代码: $(function () { //设置返回格 ...
- linux: 可重入函数与不可重入函数
1. 可重入函数与线程安全 摘自 多线程和多进程的区别(小结) http://blog.csdn.net/hairetz/article/details/4281931 要确保函数线程安全,主要需要考 ...