“Oracle_tns_listener远程投毒”故障处理
背景
某客户审计上发现生产库有一个Oracle监听远程投毒的告警。经过排查是数据库启用白名单之后,SCAN监听没有设置有效节点(白名单),非本地节点不能正常注册服务导致。重新配置并重启了SCAN监听,恢复SCAN监听的正常注册,保障了数据库安全稳定运行。
安全产品审计检查
“今天我们在审计上发现生产库有一个 Oracle监听远程投毒的告警。攻击者可以在不需要用户名密码的情况下利用网络中传送的数据消息,如果结合进行密码破解从而进一步影响甚至控制局域网内的任何一台数据库。
根据目前所查证的资料和报文确认如下
1、攻击者IP是生产库1节点虚IP,目标是生产库Scan地址。
2、官网相关CVE-2012-1675查证该类漏洞只出现在11G以下版本。
现在问题是我也不理解为什么我们19c也会出现这个漏洞,需要从别的角度看看这个会不会造成别的问题”
告警报文
告警日志(报文):(CONNECT_DATA=(COMMAND=service_register_NSGR))
问题原因:白名单
问题原因是数据库启用了白名单之后,SCAN监听没有设置有效节点(白名单),非本地节点不能正常注册服务导致。生产库的SCAN监听只注册了其中1个节点的服务,还有另外1个节点的服务未注册。由于生产数据库的SCAN监听只注册有一个节点的服务,另外一个节点的服务未注册成功,因此数据库集群不断的尝试重新注册服务到SCAN监听,以试图修复服务未能注册的问题,但是仍未成功,所以监听日志中出现了“(CONNECT_DATA=(COMMAND=service_register_NSGR))”被认为是远程投毒告警。
2节点的RAC中,通常listener_scan1通常每个service下面应该有2个instance,当前scan监听只注册了1个节点的服务,另外1个节点服务的未注册
[grid@host02 ~]$ lsnrctl status LISTENER_SCAN1
...
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 30-NOV-2023 18:08:15
Uptime 0 days 4 hr. 42 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.0.0/grid/network/admin/listener.ora
Listener Log File /u01/app/19.0.0/grid/network/log/listener_scan1.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.11)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
Service "pdb" has 1 instance(s).
Instance "pdb1", status READY, has 1 handler(s) for this service...
解决方案:设置SCAN监听的白名单
解决方法:为scan监听添加有效白名单节点之后,重新注册服务即可
su - grid
srvctl modify scan_listener -update -invitednodes "host01,host02"
su - oracle
sqlplus / as sysdba
alter system set remote_listener='scan-ip:1521' scope=both sid='*';
alter system register;
再次检查监听,已经能够正常注册
[grid@host02 ~]$ lsnrctl status LISTENER_SCAN1
...
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN1
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 30-NOV-2023 18:08:15
Uptime 0 days 4 hr. 42 min. 49 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/19.0.0/grid/network/admin/listener.ora
Listener Log File /u01/app/19.0.0/grid/network/log/listener_scan1.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.11)(PORT=1521)))
Services Summary...
Service "orcl" has 2 instance(s).
Instance "orcl1", status READY, has 1 handler(s) for this service...
Instance "orcl2", status READY, has 1 handler(s) for this service...
Service "pdb" has 2 instance(s).
Instance "pdb1", status READY, has 1 handler(s) for this service...
Instance "pdb2", status READY, has 1 handler(s) for this service...