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修 ...
随机推荐
- c语言,变长数组
下面这个结构体,可以在malloc的时候指定数据data的长度,这样的形式就是变长数组:typedef struct{ int data_len; char data[0];//或char data[ ...
- 使用BAT方法结束进程
@echo off taskkill /f /im GAM.exe taskkill /f /im GCL10.exe http://www.cnblogs.com/FKdelphi/p/501540 ...
- 修改Android 4.2.2的原生Camera引出的java.lang.UnsatisfiedLinkError: Native method not found,及解决方法
修改Android 4.2.2的原生Camera应用,做一些定制,将Camera的包名从之前的 package com.android.* 修改成了com.zhao3546.*. 调整后,应用可以正常 ...
- 1030 - Image Is Everything
Your new company is building a robot that can hold small lightweight objects. The robot will have th ...
- CSDN-Code平台使用过程中的5点经验教训
昨天又创建了一个项目,fucms,可是本地一直没有权限提交,搞了非常久,试了几十次,都不行,我是非常的灰心和郁闷. 刚刚,和CSDN-Code的官方客服咨询了非常久非常久,最终摸索出来了一些心得体会 ...
- 弹出框weeboxs 基本属性总结
使用前需包含以下jquery.js.bgiframe.js.weebox.js文件 boxid: null, //设定了此值只后,以后在打开同样boxid的弹窗时,前一个将被自 动关闭 boxclas ...
- LINUX 命令行编辑
向 <-前 后 -> 删除 ctrl + d 删除光标所在位置上的字符相当于VIM里x或者dl ctrl + h 删除光标 ...
- Kendo UI开发教程(20): Kendo MVVM 数据绑定(九) Text
Text绑定可以使用ViewModel来设置DOM元素的文本属性,如果需要设置input,textarea,或select的显示,需要使用value属性. 1 <span data-bind=& ...
- JavaScript编程:浏览器对象模型BOM
4.浏览器对象模型BOM: document.body.offsetwidth可以获取浏览器宽度. Window对象: 窗口操作: 1.moveBy(dx,dy ...
- zTree实现地市县三级级联Action类
zTree实现地市县三级级联Action类 ProvinceAction.java: /** * @Title:ProvinceAction.java * @Package:com.gwtjs.str ...