基本语法:

CREATE AUDIT POLICY <policy_name> AUDITING <audit_status_clause><audit_actions> LEVEL <audit_level>
 
语法元素:
 <policy_name> ::= <identifier><audit_status_clause> ::= SUCCESSFUL | UNSUCCESSFUL | ALL <audit_actions> ::= ACTIONS FOR <user_name>[, <user_name>]| <audit_action_list> [FOR <user_name>[, <user_name>]]| <target_audit_action_list> [FOR <user_name>[, <user_name>]...]<user_name> ::= <simple_identifier><audit_action_list> ::= <audit_action_name>[, <audit_action_name>]...<target_audit_action_list> ::= <target_audit_action_name>[, <target_audit_action_name] ON <object_name>[, <object_name>]<audit_action_name> ::= GRANT PRIVILEGE                   | REVOKE PRIVILEGE | GRANT STRUCTURED PRIVILEGE       | REVOKE STRUCTURED PRIVILEGE  | GRANT APPLICATION PRIVILEGE      | REVOKE APPLICATION PRIVILEGE  | GRANT ROLE                       | REVOKE ROLE | GRANT ANY                        | REVOKE ANY | CREATE USER                      | DROP USER    | CREATE ROLE                      | DROP ROLE  | ENABLE AUDIT POLICY              | DISABLE AUDIT POLICY| CREATE STRUCTURED PRIVILEGE      | DROP STRUCTURED PRIVILEGE| ALTER STRUCTURED PRIVILEGE       | CONNECT  | SYSTEM CONFIGURATION CHANGE      | SET SYSTEM LICENSE| UNSET SYSTEM LICENSE             | ALTER USER| REPOSITORY_ACTIVATE              | DROP TABLE <target_audit_action_name> ::= INSERT | UPDATE | DELETE | SELECT | EXECUTE<audit_level> ::= EMERGENCY | ALERT | CRITICAL | WARNING | INFO<object_name> ::= <table_name> | <view_name> | <procedure_name><table_name>       ::= [<schema_name>.]<identifier><view_name>        ::= [<schema_name>.]<identifier><procedure_name>   ::= [<schema_name>.]<identifier><schema_name>  ::= <identifier>
 

Description

The CREATE AUDIT POLICY statement creates a new audit policy. This audit policy can then be enabled and will cause the auditing of the specified audit actions to occur.
Only database users having the system privilege AUDIT ADMIN are allowed to create an audit policy.
The specified audit policy name must be unique not match the name of an existing audit policy.
An audit policy defines which audit actions will be audited. Audit policies need to be enabled for auditing to occur happen.
One audit policy can contain one of the following:

  • non-restricted auditing for n (>=1) users
  • auditing for actions not restricted to objects
  • auditing for actions which are restricted to objects.

For the last two alternatives listed, an optional restriction for user(s) is available.

The <audit_status_clause> defines if successful, unsuccessful or all executions of the specified audit actions are audited.

The table below contains the available audit actions. They are grouped in several groups. Audit actions in the same group can be combined into one audit policy. Audit actions of different groups can not be combined into the same audit policy.

Audit Action Name Group Number Audit Operation Comment
GRANT PRIVILEGE 1 granting of privileges to users or roles
REVOKE PRIVILEGE 1 revoking of privileges from users or roles
GRANT STRUCTURED PRIVILEGE 1 granting of structured/analytical privileges to users or roles
REVOKE STRUCTURED PRIVILEGE 1 revoking of structured/analytical privileges from users or roles
GRANT APPLICATION PRIVILEGE 1 granting of application privileges to users or roles
REVOKE APPLICATION PRIVILEGE 1 revoking of application privileges from users or roles
GRANT ROLE 1 granting of roles to users or roles
REVOKE ROLE 1 revoking of roles from users or roles
GRANT ANY 1 granting of privileges, structured privileges or roles to users or roles
REVOKE ANY 1 revoking of privileges, structured privileges or roles from users or roles
CREATE USER 2 creation of users
DROP USER 2 dropping of users
ALTER USER 2 altering of users
CREATE ROLE 2 creation of roles
DROP ROLE 2 dropping of roles
CONNECT 3 creation of a user connection to the database
SYSTEM CONFIGURATION CHANGE 4 changes to the system configuration (e.g. INIFILE)
ENABLE AUDIT POLICY 5 activation of audit policies
DISABLE AUDIT POLICY 5 deactivation of audit policies
CREATE STRUCTURED PRIVILEGE 6 creation of structured/analytical privileges
DROP STRUCTURED PRIVILEGE 6 destruction of structured/analytical privilege
ALTER STRUCTURED PRIVILEGE 6 change of structured/analytical privilege
SET SYSTEM LICENSE 7 installation of a system license
UNSET SYSTEM LICENSE 7 deletion of licenses
DROP TABLE 7 deletion of database tables
REPOSITORY ACTIVATE 7 activation of repository design time objects
INSERT 7 use of insert/replace/upsert statements on tables and views allows specification of target objects
UPDATE 7 use of update/replace/upsert statements on tables and views allows specification of target objects
DELETE 7 deletion of rows from tables/views and truncation of tables allows specification of target objects
SELECT 7 use of select statements on tables and views allows specification of target objects
EXECUTE 7 procedure calls allows specification of target objects
ALL 7 all actions above typically used for specific users

