全球主机交流论坛

标题: 甲骨文的的默认防火墙规则真睿智 [打印本页]

作者: proc    时间: 2021-8-17 15:33
标题: 甲骨文的的默认防火墙规则真睿智
系统镜像:CentOS 8

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

使用iptables命令排查,发现系统中有很多莫名其妙的规则
  1. Chain BareMetalInstanceServices (1 references)
  2. target     prot opt source               destination
  3. 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 */
  4. 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 */
  5. 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 */
  6. 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 */
  7. 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 */
  8. 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
  9. ………………………………………………………………
复制代码


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

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


解决方法: 删掉 /etc/firewalld/direct.xml
作者: proc    时间: 2021-8-17 15:34
也不知道是不是甲骨文为了推自家的Oracle Linux故意使坏,浪费了我整整两个小时
作者: Dwight    时间: 2021-8-17 15:36
了解了  感谢踩坑 但是可以选Ubuntu
作者: proc    时间: 2021-8-17 15:37
Dwight 发表于 2021-8-17 15:36
了解了  感谢踩坑 但是可以选Ubuntu

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




欢迎光临 全球主机交流论坛 (https://443502.xyz/) Powered by Discuz! X3.4