Nebula Graph 端口全网监听问题

在使用 Nebula 过程中发现有些 44500 45500 端口是全网监听的

Local Address 是 :::44500 :::44501

可能存在安全问题,有什么办法可以解决吗,谢谢。

版本:Nebula 1.0.0
SSD 磁盘

[root@dggphicprd23312 ~]# netstat -ntulp |grep nebula
tcp        0      0 127.0.0.1:11000         0.0.0.0:*               LISTEN      20245/nebula-metad
tcp        0      0 127.0.0.1:11002         0.0.0.0:*               LISTEN      20245/nebula-metad
tcp        0      0 127.0.0.1:12000         0.0.0.0:*               LISTEN      8865/nebula-storage
tcp        0      0 127.0.0.1:12002         0.0.0.0:*               LISTEN      8865/nebula-storage
tcp        0      0 127.0.0.1:13000         0.0.0.0:*               LISTEN      20470/nebula-graphd
tcp        0      0 127.0.0.1:13002         0.0.0.0:*               LISTEN      20470/nebula-graphd
tcp        0      0 0.0.0.0:3699            0.0.0.0:*               LISTEN      20470/nebula-graphd
tcp6       0      0 :::45500                :::*                    LISTEN      20245/nebula-metad
tcp6       0      0 :::45501                :::*                    LISTEN      20245/nebula-metad
tcp6       0      0 :::44500                :::*                    LISTEN      8865/nebula-storage
tcp6       0      0 :::44501                :::*                    LISTEN      8865/nebula-storage

部分storage conf

########## basics ##########
# Whether to run as a daemon process
--daemonize=true
# The file to host the process id
--pid_file=pids/nebula-storaged.pid

########## logging ##########
# The directory to host logging files, which must already exists
--log_dir=logs
# Log level, 0, 1, 2, 3 for INFO, WARNING, ERROR, FATAL respectively
--minloglevel=0
# Verbose log level, 1, 2, 3, 4, the higher of the level, the more verbose of the logging
--v=0
# Maximum seconds to buffer the log messages
--logbufsecs=0

########## networking ##########
# Meta server address
--meta_server_addrs=10.243.65.200:45500,10.243.71.86:45500,10.247.162.39:45500
# Local ip
--local_ip=10.243.65.200
# Storage daemon listening port
--port=44500
# HTTP service ip
--ws_ip=127.0.0.1
# HTTP service port
--ws_http_port=12000
# HTTP2 service port
--ws_h2_port=12002

麻烦补充下必要的 版本信息、和硬件磁盘信息,补充完之后帖子会取消隐藏的~

已修改

1 个赞

服务监听端口通常默认都是全网监听。来源IP限制通常是放在其他层面来做比如防火墙(软件/硬件)。

限制来源IP在应用层面通常的做法有配置监听地址(应用层)。这种通常只是出于功能性上的保证。
通过配置系统的防火墙或者网络出口的物理防火墙规则,可以有效的保护服务安全。

建议使用系统自带的防火墙服务,如ubuntu的ufw,centos的firewalld来保护服务。会比应用层面的监听IP限制更安全。

谢谢,好的。假设我用iptables限制的话默认只需要限制 3699 44500 44501 45500 45501 这五个端口就可以是吧

在你的案例中这样做是可以的

为什么45500 和45501 这些端口使用的是tcp6协议但是3699使用的是tcp协议呢

这是docker的一个技术细节,有的服务支持以ipv6来同时服务ipv4+ipv6通信。有些则不然。

可以参考这篇文章了解这种情况的原理。docker发现端口是tcp6的 导致无法访问前端 - brady-wang - 博客园