请注意:我没有兴趣把它变成一场火焰战争! 我知道很多人对这个问题持有强烈的信念,其中很大一部分是因为他们在防火墙解决scheme上付出了很多的努力,也因为他们已经灌输了相信他们的必要性。
但是,我正在寻找安全专家的答案。 我相信这是一个重要的问题,答案不仅仅是我自己和我工作的公司。 我一直在运行我们的服务器networking几年没有妥协,没有任何防火墙。 我们所拥有的安全妥协都不能通过防火墙来防止。
我想我在这里工作太久了,因为当我说“服务器”时,我一直是指“提供给公众的服务”,而不是“秘密的内部计费数据库”。 因此,任何防火墙的规则都必须允许访问整个互联网。 另外,我们的公共访问服务器都在独立于我们办公室的专用数据中心。
其他人问了一个类似的问题,我的答案被投入负数。 这使我相信,投票的人不是真正理解我的答案,或者我不了解安全性,足以做我现在正在做的事情。
这是我的服务器安全方法:
在将我的服务器连接到Internet 之前,请遵循我的操作系统的安全指南 。
使用TCP包装器将对SSH(和其他pipe理服务)的访问限制为less量的IP地址。
用Munin监视这个服务器的状态。 并修复默认configuration中Munin-node固有的极端安全问题。
Nmap我的新服务器(也将我的服务器连接到Internet之前)。 如果我要防火墙这个服务器,这应该是传入连接应该限制到的端口的确切集合。
在服务器房间安装服务器,并给它一个公共IP地址。
使用我的操作系统的安全更新function保证系统的安全。
我的哲学(和问题的基础)是强大的基于主机的安全性消除了防火墙的必要性。 总体安全理念指出,即使您有防火墙,仍然需要强大的基于主机的安全性(请参阅安全指导原则 )。 这样做的原因是,将公共服务转发到服务器的防火墙使攻击者可以根本就没有防火墙。 服务本身是脆弱的,而且由于向整个互联网提供服务是其运营的一个要求,限制访问它并不是重点。
如果服务器上有不需要整个Internet访问的端口,则需要在步骤1中closures该软件,并通过步骤4进行validation。如果攻击者通过易受攻击的软件成功入侵服务器并自己打开一个端口,攻击者可以(也可以)通过在一个随机端口上build立一个出站连接来轻松击败任何防火墙。 安全的关键不是在成功的攻击之后为自己辩护 – 这已经被certificate是不可能的 – 那就是把攻击者放在首位。
有人build议,除开放端口之外,还有其他的安全考虑 – 但对我来说,这听起来像是捍卫自己的信仰。 无论是否存在防火墙,任何操作系统/ TCP堆栈漏洞都应该同样易受攻击 – 基于端口直接转发到该操作系统/ TCP堆栈的事实。 同样,在服务器本身上运行防火墙,而不是在路由器上(或者更糟糕的是,在两个地方)运行防火墙似乎会增加不必要的复杂层次。 我了解“安全层出不穷”的理念,但是有一个问题就像build造一个屋顶,把多个胶合板层叠在一起,然后在它们上面钻一个洞。 另一层胶合板不会阻止你故意制造的漏洞。
说实话,我认为防火墙只能用于服务器,如果它有dynamic的规则阻止所有服务器连接到已知的攻击者 – 比如垃圾邮件的RBL(这恰好与我们的邮件服务器差不多) 。 不幸的是,我找不到任何防火墙。 第二好的是IDS服务器,但是假设攻击者不首先攻击你的真实服务器,而攻击者在攻击之前费力地探测你的整个networking。 此外,这些已知会产生大量的误报。
防火墙的优点:
最重要的是,如果你没有防火墙,系统受到威胁,那么你会如何检测到它? 试图在本地系统上运行一些命令“ps”,“netstat”等是不可信的,因为这些二进制文件可以被replace。 不保证远程系统的'nmap',因为攻击者可以确保root-kit在选定的时间只接受来自所选源IP地址的连接。
硬件防火墙有助于在这种情况下,与主机操作系统/文件相比,更改防火墙操作系统/文件非常困难。
防火墙的缺点:
TCP Wrappers可以说是被称为基于主机的防火墙实现; 你正在过滤networkingstream量。
对于攻击者在任意端口上进行出站连接的一点,防火墙也会提供控制出站stream量的手段; 正确configuration的防火墙以适合与系统相关的风险的方式pipe理入口和出口。
关于如何防止任何TCP漏洞的防火墙,你不熟悉防火墙如何工作。 思科有一整套可供下载的规则,用于识别以特定操作系统问题的方式构build的数据包。 如果你抓住Snort并用正确的规则集开始运行,你也会在这种事情上得到警报。 当然,Linux iptables可以过滤掉恶意的数据包。
基本上,防火墙是主动的保护。 从积极的态度中走得越远,最有可能发现自己处于对问题做出反应而不是预防问题的情况下。 集中在边界的保护,就像专门的防火墙一样,让事情更容易pipe理,因为你有一个中心的瓶颈,而不是在任何地方重复规则。
但是没有一件事情是最终的解决办法。 一个好的安全解决scheme通常是多层的,在边界有一个防火墙,在设备上有TCP封装,并且在内部路由器上也可能有一些规则。 您通常应该保护networking免受互联网的影响,并保护节点之间的距离。 这种多层次的方法不像在多层胶合板上钻孔,更像是把一扇门放在一起,所以入侵者有两个锁而不是一个锁; 这被称为人身安全的陷阱,每个build筑物的大部分都有一个理由。 🙂
(你可能想阅读“ 没有防火墙的人生 ”)
现在:有没有补丁发布的遗留系统呢? 那么在你需要的时候不能将补丁应用到N-machine上,同时你可以将它们应用到networking中更less的节点上(防火墙)呢?
辩论防火墙的存在或需要是毫无意义的。 真正重要的是你必须实施安全策略。 要做到这一点,您将使用任何工具来实现它,并帮助您pipe理,扩展和发展它。 如果需要防火墙,那就好了。 如果他们不需要,那也可以。 真正重要的是有一个工作和可validation的安全政策的实施。
你的大部分解释似乎都反驳了对防火墙的需求,但我不认为有一个,除了less量的时间来设置一个。
很less有东西是严格意义上的“必然”。 安全更多的是设置你所有的封锁。 闯入服务器所需的工作量越多意味着攻击成功的可能性越小。 你想让更多的工作闯入你的机器,而不是别的地方。 添加防火墙可以做更多的工作。
我认为一个关键的用途是安全冗余。 另外一个好的防火墙是你可以简单地放弃连接到任何端口的尝试,而不是响应被拒绝的请求 – 这会给攻击者带来一些麻烦。
对于我来说最重要的是,您可以将SSH,ICMP和其他内部服务locking到本地子网,并对传入连接进行速率限制,以帮助减轻DOS攻击。
“安全的关键不是在成功的攻击之后为自己辩护 – 这已经被certificate是不可能的 – 那就是把攻击者放在首位。”
我不同意。 限制损害赔偿可能同样重要。 (在这个理想的情况下,为什么哈希密码?或者把你的数据库软件放在与你的networking应用程序不同的服务器上?)我想这句老话说“不要把所有的鸡蛋都放在一个篮子里”。
Should I firewall my server?
好问题。 似乎没有什么意思把一个防火墙放在一个networking堆栈之上,这个networking堆栈已经拒绝了连接尝试,除了less数合法打开的端口外。 如果操作系统中存在一个允许恶意制作的数据包中断/利用主机的漏洞, 运行在同一主机上的防火墙是否可以防止这种攻击? 好吧, 也许 …
这可能是在每台主机上运行防火墙的最强有力的原因:防火墙可能会阻止networking堆栈漏洞被利用。 这足够强大吗? 我不知道,但我想可以这样说,“没有人因为安装防火墙而被解雇。”
在服务器上运行防火墙的另一个原因是解耦这两个强烈相关的问题:
如果没有防火墙,运行中的一组服务(以及tcpwrappers等的configuration)完全决定了服务器将要打开的端口集合,以及从哪个端口接受连接。 基于主机的防火墙为pipe理员提供了更多的灵活性,以便在受控方式下安装和testing新服务,然后才能使其更加广泛地可用。 如果不需要这种灵活性,那么在服务器上安装防火墙的理由就会减less。
最后要说的是,我总是添加一个安全检查列表中没有提到的项目,这是一个基于主机的入侵检测系统(HIDS),如AIDE或samhain 。 一个好的HIDS使入侵者非常难以对系统进行不必要的改变,并且不被发现。 我相信所有的服务器都应该运行某种HIDS。
防火墙是一种工具。 它本身并不能保证安全,但它可以在安全的networking中作为一个层次作出贡献。 这并不意味着你需要一个,我当然担心那些不明白自己为什么这样想,不懂防火墙的优点和缺点的人会盲目地说“我必须得到防火墙”。
有很多工具,我们可以说我们不需要…是否有可能没有防病毒运行Windows计算机? 是的,但这是一个很好的保险层。
关于防火墙,我会这么说 – 无论你怎么说,他们都是很好的保险。 他们不能替代补丁,locking机器,禁用不用的服务,login等等,但它们可以是一个有用的补充。
我还build议这个方程会有所不同,具体取决于你是否正在讨论把防火墙放在一群精心打理的服务器之前,或者是一个典型的工作站和服务器混合局域网尽pipeIT团队付出了最大的努力和希望,但其中一些可能会运行一些相当多毛的东西。
还有一件事要考虑的是创build一个明显变硬的目标的好处。 可见的安全,无论是明亮的灯光,沉重的锁和build筑物上的明显的警报箱; 或者一个明显的IP地址范围内的防火墙可以阻止偶然的入侵者 – 他们会去寻找更容易的猎物。 这不会阻止那些知道自己有信息并决心获得信息的入侵者,但是阻止不经意的入侵者仍然是值得的 – 特别是如果你知道任何入侵者的探测持续超过威慑需要特别重视。
防火墙是额外的保护。 networking堆栈攻击(即您的服务器操作系统对从未达到端口级别的特制数据包有一定的漏洞),成功的入侵连接到“电话之家”(或发送垃圾邮件等) ),或者成功入侵,打开服务器端口,或者更less检测到,在打开端口之前监视端口敲击序列。 当然,最后两个与减轻入侵的破坏而不是阻止它有关,但这并不意味着它是无用的。 请记住,安全并不是一个全有或全无的命题。 一个采取分层的方法,腰带和吊带,以达到足够的安全水平,以满足您的需求。
所有伟大的问题。 但是 – 我感到非常惊讶性能没有被带到桌子上。
对于高度(CPU方式)使用的Web前端,本地防火墙确实会降低性能,时间。 尝试一个负载testing,看看。 我看到了这么多次 closures防火墙可提高性能(请求每秒)70%或更多。
这个折衷必须考虑。
我不是任何安全专家,但听起来好像你是防火墙。 看起来好像你已经采取了一些防火墙的核心function,并使其成为你的政策和程序的一部分。 不,如果你要自己做和防火墙一样的工作,你不需要防火墙。 至于我自己,我宁愿尽我所能保持安全,但是防火墙看着我,但是在某个时候你可以做防火墙所做的一切,它就开始变得无关紧要了。
小型设置当然不需要防火墙。 如果您有一台或两台服务器,软件防火墙是可维护的。 有了这个说法,我们不会没有专门的防火墙运行,而且我坚持这个理念有几个原因:
angular色的分离
服务器用于应用程序。 防火墙用于数据包检查,过滤和策略。 Web服务器应该担心提供网页,就是这样。 将这两个angular色放在一个设备上就像是要求你的会计师也是你的保安人员。
软件是一个移动的目标
主机上的软件总是在变化。 应用程序可以创build自己的防火墙例外 OS被更新和修补。 服务器是高stream量的“pipe理”区域,您的防火墙策略/安全策略通常比安全configuration更重要。 在Windows环境中,假设有人在某些组策略级别出错,并在桌面PC上closures了Windows防火墙,但并没有意识到它将被应用到服务器上。 点击次数可以大大提高。
就更新而言,防火墙固件更新通常每年出现一次或两次,而操作系统和服务更新是一个持续不断的stream程。
可重复使用的服务/策略/规则,可pipe理性
如果我设置一个名为“Web服务器”的服务/策略(如TCP 80和TCP 443),并将其应用于防火墙级别的“Web服务器组”,则效率会更高(一些configuration更改)并且比在10个盒子上设置防火墙服务以及开放2个端口×10倍成倍地减less人为错误。 当这个政策需要改变的时候,这个数字是1比10。
在攻击期间或者妥协之后,我仍然可以pipe理防火墙
假设我的基于主机的防火墙+应用程序服务器受到攻击,CPU不在图表中。 甚至开始弄清楚发生了什么事情,我受到的负担小于攻击者甚至进入并看看它。
一个实际的经验 – 我曾经搞砸了一个防火墙规则(把端口留给ANY而不是一个特定的服务器,而服务器有一个易受攻击的服务),而且攻击者实际上有一个活动的远程桌面会话。 每当我开始进行会话时,攻击者就会杀掉/断开会话。 如果不是能够closures来自独立防火墙设备的攻击,情况可能会更糟糕。
独立监测
login专用防火墙单元通常远远优于基于主机的软件防火墙。 有些甚至不需要外部的SNMP / NetFlow监控软件来获得准确的图像。
IPv4保护
没有理由有两个IP地址,如果一个是networking,一个是邮件。 将服务保留在单独的盒子上,并通过专门devise的设备适当地路由端口。
Blockquote好吧,你是对的,我没有把任何缺点放在那里。 缺点:增加了networking复杂度,单点故障,带宽瓶颈的单一networking接口。 同样,在一个防火墙上犯的pipe理错误可能会导致整个networking中断。 同时,在20分钟的服务器机房之旅中,上帝禁止你将自己锁在外面。
首先,通过networking至多添加一个额外的路由跳并不复杂。 其次,没有任何单点故障的防火墙解决scheme是完全没有用的。 就像您将重要的服务器或服务集群并使用绑定的NIC一样,您可以实现高度可用的防火墙。 不这样做,或者不承认,并知道你会这样做是非常短视的。 简单地说,有一个单一的界面不会自动成为一个瓶颈。 该断言表明,您不知道如何正确规划和部署防火墙,以处理stream经networking的stream量。 你说对策中的错误可能会对整个networking造成伤害是正确的,但我认为在所有服务器上维护单个策略更容易出错。
至于你跟上安全补丁和遵循安全指南的论点, 充其量,这是一个不稳固的说法。 通常情况下,安全修补程序在发现漏洞之后才可用。 这意味着,在您运行可公开寻址的服务器的整个过程中,它们在被修补之前都是易受攻击的。 正如其他人所指出的,IPS系统可以帮助防止此类漏洞的妥协。
如果你认为你的系统是安全的,那么这是一个很好的信心。 不过,我build议您在您的networking上执行专业的安全审计。 它可能只是睁开你的眼睛。
一般来说,安全是一个洋葱的事情,正如已经提到的那样。 有防火墙存在的原因,而不是所有其他旅鼠是愚蠢的白痴。
这个答案来了,因为在这个页面上search'fail2ban'没有给我任何结果。 所以,如果我加倍其他内容,忍受我。 对不起,如果我咆哮了一下,我可以提供一些简单的经验,因为这对于其他人来说可能会派上用场。 🙂
这是Linux特有的,主要集中在基于主机的防火墙上,这通常是用例。 外部防火墙与正确的networking结构并行,其他的安全考虑通常也是如此。 要么你知道这里暗示什么,那么你可能不需要这个post。 或者你不知道,那么只是阅读。
在外部和本地运行防火墙可能看起来不符合直觉和双重工作。 但是这也给了外部规则可能性的转变,而不会危及其后面的所有其他主机的安全性。 这个需求可能来自debugging的原因,也可能是因为有人刚刚搞砸了。 另一个用例将在“自适应全局防火墙”一节中介绍,对此,您还需要全局和本地防火墙。
防火墙只是适当的安全系统的一个方面。 不安装防火墙,因为它“花钱”,引入SPOF或任何只是废话,请原谅我的法语在这里。 只需设置一个群集。 哦,但是如果消防单元发生故障呢? 然后在跨越两个或更多的防火隔间设置您的群集。
但是,如果整个数据中心无法接通,因为两家外部运营商都无法正常工作(挖掘机会导致光纤损坏)? 然后,让您的集群跨越几个数据中心。
这太贵了? 集群太复杂了? 那么,偏执必须要付钱。
只是抱怨SPOFs,但不想多付钱或创造一些更复杂的设置,这显然是双重标准,或公司或客户方面的一个小钱包。
这种模式适用于所有这些讨论,无论哪种服务是当前的事情。 无论是VPN网关还是仅用于防火墙的Cisco ASA,MySQL或PostgreSQL数据库,虚拟系统或服务器硬件,存储后端,交换机/路由器,…
现在你应该明白了。
从理论上讲,你的推理是正确的。 (只有正在运行的服务可以被利用。)
但这只是事实的一半。 防火墙,特别是有状态的防火墙可以为您做更多的事情。 无状态防火墙只有在遇到像其他人一样的性能问题时才是非常重要的。
你提到的TCP包装,基本上实现相同的function,以确保您的安全。 为了争论,让我们假设有人不知道tcpd
并喜欢使用鼠标? fwbuilder
可能会想到。
从pipe理networking完全访问是您应该启用的东西,这是您的基于主机的防火墙的第一个用例。
怎么样的多服务器设置,其中的数据库运行在别的地方,你不能把所有的机器都放在一个共享的(私有的)子网内出于任何原因? 使用防火墙只允许对其他服务器的单个给定的IP地址在端口3306上进行MySQL访问,完成,简单。
而且对于UDP也是完美的。 或者任何协议。 防火墙可以非常灵活。 ;)
而且,通过防火墙,可以检测和缓解一般的端口扫描,因为可以通过内核及其networking堆栈监视每个时间段的连接数量,防火墙可以采取措施。
无效或不明确的数据包可以在他们到达您的应用程序之前处理。
过滤出站stream量通常是一个痛苦的屁股。 但根据合同,这可能是必须的。
统计数据是防火墙可以给你的另一件事情。 (想watch -n1 -d iptables -vnxL INPUT
,在顶部添加一些特殊IP地址的规则,看是否有数据包通过。)
你可以在平淡的日光下看到事物是否有效,或者事物是否有效。 在对连接进行故障诊断时,这是非常有用的,并且能够通过电话告诉其他人你不会收到数据包,而不必诉诸chatty tcpdump
。 networking是有趣的,大多数人现在只知道他们在做什么,往往只是简单的路由错误。 地狱,即使我并不总是知道我在做什么。 虽然我已经使用了几十个复杂的系统和设备,而且现在也经常使用隧道技术。
第七层防火墙通常是蛇油(IPS / IDS),如果没有正确地出席并定期更新。 再加上许可证是非常昂贵的,所以如果你没有真正的需要让所有的钱都能买到你,
很简单,只要用你的包装试试这个。 :d
看伪装。
如果客户拥有dynamicIP地址,并且没有部署VPN设置,那又如何呢? 还是其他dynamic的防火墙方法? 这已经暗示在这个问题上,这里将会出现一个用例。 不幸的是,我找不到任何防火墙。 部分。
通过密码禁用root帐户访问是必须的。 即使访问仅限于某些IP地址。
此外,如果ssh密钥丢失或部署失败,仍然有另一个blanko帐户准备好密码login是非常方便的,如果事情真的错了(用户有pipe理权限的机器和“事情发生”?)。 networking访问是一样的,因为它在Linux上是单用户模式,或者通过grub
使用init=/bin/bash
进行本地访问确实非常糟糕,无论如何都不能使用活动磁盘。 不要笑,有虚拟化产品禁止这一点。 即使function存在,如果一个过时的软件版本运行缺乏function呢?
无论如何,即使你在一些深奥的端口上运行你的ssh守护进程,而不是在22端口上运行,如果没有实现像端口敲打(甚至打开另一个端口并因此减轻端口扫描,慢慢地接近太不切实际)的事情,端口扫描将检测到服务最终。
通常您也会为了效率的原因,将所有configuration相同的服务器设置为相同的端口和服务。 你不能在每台机器上设置ssh到不同的端口。 而且,每当您将其视为“公共”信息时,您也无法在所有机器上更改它,因为它已经在扫描之后。 nmap
是否合法的问题不是一个问题时,您可以使用被黑客入侵的Wi-Fi连接。
如果这个帐户没有被命名为“root”,那么人们可能无法猜测您的“后门”的用户帐户名称。 但是他们会知道,如果他们从你的公司获得另一台服务器,或者只是购买一些网站空间,并且在/etc/passwd
有一个unchrooted / unjailed / uncontainered的外观。
现在纯粹的理论说明,他们可以在那里使用一个可破解的网站来访问你的服务器,并查看你的位置通常是如何运行的。 你的黑客search工具可能无法全天候运行(通常他们在晚上出于文件系统扫描的磁盘性能的原因?),你的病毒扫描程序不会更新第二个新的零日看到的一天,所以它会没有立即发现这些事情,没有其他的保护措施,你可能永远不知道发生了什么。 为了回到现实中,如果有人可以使用零日漏洞,那么他很可能不会将服务器作为目标,因为这些服务器价格昂贵。 这只是为了说明如果“需要”出现,总是有一种方法进入系统。
但在这个话题上,只是不要使用额外的密码帐户,不要打扰? 请继续阅读。
即使攻击者获取这个额外帐户的名称和端口, fail2ban
+ iptables
组合也可以阻止他们短小,即使您只使用八个字母的密码。 另外fail2ban也可以实现其他服务,拓宽监控范围!
对于你自己的服务,如果需要的话:基本上每个服务logging失败的文件都可以通过提供一个文件来获得fail2ban的支持,什么正则expression式匹配以及允许多less次失败,防火墙会高兴地禁止每个IP地址被告知。
我不告诉使用8位密码! 但是如果他们被禁止24小时进行五次错误的密码尝试,你可以猜测,如果他们没有僵尸networking即使有这么糟糕的安全性,他们也要尝试多长时间。 而且,你会惊讶于客户倾向于使用的密码,而不仅仅是ssh
。 通过Plesk查看人们的邮件密码,告诉你所有你不想知道的事情,如果你曾经这样做,但是我当然不想在这里暗示。 🙂
fail2ban
只是一个使用iptables -I <chain_name> 1 -s <IP> -j DROP
,但是你可以使用一些Bash魔法很快地自己创build这些东西。
To further expand something like this, aggregate all fail2ban IP addresses from servers within your network on an extra server, that curates all the lists and passes it in turn to your core firewalls blocking all the traffic already on the edge of your network.
Such functionality cannot be sold (of course it can, but it will just be a brittle system and suck), but has to be interweaved into your infrastructure.
While at it, you can also use blacklist IP addresses or lists from other sources, be it aggregated by yourself or external ones.
In the physical world, people secure valuables by putting them in safes. But there is no safe that cannot be broken into. Safes, or security containers, are rated in terms of how long it takes to force entry. The purpose of the safe is to delay the attacker long enough that they are detected and active measures then stop the attack.
Similarly, the proper security assumption is that your exposed machines will, eventually, be compromised. Firewalls and bastion hosts are not set up to prevent your server (with your valuable data) from compromise, but to force an attacker to compromise them first and allow you to detect (and deter) the attack before the valuables are lost.
Note that neither firewalls nor bank vaults protect against insider threats. That's one reason for bank accountants to take two weeks leave consecutively, and for servers to have full internal security precautions even though protected by bastion hosts.
You seem to imply in the original post that you are forwarding "outside world" packets through your firewall directly to your server. In that case, yes, your firewall isn't doing very much. A better perimeter defense is done with two firewalls and a bastion host, where there is no direct logical connection from outside to inside — every connection terminates in the DMZ bastion host; every packet is examined appropriately (and possibly parsed out) before forwarding.
Vulnerabilities are hard to predict. It is practically impossible to predict which way your infrastructure is going to get exploited. Having a firewall "raises the bar" for an attacker wanting to exploit a vulnerability, and this is the important part, BEFORE you know what that vulnerability is. Additionally, the ramifications of the firewall can be easily understood in advance, so you are unlikely to CAUSE problems with a firewall which are more severe than the problems you are likely to avoid.
This is why "nobody ever got fired for installing a firewall". Their implementation is very low risk, and has a HIGH likelihood of either preventing or mitigating an exploit. Also, most really nasty vulnerabilities end up being exploited by automation, so anything "unusual" will end up breaking a bot, or at least get it to skip you in favor of an easier target.
Side note; firewalls are not for the internet only. Your accounting dept. doesn't need ssh/whatever to your ldap server, so don't give it to them. Compartmentalizing internal services can make a big difference to the cleanup job in the event that something DOES breach the castle walls.
Have to say Ernie that whilst you seem do a lot to harden your servers and mitigate against attacks and vulnerabilities, I don't agree with your stance on firewalls.
I treat security a bit like an onion in that ideally you have layers that you have to get through before you get to the core, and personally I think it's grossly misguided not to have some form of hardware firewall at your network perimeter.
I'll admit I'm coming at this from the "what I'm used to" angle, but I know that every single month I get a nice little list of that months patches from Microsoft, many of them being exploited in the wild. I'd imagine the same happens for pretty much any OS and set of applications you care to think of.
Now I'm not suggesting firewalls do away with this, nor are firewalls immune to having bugs/vulnerabilities, obviously a "hardware" firewall is just software running on a hardware stack.
That said, I sleep a lot safer knowing that if I have a server that needs only port 443 to be accessible from the web, my perimeter Juniper ensures that only port 443 is accessible from the web. Not only that but my Palo Alto ensures that the traffic coming in is decrypted, and inspected, and logged, and scanned for IPS/IDS – not that it does away with the need to keep the server(s) secure and up to date, but why would you NOT find that a benefit given that it can mitigate for zero-day exploits and good old human error?
First of all, by your talk about port forwarding, I think you're conflating firewalling with NATing. While these days NATs very often function as de facto firewalls, that it is not the purpose for which they were designed. NAT is a routing tool. Firewalls are for regulating access. It's important for clarity of thought to keep these concepts distinct.
It is of course true that putting a server behind a NAT box and then configuring the NAT to forward anything to that server, is no more secure than putting the server directly on the Internet. I don't think anyone would argue with this.
Similarly, a firewall configured to allow all traffic is no firewall at all.
But, is "allow all traffic" really the policy you want? Does anyone ever have a need to ssh to any of yours servers from a Russian IP address? While you're tinkering with the configuration of some new experimental network daemon, does the whole world really need access to it?
The power of a firewall is that it lets you keep open only those services that you know need to be open and maintain a single point of control for implementing this policy.
Stateful packet inspection firewalls do NOT belong in front of public servers. You're accepting all connections, so the state tracking is pretty useless. Traditional firewalls are a huge liability in DDoS attacks and are typically the first thing to fail under DDoS attack, even before link bandwidth or server resources are totally consumed.
Stateless packet filters on routers do make sense in front of public servers, but only if they can handle line rate of all the ingress and egress traffic (such as a hardware ACL in a router).
Google, Facebook, and even Microsoft do not put traditional "firewalls" in front of public servers. Anyone who has run public web services at "more than one server" scale should know this.
Other functions found in traditional firewalls such as Cisco ASAs or whatever are best implemented on the hosts themselves, where they can be scaled out effectively. Logging, IDS, etc. are all software features in firewalls anyway, so they just become a huge bottleneck and DDoS target if put in front of publicly accessible servers.
Why do all of your servers need a public address?
Install the server in the server room and give it a public IP address.
Out of 14 or so servers that I run on a regular basis, only 2 have publicly accessible interfaces.
Edited to add : In other networks that I've had a hand in managing, we've had the ability to turn off/on services at will, whereas we didn't have access to manage the firewall. I cannot even begin to tell you how many times, inadvertently of course, an unneeded service (SMTP) got turned on and left on and the only thing saving us from becoming a spam dump and getting blacklisted in the process, was a firewall.
Also, is all of the traffic that passes between servers, fully encrypted?
You can certainly drive a car 100 mph with no seatbelts, no airbags and bald tires, but why would you??
Firewalls can prevent system users from opening up network-accessible services that the administrators aren't aware of, or doing port forwarding to other machines. By making use of the hashlimit module, firewalls can also rate-limit abusers based on the remote IP.
A firewall is another safety net that ensures your policies are adhered to. Sure, don't run services you don't expect to.
I definitely recommend that software updates are applied in a timely manner, for example, but I also recommend firewalls on all machines. It's like when I drive: Sure I try to avoid obstacles and other cars, but I also wear a seatbelt and have airbags just in case the unexpected happens.
You may not be realizing how much you are benefiting from firewalls simply because everybody else is using them. In a day when literally everyone, down to home DSL users have firewalls in place port sniffing has been all but given up as a feasible attack vector. A decent hacker isn't going to waste their time checking for such things.
I believe the main reason in having firewalls is that, the people managing the servers don't have to be the people managing the security. I am a student at the university and we (all the departments etc) run many servers from inside the campus which are visible on outside especially those servers which provide computational services to people of other universities. SSH sessions are required on those servers and the same servers have to be used by us inside the campus for similar work. Here, we cannot separate internal network for external network. The model is important so that all people can run whatever configurations they want on their own servers.
Now, if everyone of us who wanted to run a server had to pay so much attention to security, it would just be impossible to do so. By having all the traffic monitored through the firewall, the university computer center can manage the security while we all just run a "supported" OSes and take basic measures like ports which are open etc.
In case my server gets hacked, I don't have to be alert to detect it. The firewalls detect it and they can the administrators can then knock my server off the network and notify me of the same. It will protect my machine (from further harm) and protect the network too.
Without firewalls, every user would be liable for his own machine and too much of our time would be gone in security thing that actual work. With firewall, we don't have to worry too much about firewalls etc and actually, we can do well to keep our servers open for random access from inside the university (for SSH ports) and still not worry about its security from outside the university network which allows lets say only HTTP ports.