[ 上一页 ] [ 目录 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ A ] [ B ] [ C ] [ D ] [ E ] [ F ] [ G ] [ H ] [ 下一页 ]


Debian 手册安全
附录 F - 受防火墙保护的安全更新


在标准安装之后,系统可能仍然存在一些安全漏洞。除非您可以在另一个系统上下载易受攻击软件包的更新(或者您已镜像 security.debian.org 以供本地使用),否则系统必须连接到互联网才能进行下载。

然而,一旦您连接到互联网,您就暴露了这个系统。如果您的本地服务之一存在漏洞,您甚至可能在更新完成之前就被入侵!这可能看起来有些偏执,但实际上,蜜罐计划的分析表明,即使系统不是公开已知的(即,未在 DNS 记录中发布),系统也可能在不到三天的时间内被入侵。

当在没有像防火墙这样的外部系统保护的系统上进行更新时,可以正确配置您的本地防火墙,以限制仅涉及安全更新本身的连接。下面的示例展示了如何设置这种本地防火墙功能,它仅允许来自 security.debian.org 的连接,并记录所有其他连接。

以下示例可用于设置受限的防火墙规则集。从本地控制台(而不是远程控制台)运行这些命令,以减少将自己锁定在系统之外的可能性。

       # iptables -F
       # iptables -L
       Chain INPUT (policy ACCEPT)
       target     prot opt source               destination
     
       Chain FORWARD (policy ACCEPT)
       target     prot opt source               destination
     
       Chain OUTPUT (policy ACCEPT)
       target     prot opt source               destination
       # iptables -A OUTPUT -d security.debian.org --dport 80 -j ACCEPT
       # iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
       # iptables -A INPUT -p icmp -j ACCEPT
       # iptables -A INPUT -j LOG
       # iptables -A OUTPUT -j LOG
       # iptables -P INPUT DROP
       # iptables -P FORWARD DROP
       # iptables -P OUTPUT DROP
       # iptables -L
       Chain INPUT (policy DROP)
       target     prot opt source               destination
       ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
       ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0
       LOG        all  --  anywhere             anywhere           LOG level warning
     
       Chain FORWARD (policy DROP)
       target     prot opt source               destination
     
       Chain OUTPUT (policy DROP)
       target     prot opt source               destination
       ACCEPT     80   --  anywhere             security.debian.org
       LOG        all  --  anywhere             anywhere           LOG level warning

注意:在 INPUT 链中使用 DROP 策略是最正确的做法,但是在从远程连接刷新链后执行此操作时要非常小心。当从远程位置测试防火墙规则集时,最好运行一个包含防火墙规则集的脚本(而不是通过命令行逐行引入规则集),并且作为预防措施,保留一个后门[85]配置,以便在您犯错时可以重新启用对系统的访问。这样就不需要去远程位置修复阻止您的防火墙规则集。

待办事项:这需要 DNS 正常工作,因为 security.debian.org 的工作需要它。您可以将 security.debian.org 添加到 /etc/hosts,但现在它是一个指向多个主机的 CNAME(有多个安全镜像)。

待办事项:这仅适用于 HTTP URL,因为 ftp 可能需要 ip_conntrack_ftp 模块,或者使用被动模式。


[ 上一页 ] [ 目录 ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ A ] [ B ] [ C ] [ D ] [ E ] [ F ] [ G ] [ H ] [ 下一页 ]


Debian 手册安全

版本:3.13,Sun,2012 年 4 月 8 日 02:48:09 +0000

Javier Fernández-Sanguino Peña jfs@debian.org
作者,第 1.1 节