Only objects of type table, view, and procedure can be specified in the <target_audit_action_list>. Synonyms and sequences cannot be selected as objects for audit policies. Furthermore only those <target_audit_action_name>s can be combined with an object. The following table shows an overview of auditable actions on objects.

Action Table View Procedure
DELETE YES YES ---
INSERT YES YES ---
SELECT YES YES ---
UPDATE YES YES ---
EXECUTE --- --- YES

Each audit policy is assigned to an audit level. The possible levels, in decreasing order of importance, are: EMERGENCY, ALERT, CRITICAL, WARNING, INFO.

To make auditing occur, audit policies have to be created and enabled. Also the configuration parameter global_auditing_state (see below) has to be set to true.

Configuration Parameter

Currently the configuration parameter for auditing are stored in global.ini, in the auditing configuration section and are the following:

global_auditing_state ( 'true' / 'false' ) to activate / deactivate auditing globally, no matter how many audit policies are available and enabled. The default is false, meaning: no auditing will occur.
default_audit_trail_type ( 'SYSLOGPROTOCOL' / 'CSVTEXTFILE' ) to specify, how to store the auditing results. SYSLOGPROTOCOL is the default.
CSVTEXTFILE should be used only for testing purposes.
default_audit_trail_path to specify where to store the audit file, in the case that CSVTEXTFILE has been selected.

As for all configuration parameters, these parameters can be selected in view M_INIFILE_CONTENTS, if the current user has the required privilege to do so. These parameters will only be seen in case they have been explicitly set.

System and Monitoring Views

AUDIT_POLICY: shows all audit policies and their states
M_INIFILE_CONTENTS: shows the configuration parameter concerning auditing

Only database users with system privilege CATALOG READ, DATA ADMIN or INIFILE ADMIN can view information in the M_INIFILE_CONTENTS view. For other database users this view will be empty.

Example

Your create a new audit policy named priv_audit that will audit successful granting and revoking of privileges and roles. The audit policy has the medium audit level CRITICAL.
This policy has to be enabled explicity to make the auditing of the audit policy occur.

You create a new audit policy named object_audit that will audit the inserts into the existing table MY_SCHEMA.MY_TABLE. This policy has to be enabled explicity to make the auditing of the audit policy occur. This policy is restricted to user FRED and uses the audit level INFO.

 
其他例子

-- create audit policy
CREATE AUDIT POLICY policyAdministratePrincipals AUDITING ALL
CREATE ROLE, DROP ROLE, CREATE USER, DROP USER LEVEL Critical;

--disable audit policy
ALTER AUDIT POLICY policyAdministratePrincipals disable;

--enable audit policy
ALTER AUDIT POLICY policyAdministratePrincipals enable;

--query audit policy
select * from "PUBLIC"."AUDIT_POLICIES"

