[系统审计]SAP HANA 中的系统审计策略管理

[系统审计]SAP HANA 中的系统审计策略管理

大家好,又见面了,我是全栈君。

基本语法:

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”

专注于企业信息化,最近对股票数据分析较为感兴趣,可免费分享股票个股主力资金实时变化趋势分析工具,股票交流QQ群:457394862
分类: 
SAP HANA

本文转自沧海-重庆博客园博客,原文链接:http://www.cnblogs.com/omygod/archive/2013/05/31/3111580.html,如需转载请自行联系原作者

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/108119.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 多线程处理mq消息_实现多线程有几种方式

    多线程处理mq消息_实现多线程有几种方式何为CMQ?腾讯云消息队列(CloudMessageQueue,CMQ)是一种分布式消息队列服务,它能够提供可靠的基于消息的异步通信机制,能够将分布式部署的不同应用(或同一应用的不同组件)之间的收发消息,存储在可靠有效的CMQ队列中,防止消息丢失。CMQ支持多进程同时读写,收发互不干扰,无需各应用或组件始终处于运行状态。——来源以及更多内容推荐看官方文档。…

    2025年7月8日
    3
  • Zigbee协议栈应用(一)——Zigbee协议栈介绍及简单例子[通俗易懂]

    Zigbee协议栈应用(一)——Zigbee协议栈介绍及简单例子[通俗易懂]1、Zigbee协议栈简介  协议是一系列的通信标准,通信双方需要按照这一标准进行正常的数据发射和接收。协议栈是协议的具体实现形式,通俗讲协议栈就是协议和用户之间的一个接口,开发人员通过使用协议栈来使用这个协议,进而实现无线数据收发。  如图1所示:Zigbee协议分为两部分,IEEE802.15.4定义了PHY(物理层)和MAC(介质访问层)技术规范;Zigbee联盟定义了NWK(网络层)、A…

    2022年5月28日
    41
  • WiFi安全漏洞KRACK深度解读

    WiFi安全漏洞KRACK深度解读前段时间爆出的WiFi安全漏洞KRACK,波及了全球的WLAN设备,无人幸免,也就是说wifi用户连接网络,不论是在公司,家里,还是咖啡馆,都有可能遭受攻击,问题时发现了一个,还有没有发现的,也许还更严重的问题,又该怎么办呢,如何规避协议层面的安全隐患,恐怕又是普通群众力所不及的。今天偶然看到一篇文章,文章对KRACK事件的技术缘由的进行了一番梳理剖析,纯技术系风格,看完后对此次爆出的安全漏洞有了

    2022年6月10日
    60
  • iocp是什么_acception

    iocp是什么_acception接受连接请求服务器要做的最普通的事情之一就是接受来自客户端的连接请求。在套接字上使用重叠I/O接受连接的惟一API就是AcceptEx()函数。有趣的是,通常的同步接受函数accept()的返回值是一个新的套接字,而AcceptEx()函数则需要另外一个套接字作为它的参数之一。这是因为AcceptEx()是一个重叠操作,所以你需要事先创建一个套接字(但不要绑定或连接它…

    2022年9月29日
    3
  • 华硕怎么安装linux系统教程,华硕笔记本系统如何安装win10和linux 双系统[通俗易懂]

    华硕怎么安装linux系统教程,华硕笔记本系统如何安装win10和linux 双系统[通俗易懂]稍微了整理了一下win10和linux双系统的安装教程,第一个选项是进入U盘linuxlive,等等)第一点设置boot挂载点。设置BIOS。然后点击试用用UBUNTU,但是windows上面的数据又删除不得,使用Ultraiso把LINUXUBUNTU14.X这个iso文件【写入硬盘影像】到U盘。第三个自己看,去正规的网站现在,6设置完毕,我这里设置了5GB其余的空间我全部分给/us…

    2022年7月24日
    7
  • 格雷码的实现[通俗易懂]

    格雷码的实现[通俗易懂]问题:产生n位元的所有格雷码。格雷码(GrayCode)是一个数列集合,每个数使用二进位来表示,假设使用n位元来表示每个数字,任两个数之间只有一个位元值不同。例如以下为3位元的格雷码: 000001011010110111101100。如果要产生n位元的格雷码,那么格雷码的个数为2^n.假设原始的值从0开始,格雷码产生的规律是:第一步,改变最右边的

    2025年6月3日
    2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号