Oracle常见漏洞修复(Centos7.*)

Oracle常见漏洞修复(Centos7.*)


描述:

当扫出Oracle漏洞时,一般不建议进行补丁安装,由于进行补丁升级有很多不确定的因素,很有可能导致业务无法正常运行,建议采用iptables 限制1521端口,除了应用与运维ip访问外,全限制访问。

解决方法:

采用iptables限制1521端口

在执行以下命令时将导致业务短暂中断,请与用户沟通之后再操作,最好能停机操作

1.firewalld已开启状态,并已开放1521/tcp但未限制指定Ip

1.查看当前主机firewalld状态

[root@test ~]# firewall-cmd --list-all ##查看所有规则
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens33
  sources: 
  services: ssh dhcpv6-client
  ports: 1521/tcp ##已经放开1521端口,但未指定ip
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

在文本编辑器中准备防火墙规则; 收集使用到此数据库的应用服务器的ip、备份服务器ip、使用dblink连接到此数据库的ip、跳板机ip、监控服务器ip等相关服务器的ip,添加为防火墙规则,规则如下:

2.指定服务器IP 开启1521访问:

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.192.1" port protocol="tcp" port="1521" accept' ##每个服务器ip对应一行命令,实例的端口如有修改,请修改命令中对应的端口号 ,此行按服务器ip个数复制多行 xx.xx.xxx.xx需要改为实际环境中的ip地址
firewall-cmd --reload ##表示重载防⽕墙规则

3.移除端口1521/tcp的rich rule(执行这一步后数据库将处于无法连机的状态,应尽快执行防火墙规则)

firewall-cmd --remove-port=1521/tcp --permanent
firewall-cmd --reload 

在服务器命令行下执行2中准备好的防火墙规则

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.192.1" port protocol="tcp" port="1521" accept'
firewall-cmd --reload

检查各相关应用、在服务器上执行数据库状态检查,确定数据库服务正常,应用服务器连接正常。
回滚: 当出现异常或应用出现无法连接数据库的现象,请执行:

systemctl stop firewalld
systemctl disable firewalld
2.firewalld未开启状态

1.查看当前主机firewalld状态

[root@test ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

Jan 17 06:20:03 test systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan 17 06:20:04 test systemd[1]: Started firewalld - dynamic firewall daemon.
Jan 17 06:31:00 test systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jan 17 06:31:01 test systemd[1]: Stopped firewalld - dynamic firewall daemon.
Oct 15 20:32:54 test systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 15 20:32:54 test systemd[1]: Started firewalld - dynamic firewall daemon.
Oct 15 21:27:52 test systemd[1]: Stopping firewalld - dynamic firewall daemon...
Oct 15 21:27:53 test systemd[1]: Stopped firewalld - dynamic firewall daemon.

2.指定服务器IP 开启1521访问:

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.192.1" port protocol="tcp" port="1521" accept' ##每个服务器ip对应一行命令,实例的端口如有修改,请修改命令中对应的端口号 ,此行按服务器ip个数复制多行 xx.xx.xxx.xx需要改为实际环境中的ip地址
firewall-cmd --reload ##表示重载防⽕墙规则

3.在服务器上启动firewalld(执行这一步后数据库将处于无法连机的状态,应尽快执行防火墙规则)

systemctl start firewalld
systemctl enable firewalld

在服务器命令行下执行2准备好的防火墙规则

firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.192.1" port protocol="tcp" port="1521" accept'
firewall-cmd --reload

检查各相关应用、在服务器上执行数据库状态检查,确定数据库服务正常,应用服务器连接正常。
回滚: 当出现异常或应用出现无法连接数据库的现象,请执行:

systemctl stop firewalld
systemctl disable firewalld
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值