프린트 하기

OS환경 : Oracle Linux 8.1 (64bit)

 

DB 환경 : Oracle Database 19.3.0.0

 

방법 : 오라클 19c ADMIN_RESTRICTIONS_LISTENER 파라미터 설정

ADMIN_RESTRICTIONS_LISTENER 파라미터는 lsnrctl 명령내의 설정(set 명령)을 수정할수 없게 막아주는 파라미터임
DB 취약점 진단 항목중 하나임
본문은 해당 파라미터 설정 방법 및 설정시 발생하는 현상을 확인해봄

 

 

테스트
기존 리스너 조회

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$ lsnrctl status
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 22-MAR-2024 07:55:38
 
Copyright (c) 1991, 2019, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                17-FEB-2024 09:21:38
Uptime                    33 days 22 hr. 34 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /ORA19/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Listener Log File         /ORA19/app/oracle/diag/tnslsnr/ora19/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora19)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "oracle19" has 1 instance(s).
  Instance "oracle19", status READY, has 1 handler(s) for this service...
Service "oracle19XDB" has 1 instance(s).
  Instance "oracle19", status READY, has 1 handler(s) for this service...
The command completed successfully

 

 

리스너 파라미터 변경 테스트

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
리스너 log_status 파라미터 확인
$ lnsrctl
LSNRCTL> show log_status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
현재 log_status 가 ON 상태임
 
리스너 log_status 파라미터 변경
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "log_status" set to OFF
The command completed successfully
LSNRCTL> set log_status on
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
정상적으로 ON/OFF로 변경됨
 
리스너 inbound_connect_timeout 파라미터 확인
LSNRCTL> show inbound_connect_timeout
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 60
The command completed successfully
현재 inbound_connect_timeout 가 60임
 
리스너 inbound_connect_timeout 파라미터 변경
LSNRCTL> set inbound_connect_timeout 50
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 50
The command completed successfully
LSNRCTL> set inbound_connect_timeout 60
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 60
The command completed successfully
정상적으로 값이 변경됨

set 명령어를 이용해 변경이 가능함

 

 

리스너 파일에 ADMIN_RESTRICTIONS 파라미터 설정
(ADMIN_RESTRICTIONS_{리스너명}으로 설정해야함
만약 리스너 이름이 LISTENER_TEST 라면 ADMIN_RESTRICTIONS_LISTENER_TEST로 설정해야함)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ vi $ORACLE_HOME/network/admin/listener.ora
#기존
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
 
#수정
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ora19)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
ADMIN_RESTRICTIONS_LISTENER=ON

 

 

리스너 reload

1
2
3
4
5
6
7
8
$ lsnrctl reload
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 22-MAR-2024 08:03:50
 
Copyright (c) 1991, 2019, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
The command completed successfully

 

 

리스너 파라미터 변경 테스트

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
리스너 log_status 파라미터 확인
$ lnsrctl
LSNRCTL> show log_status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "log_status" set to ON
The command completed successfully
현재 log_status 가 ON 상태임
 
리스너 log_status 파라미터 변경
LSNRCTL> set log_status off
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
TNS-12508: TNS:listener could not resolve the COMMAND given
TNS-12508 에러가 발생하면서 변경이 불가함
 
리스너 inbound_connect_timeout 파라미터 확인
LSNRCTL> show inbound_connect_timeout
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
LISTENER parameter "inbound_connect_timeout" set to 60
The command completed successfully
현재 inbound_connect_timeout 가 60
 
리스너 inbound_connect_timeout 파라미터 변경
LSNRCTL> set inbound_connect_timeout 50
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ora19)(PORT=1521)))
TNS-12508: TNS:listener could not resolve the COMMAND given
TNS-12508 에러가 발생하면서 변경이 불가함

set 명령어를 이용해 변경이 불가함

 

 

참고로 이 파라미터를 설정하더라도 위협이 되지않는 일부 파라미터는 set 명령으로 변경이 가능함

1
2
3
4
LSNRCTL> set current_listener listener_test
Current Listener is listener_test
LSNRCTL> set displaymode raw
Service display mode is RAW

 

 

결론 :
리스너 파일에 ADMIN_RESTRICTIONS_LISTENER 파라미터 설정시 lsnrctl 명령내의 설정(set 명령)을 불가함

 

 

참조 : 

2344311.1
https://docs.oracle.com/en/database/oracle/oracle-database/19/netrf/oracle-net-listener-parameters-in-listener-ora.html#GUID-8B74393D-4191-4151-B93E-76B20CD5E528
https://itinformation.tistory.com/456
https://jmkjb.blogspot.com/2017/08/oracle-adminrestrictionslistenername.html