On something like a TrueNAS system, you would be in full control of everything opening ports. A firewall is effectively pointless.
If you don’t trust your TrueNAS system for whatever reason, then running a firewall on said system would again be effectively pointless, since how could you trust it to perform it’s job, you just concluded it wasn’t to be trusted.
Put it behind a security appliance if you want to filter or limit access; in most home environments, that would be your router.
Fully agree on this one and have no issue upvoting this if it goes as a feature.
A part of my actual work we deploy cloud containers and resources all the time, and each one of them would have a dedicated network security rule set in front, then you’d have the overall virtual network or physical network firewall/network rule.
It’s like: You wouldn’t run a Windows production server with Windows Firewall off, you’d have it correctly configured to what you want.
Same applies to any other production resources, it should be setup as you want, granted in homelabs it’s really not worth it. Without extra context from OP, I can’t comment on the feasibility of what he is trying to achieve with a OS level firewall, but almost always they are better than not at all.
This concept is perfect for the “Defense in Depth” theory, even though you should make sure your actual firewall is configured correctly for network security, stuff goes wrong and ideally OS-Level Firewalls will provide that last lock before a breach if they manage to get into the firewall layer - such as the amazing SSLVPN attacks going on at the moment.
There would be another way one could take care of that: run the FW/router in a VM or container.
The question is just if the networking (pass through of physical NICs and virtual NICs) can be set up accordingly.
If so, the physical device hosting your NAS can be an edge device, without TrueNAS Logically becoming becoming one and getting feature bloated.
With devices becoming ever more powerful and with TrueNAS hosting things like Nextcloud, the desire to reduce the device count and power consumption in a SOHO environment is real and legitimate.
But that’s the beauty of virtualization.
So it’s better to improve the existing virtualization environment to allow such a setup than coaxing a firewall directly into the TrueNAS OS itself.
If you can live with possibly your entire Internet access or even your local network (think DNS, DHCP & friends) being down when you perform maintenance for the NAS - yes, agreed.
OPNsense runs perfectly fine in a VM on TrueNAS, CORE or CE. Been doing both.
Simple use case is: You are in a academic environment, where network is not segmented enough and you don’t have much control. What you put on network is accessible from the whole internal network, but you want to limit access to few subnets.
Furthermore, I may open samba/nfs to several subnets, and limit web interface access to a even more limited number of IPs.
Hmm, I suppose the necessity depends on the use case. I don’t ever remember a commercial storage appliance I’ve touched having a firewall (at least not one that I used ).
At work, usually the storage network (data path, not management) is isolated to other storage hosts running just that protocol, is often point-to-point, or even if SAN, has multiple protocol level access controls like LUN masking, mutual auth., access control lists, etc. And if you’re serving user shares, that sucker had best be someplace where traffic inspection is happening before packets ever reach it. So a host-based firewall is less critical here.
But at home, a host firewall could help given it’s more likely to be directly exposed to other non-like and potentially hostile hosts on the same network. (Although I think the average TrueNAS user is sensitive to these issues and is using network segmentation, judging from all the complaints about per-VLAN containers in SCALE ).
Compensating controls are available until there is a firewall: unbinding services from specific interfaces so they don’t run on vlans you’d rather they didn’t, or if using flat networks, using file/host/network/user ACLs, and all the usual protocol-level shields. But if you get your firewall, it’s also one more thing to troubleshoot when your CIFS share won’t mount at 4am…
I guess credit where it’s due: two and a half years into this thread, we finally have some sort of use case for the “firewall on the NAS” feature. It doesn’t help, though, that the use case is “use TrueNAS on a network that’s designed and operated by idiots.”
I hate Internet arguments especially when they involve people like @dan who are dedicated to being an absolute dick about everything they disagree with.
That being said host-based firewalls exist for a reason and every security framework says you should use them for a reason. Is my network designed and operated by an idiot? Sure, but even if I wasn’t an idiot I would still run a host-based firewall on every single thing that I could because defense in dept is just good practice. TrueNAS even has IPTables baked in so the feature request here isn’t for a firewall implementation it’s for some simple forms to allow me to configure the firewall that already exists. I do it now with a pre-init script which works but it’s annoying and it makes it harder for another sysadmin to step in and know how things are set up. Maybe that’s not a good enough reason for @dan but for the rest of us having a standardized way to configure our security controls the best possible reason to do anything.
Absolutely. I should’ve have said big enterprise-level commercial storage appliance (Dell, HPE, Pure, etc), but I take your point all the same.
Whether because you’re on a flat network, don’t trust your firewall or firewall guys, or just want to follow best practice, you’d prefer an extra layer of defense that would be useful to you. And that’s ok .
Completely agree but that’s not the market segment where I see TrueNAS actually operating. If I need an enterprise SAN I’m going to get something from Dell, HPE, Pure, etc. and I’ll have it segmented to just my datacenter. If I need edge file storage I’ll look at TrueNAS, QNAP, Synology, etc. and I’ll run a firewall on it to make sure that only the connections that I want to allow are allowed. Maybe I’m using it differently from how it’s intended but that’s how I use it. I don’t get the point of all of the toxic backlash against that so thank you, @Iosonic7484, for at least being civil in your responses. If the rest of the users here could follow your lead this might be a more productive forum.
I hate to tell you this. Running a lot of diverse code on a single part of the infrastructure which becomes part of the TCB through only a tiny fraction of that code running there is a very bad idea. Some UFW switches in the WebUI might give you a (false) sense of security. However, none of this has anything to do with ‘in-depth security’ in any meaningful sense. Everything would run on the same monolithic kernel system and the TCB would grow in size and complexity. It’s like mounting a padlock on a gold bar – it’s pointless.
That’s exactly the kind of thinking of ignorant techies: I have a router so I’m protected.
Aren’t THOSE computers behind your router, in your network, connected to the Internet?
Real techies know you never expect the network to keep the bad guys out:
Do you have intrusion detection/protection in the router and honeypots inside your network, so you can say your network is *apparently* secure and non infiltrated?
Your security is as good as your weakest link, right? The bad guys only need ONE chance/mistake.
I must agree that a firewall is always a good practice even on an internal network.
I’m surprised that a basic firewall is not part of an Enterprise solution.
Agree too that a box with services like TN should not need a firewall, but a FW is a requirement in certain enterprise setups…
I have seen lot of the edge cases where simple security rules can avoid disasters. FW is good to have and zero trust is in today world a “must”. So rather play directly width port I think Truenas shod look for FW rules base don services and there in advanced option shod be possible change the Port ode your demand and restart he service. Bottleneck is here the person who do the setup.
No one can access your computers behind the router unless you port forward or in case you initiate an outgoing connection yourself. That assumes a typical router that’s not set up to block outgoing communication.
If you do initiate an outgoing connection a firewall will view that as a valid one and let communication through bi-directionally.
Given a basic consumer level router will shield you from port scanning and the like, the more prominent attack vectors are instead:
Getting hit by a supply chain attack
If you unwittingly download and execute compromised files
If your browser or OS has a vulnerability that allows for arbitrary code execution by merely visiting a webpage.
A firewall will not help in any of these scenarios. The latter two are more likely to hit a client system you daily drive, which typically also is system you use to access your server, which means an imagined firewall on your server most likely not be set up to block connections coming from your client system.
On the enterprise side you’ll see companies use IDS and network segregation, but that goes way beyond the scope of TrueNAS and whether or not a firewall is included.
All of the above point to a supported firewall being of marginal use on the server.
However, if you insist on having one, they do provide a means through the dev mode. Go wild.
Really, the discussion here is pointless. The OP’s question, two and a half years ago, was “where is the firewall,” and the answer was immediately and correctly given that there isn’t one.
If you think there should be one, go vote on this open feature request, which somehow is still open after two years: