Friday, May 9, 2008

IT security audit - Information on Users,Privileges & Roles assigned

IT security audit
------------------
REM: This script generates the information about the user's
REM: privileges and roles and privileges assign to those
REM: roles, it is very usefull when doing IT security audit
REM:
REM:*****************************************
REM: NOTE: PLEASE TEST THIS SCRIPT BEFORE USE.
REM: Author will not be responsible for any damage that may be cause by this script.
REM:*****************************************

select lpad(' ', 3*level) || granted_role Users and roles privileges
from (
/* THE USERS */
select
null grantee,
username granted_role
from
dba_users
where
username in (select username from dba_users)
/* THE ROLES TO ROLES RELATIONS */
union
select
grantee,
granted_role
from
dba_role_privs
/* THE ROLES TO PRIVILEGE RELATIONS */
union
select
grantee,
privilege
from
dba_sys_privs
)
start with grantee is null
connect by grantee = prior granted_role;

No comments:

Post a Comment

Thanks for you valuable comments !