阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

我们要不要为Oracle listener设置密码

132次阅读
没有评论

共计 3887 个字符,预计需要花费 10 分钟才能阅读完成。

在各种论坛中,以及一些数据库安全加固规范中,经常还看到有人强列建议为 Oracle listener 设置密码的说法,最近,笔者在帮一个单位审核所编制的一份 oracle 安全加固策略时,发现文中仍然在以不分版本情况下要求为 listener 设置密码。

随着 oracle 版本的升级变迁,当今运行的 oracle 数据库,是否真的还需要设置 listener 密码呢?是否还能在各类标准规范文档中不分版本的区别就直接将 listener 设置密码作为标准规范之一呢?

1、看看 10g 以前版本如何远程管理 listener

先来看一篇 metalink 上的文档 ID 460666.1(How To Remotely Administer a Listener),这是一篇关于如何远程管理 listener 的文章,文章的 APPLIES TO 部分,指出适应版本为“Oracle Net Services- Version: 8.1.7.4.0 to 9.2.0.8.0”,文章的 GOAL 部分,指出,在 10g 以前版本中,listener 程序可以管理远程机器的 listener,文中还给出在远程客户机器上关闭 listener 的方法,方法有两种:

第一种:客户端机器上直接以 lsnrctl <command><ip_address>:<port> 的方式实现,非常简单,如下所示:

lsnrctl status 192.168.1.100

lsnrctl stop 192.168.1.100:1522

–192.168.1.100 就是被远程管理的服务器 IP 地址,1522 为其端口

第二种:客户端机器上的 listner.ora 文件中配置远程机器的 listener 信息,如下:

Remote_lsnr =

      (DESCRIPTION =

              (ADDRESS =

                    (PROTOCOL = TCP) 

                    (Host = remote host)

                    (Port = listener port) 

      ) 

Where “remote host” and “listener port” are the host and port where the remote listener is running.

然后,在客户端机器上,就象管理本地 listener 方式一样管理远端 listener,如:

LSNRCTL> set current_listener Remote_lsnr

LSNRCTL> stop Remote_lsnr

从 460666.1 这篇文档中,其实已经看出来,在 10g 以前版本中,为 listener 设置密码的重要性。

2、再来看一篇 8i/9i 版本如何防止远程关闭 listener 的文档

Metalink 上的文档 ID 361738.1(How To PreventRemote Shutdown of the Oracle 8i/9i Listener),这是一篇关于如何防止 listener 被远程关闭的文章,该文中的 APPLIES TO 中明确指出:

Oracle Net Services – Version: 8.1.5.0.0 to 9.2.0.8.0
 Information in this document applies to any platform.
 This article applies only to listener versions prior to 10g.

该方法,只适合于 Version: 8.1.5.0.0 to 9.2.0.8.0,而不适合于 10 以上版本。

文中 SOLUTION 中的描述,对于 10g 以前版本,当然就是为 listener 设置密码了,这样,远程管理 listener 时,就必须要输入正确的密码才能完成操作。

3、那么 10g 以后 listener 不设置密码还安全吗?

再来看一篇 metalink 上的文档 ID 364388.1(How To NetworkSecure Your Oracle Database Listener in Intranet / Internet),这篇文档中的 SOLUTION 中,对于 10g 以上和 11gR2 版本对 listener password 的描述如下:

For 10g and higher listeners, no listener password is needed (starting with 11gr2 listener password is deprecated), instead we are using by default OS authentication mechanism – see  Note 260986.1 Setting Listener Passwords With an Oracle 10g or Newer Listener and Note 1328725.1 Deprecation of Listener Password in Oracle Database 11g Release

在 10g 以上版本中已经不需要为 listener 设置 password,在 11gR2 上,更是不赞成与反对设置 listener 密码,而是采用的默认本地主机操作系统认证。

4、那 oracle 10g 为什么还要保留 change password 功能呢。

再来看一篇上文中提到的 metalink 文档 ID 260986.1(SettingListener Passwords With an Oracle 10g or Newer Listener),这篇文档中的 GOAL 部分内容:

If the TNSListener is started as the “oracle” user and the user “sales” attempts
 to administer the listener, or if “oracle” on a different node attempts to
 administer the listener, the following error will be returned:

TNS-01190: The user is not authorized to execute the requested listener command

当 listener 是以 oracle 用户启动时,如果使用 OS 上的其它用户,例如,使用 sales 用户来管理 listener,如 stop 等操作,则会遇到”TNS-01190“信息,这时,sales 用户需要输入 listener 的 password 后才能操作本地 listener。

其实也可以控制本地启动 listener 的用户强制要求使用密码登陆,只需要在 listener.ora 文件中增加 LOCAL_OS_AUTHENTICATION_listener_name = OFF,但是只要是已经登入了 OS 的管理员或对 listener.ora 文件有权限的用户,都可以修改该文件去掉该行,所以该操作并不具有意义。

5、oracle 11gR2 不赞成与反对再为 listener 设置密码

再来看一篇 Metalink 文档 ID 1328725.1 (Deprecationof Listener Password in Oracle Database 11g Release 2),这是一篇关于 11gR2 已经刻弃 listener 设置密码的文章,该文章中的 DETAILS 中描述如下:

In Oracle Database 11g Release 2 (11.2), the password feature is being deprecated. This does not cause a loss of security because authentication is enforced through local operating system authentication.

Oracle11gR2 废弃 listener 设置密码,认为已经通过了本地操作系统的认证,所以是安全的。

文中 ACTIONS 部分列出,如果要使用远程管理 listener,只能通过 SSH 登陆到运行 listener 的本地主机,通过认证,然后本地管理 listener,或使用 oracle OEM 方式进行管理。

6、oracle 11gR2 官方对 listener 的安全说明与管理方式建议

Local listener administration is secure through local operating system authentication,

which restricts listener administration to the user who started the listener or to the

super user. By default, remote listener administration is disabled.

Oracle recommends that you perform listener administration in the default mode, and

access the system remotely using a remote login. When you administer the listener

remotely, use Oracle Enterprise Manager or Secure Shell (SSH) to access the remote

host.

本地 listener 管理默认为本地系统认证,这样限制了 listener 的管理者。默认情况下远程 listener 程序管理被禁用,建议采用 OEM 或 ssh 方式登陆目标端主机后进行管理。

更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-01/139921.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计3887字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中