TMAegis
Thêm quy tắc cho oracle-db

TMA-ORACLE-DB-6.1.9

Ensure 'ALTER SYSTEM' Is Revoked From Unauthorized 'GRANTEE'

CaoCấp 1Tự độngoracle-db

Mô tả

The Oracle database ALTER SYSTEM privilege allows the designated user to dynamically alter the instance's running operations. Unauthorized grantees should not have that privilege. Counts non-Oracle-maintained users and roles holding the privilege directly or through a role chain (CDB_SYS_PRIVS / CDB_ROLE_PRIVS); 0 is required, so every approved grantee must be reviewed and documented as an exception. Run on the database host as the Oracle software owner with ORACLE_HOME, ORACLE_SID and PATH set; connects to the CDB root with 'sqlplus -S / as sysdba' (OS authentication) so CDB_/GV$ views cover all open PDBs.

Cách kiểm tra

Phương pháp kiểm tra: Truy vấn SQL

sql_query
out=$(sqlplus -S -L / as sysdba 2>/dev/null <<'EOF'
whenever sqlerror exit failure
set heading off feedback off pagesize 0 verify off echo off trimspool on define off
with nm as (
  select role as grantee from cdb_roles where oracle_maintained = 'N'
  union select username from cdb_users where oracle_maintained = 'N'
),
direct_privs as (select grantee from cdb_sys_privs where privilege in ('ALTER SYSTEM')),
indirect_privs as (
  select grantee from cdb_role_privs
  start with granted_role in (select p.grantee from cdb_sys_privs p, cdb_roles r where p.privilege in ('ALTER SYSTEM') and p.grantee = r.role)
  connect by nocycle prior grantee = granted_role
)
select count(*) from (select grantee from direct_privs union select grantee from indirect_privs) c
where c.grantee in (select grantee from nm);
exit
EOF
) || exit 1
printf '%s\n' "$out"
Đầu ra mong đợi
0

Cách khắc phục

Phương pháp khắc phục: Hướng dẫn hoặc bản vá hạ tầng

To remediate this setting, execute the following SQL statement, keeping in mind if this is granted in both container and pluggable database, you must connect to both places to revoke. REVOKE ALTER SYSTEM FROM <grantee>;

Thuộc tính

Hệ điều hành
Bất kỳ
Thẻ
oracle-dbdatabaseoracleprivileges
Tham chiếu
CIS Oracle Database 23ai Benchmark v1.1.0 - 6.1.9 Ensure 'ALTER SYSTEM' Is Revoked From Unauthorized 'GRANTEE'

Kiểm tra máy này

Chạy lệnh này trên máy bạn được phép kiểm tra. Lần quét chỉ ở chế độ đọc.

shell
tmaegis scan --target oracle-db