接上一篇 docker 容器安全与 firewalld;为了正常使用docker容器和firewalld,而不修改docker的daemon.json,按如下步骤个性firewalld规则,其本质上是修改ptables规则,修改完成后可以用iptables -nL
查看。
firewalld: 5 items found.
Question: How tp add a rule using firewall-cmd to drop/reject specific IP connecting to the server? This can be used as an added security on the server.
firewall-cmd is the most common method of managing firewalld configurations (both running as well as permanent). This tool is a part of the firewalld package.
docker 容器暴露的端口不会因 firewalld 防火墙策略阻断!
最近发现一个问题,docker run 了几个容器,暴雷了 8080, 9090 等等几个端口,一直以为 CentOS 有 firewalld 防火墙在,加了这些端口只允许内网访问,就可以高枕无忧了。
结果有次查看 netstat,居然有一些国外的 IP 连接。这才知道原来有防火墙,容器也不安全!
CentOS7一键安装SS服务端
-
- 2020/8/16 07:35
- Default
- shadowsocks centos 科学上网
- 2041
Summary omitted as the content was protected by password.
上篇讲到在win10环境,vmware的虚拟机内安装minikube之后,发现在访问minikube dashboard是无法跳转的。
这里解决方法:
1 开启代理,虚拟机外可以通过 8081端口访问
kubectl proxy --address='0.0.0.0' --disable-filter=true
2 虚拟机通过如下地址访问
http://your_api_server_ip:8001/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/
your_api_server_ip 换成虚拟机的外部IP,如192.168.136.111
如果有开firewalld,可以通过firewall-cmd --zone=public --add-port=8081/tcp --permanent
添加例外,或直接关闭防火墙