[系统审计]SAP HANA 中的系统审计策略管理相关推荐

  1. 【SAP HANA】关于SAP HANA中带层次结构的Analytic View创建、激活状况下在系统中生成对象的研究...

    根据SAP HANA中视图类型不同,我们主要做了以下几种测试: 一般Attribute View的生成情况, http://www.cnblogs.com/omygod/archive/2013/06 ...

  2. 【SAP HANA】关于SAP HANA中带层次结构的Attribute View创建、激活状况下在系统中生成对象的研究...

    根据SAP HANA中视图类型不同,我们主要做了以下几种测试: 一般Attribute View的生成情况, http://www.cnblogs.com/omygod/archive/2013/06 ...

  3. SAP LT Replication Server与SAP HANA中与Replication相关的表

    源系统中的所有application tables都是可以被initial load或replication的.在SAP系统中,SAP数据表的信息都是定义在表DD02L中,相关的文字说明定义在表DD0 ...

  4. [Step By Step]SAP Visual Intelligence数据操作、地图信息显示(SAP HANA中提取数据)

    Instruction: 本案例从SAP HANA中提取数据,试图创建数据的地图显示.数据修正 View: http://www.cnblogs.com/omygod/archive/2013/04/ ...

  5. SAP HANA中的SLT简介

    SAP HANA中的SLT简介 目录 SAP系统和SAP HANA之间的SLT连接架构 在SAP源系统中配置SLT服务器 通过SLT将数据从SAP源导入至SAP HANA 非SAP系统和SAP HAN ...

  6. SAP HANA中创建时间相关的数据时候需要Variant Schema

    在创建Generate Time Data时,我们需要选择Variant Schema 这个选项主要是跟我们同步SAP中的表T009和T009B,我们将这两张表放在哪个schema中,那么下拉的地方就 ...

  7. SAP HANA中日期格式转换

    集团数仓要求的日期格式为:STRING yyyyMMddhhssmm 例如:20200924175407 SAP HANA中日期格式为:TIMESTAMP yyyy-MM-dd hh:ss:mm 例如 ...

  8. mysql系统数据库服务器,mysql中的系统数据库服务器

    mysql中的系统数据库服务器 内容精选 换一换 用户正常的数据(不包括备份数据),以及云数据库RDS实例正常运行所需的数据(比如系统数据库.数据库回滚日志.重做日志.索引等).同时,包含如下云数据库 ...

  9. [Step By Step]SAP HANA中使用Excel展示分析视图数据(带层次结构)

    分析视图: 无层次结构:http://www.cnblogs.com/omygod/archive/2013/04/29/3050875.html 1. 打开Excel 2010,并将鼠标定位在某个s ...

最新文章

  1. 联想 k2450 温度、耗电试验
  2. java常用代码_Java 中常用代码 (欢迎补充)
  3. 新商业蓝皮书2021
  4. iptables防火墙工作原理及简单配置访问策略
  5. [C#]用Forms.TreeView显示Icon会有黑边
  6. 北大中文核心期刊目录(部分)
  7. 真正无广告的看书软件,免费可换源!-大萝卜博客网
  8. 视频教程-【深入理解计算机网络】讲师解读计算机网络原理视频课程(中)-计算机网络
  9. 全球及中国智能X光安检机行业研究及十四五规划分析报告
  10. python:series详解和数据获取
  11. 具象化的代码世界~~Emoji
  12. 安卓Web Service实现天气预报功能
  13. 物流行业智能化转型的幕后推手!盘点机器视觉物流分拣四大优势
  14. kbd(##盒子布局##)/kbd
  15. Meltdown:Reading Kernel Memory from User Space 论文中英对照
  16. Linux - top命令详解(监视进程和Linux整体性能)
  17. keil的c语言基础,KeilC单片机C语言应用研究入门基础篇要点S.doc
  18. 2021-04-15 测试面试题
  19. 商业汇票、银行本票、支票的区别
  20. 华为交换机基础命令配置

热门文章

  1. java redis tokenid_基于Spring及Redis的Token鉴权
  2. likeshop100%开源免费商用电商系统,PC商城、H5商城、小程序商城、安卓APP商城、苹果APP商城全部100%开源,免费商用
  3. 网页添加马赛克模糊插件工具
  4. web应用程序和Web网站区别
  5. 安装vs2008出现的问题
  6. viewState 与session[转]
  7. PHP无限极分类生成树方法,无限分级
  8. Shell编程: Shell 变量
  9. jQuery多选插件
  10. Linux安全 chage sudo授权 selinux安全上下文 gpg加密 aide入侵检测系统 audit 审计