找回密码
 立即注册
CeraNetworksBGVM服务器主机交流IP归属甄别会员请立即修改密码
查看: 34|回复: 3

甲骨文的的默认防火墙规则真睿智

[复制链接]

13

主题

421

回帖

949

积分

高级会员

积分
949
发表于 2021-8-17 15:33:29 | 显示全部楼层 |阅读模式
系统镜像:CentOS 8

遇到问题:控制台安全组已经完全放行。CentOS内部使用firewall-cmd放行80端口,但是始终无法连接;停用firewalld之后,可以连接。

使用iptables命令排查,发现系统中有很多莫名其妙的规则
[ol]
  • Chain BareMetalInstanceServices (1 references)
  • target     prot opt source               destination
  • ACCEPT     tcp  --  0.0.0.0/0            169.254.0.2          owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  • ACCEPT     tcp  --  0.0.0.0/0            169.254.2.0/24       owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  • ACCEPT     tcp  --  0.0.0.0/0            169.254.4.0/24       owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  • ACCEPT     tcp  --  0.0.0.0/0            169.254.5.0/24       owner UID match 0 tcp dpt:3260 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  • ACCEPT     tcp  --  0.0.0.0/0            169.254.0.2          tcp dpt:80 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation for security impact of modifying or removing this rule */
  • ACCEPT     udp  --  0.0.0.0/0            169.254.169.254      udp dpt:53 /* See the Oracle-Provided Images section in the Oracle Bare Metal documentation
  • ………………………………………………………………
  • [/ol]复制代码

    也就是说甲骨文通过某种方式插入很多自定义防火墙规则,结果破坏了firewalld的规则,导致外部访问失败。

    经过检查systemd日志,在firewalld的日志中发现了大量插入语句,最后发现甲骨文的规则隐藏在/etc/firewalld/direct.xml


    解决方法: 删掉 /etc/firewalld/direct.xml
  • 回复

    使用道具 举报

    13

    主题

    421

    回帖

    949

    积分

    高级会员

    积分
    949
     楼主| 发表于 2021-8-17 15:34:32 | 显示全部楼层
    也不知道是不是甲骨文为了推自家的Oracle Linux故意使坏,浪费了我整整两个小时
    回复

    使用道具 举报

    76

    主题

    763

    回帖

    2474

    积分

    金牌会员

    积分
    2474
    发表于 2021-8-17 15:36:20 | 显示全部楼层
    了解了  感谢踩坑 但是可以选Ubuntu
    回复

    使用道具 举报

    13

    主题

    421

    回帖

    949

    积分

    高级会员

    积分
    949
     楼主| 发表于 2021-8-17 15:37:27 | 显示全部楼层

    Dwight 发表于 2021-8-17 15:36

    了解了  感谢踩坑 但是可以选Ubuntu

    要用SELinux,只有红帽的系统支持
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|HS2V主机综合交流论坛

    GMT+8, 2024-6-1 21:36 , Processed in 0.056760 second(s), 3 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表