jails Jail for each "service" in residential scenario?

I am not familiar with svcj_options. Do the jailed services get their own VNET?


This is the way I run samba, pkg install, edit smb/nmb conf files, and in rc.conf;

Code:
samba_server_svcj_options="net_basic"
samba_server_svcj="YES"
samba_server_enable="YES"

In /etc/rc.subr the svcj_options line is converted to jail options, and net_basic will slap on IPv4, IPv6 and allow.reserved_ports to to service jail.

It does not seem to support VNET at the moment. I guess VNET configuration can be complex for provisioning scripts, it is arbitrarily configured by the user. But of course should be possible to add some option to handle VNET networking.

Should I do each of these in their own jails so that I can silo the network activities and processes? Pros and cons with the added complexity?

I would recommend starting from the shared files level. First three of your points are services that manage files over network. Depending on how your file storage is structured, how your "workflows" with the files/backups are put in practice, I would unify some of the services. For example if nextcloud and rsync are going to mount same filesystem in rw mode, in my opinion, makes no sense of separating them.

In my opinion, every breach into networks has variable consequences depending on what the network is. If one breaks into infrastructure, say a hosting service or a telecom, the value is the equipment - bandwidth and compute, if they do into a regular company, it can be a mixed affair, but in breach of home networks, it is always, always the user data that is the valuable part. I personally apply "weakest link" here. If rsync and nextcloud work over same user data, the security impact for both == the weakest of them, or the bunch.

Then again none of your services are public.
My samba isn't public also but it is serving files for old PCs under NTLMv1. I have to take into account, that some wiseass is going to place an old Windows .EXE file as some game patch online that specifically targets Samba NTLMv1 for exploitation. That's the only vector I can think of and reason why only samba is in service jail in my network.
 
Would a good idea be to have an updater user that you su into when doing any jail maintenance so that all updates/maintenance shell history for all jails is conveniently in one user whose sole purpose is updating/maintaining jails, VMs, etc?
that’s the gist but I use Ansible, something like:

Code:
ansible jails -m community.general.pkgng -a “name=* state=latest”
 
This looks absolutely awesome. I’ll take it for a spin on a machine I have laying around the lab. It seems like a FreeBSD version of Proxmox which is very much preferred. My main concern is that it is so new that I suspect it is vibe coded and/or won’t keep up with changes in the future. Any input on your own usage, how long, any affiliation with the project, etc?

Eurobhyvecon

It is new. But it is really exciting.

I have one node up with an opnsense and a webserver as vms on it. Replaces ESXI free completely. Plan to add a second node turning it into a cluster and use jails which will be an improvement from running standalone ESXIs. Redundancy and lower overhead.

The base is FreeBSD15.1. I use zfs with it wasting some RAM but using jails gets the RAM back.

I have no affiliation with anything.

It’s easy to setup and stable to run. I was looking at Proxmox to replace my ESXIs. I even considered to continue with the Broadcom release of the free ESXI but that would mean injecting drivers into the image. I decided to test sylve and saw the way forward.

My setup has LAN, WAN and DMZ using VLANs and sylve is managing that just fine. It’s a couple of clicks to create under-the-hood FreeBSD bridges, bhyve VMs and jails.

Watching the YouTube clip and learning that the foundation is involved was a factor for me testing as well.

It is really exciting.

/grandpa
 
What VPN service do you use that provides in-bound traffic to your LAN at home?
wireguard

Eurobhyvecon

It is new. But it is really exciting.

I have one node up with an opnsense and a webserver as vms on it. Replaces ESXI free completely. Plan to add a second node turning it into a cluster and use jails which will be an improvement from running standalone ESXIs. Redundancy and lower overhead.

The base is FreeBSD15.1. I use zfs with it wasting some RAM but using jails gets the RAM back.

I have no affiliation with anything.

It’s easy to setup and stable to run. I was looking at Proxmox to replace my ESXIs. I even considered to continue with the Broadcom release of the free ESXI but that would mean injecting drivers into the image. I decided to test sylve and saw the way forward.

My setup has LAN, WAN and DMZ using VLANs and sylve is managing that just fine. It’s a couple of clicks to create under-the-hood FreeBSD bridges, bhyve VMs and jails.

Watching the YouTube clip and learning that the foundation is involved was a factor for me testing as well.

It is really exciting.

/grandpa
I just spent an hour playing around with sysutils/sylve and it seems extremely impressive; however, because of the project age, how in-depth and the amount of things it can do (jails, vm, samba, networking, datasets, etc) I suspect it may not play too nicely with upgrades or other misc underlying dependency package changes. In other words, I fear that small changes may break the tooling and then I'm spending time diagnosing infrastructure for my home that is not critical. Or alternatively a critical software bug is made aware but the project stalls a bit and it takes a long time for the maintainer to implement the fix. I dunno, more stuff means more potential issues. I think at some point it makes sense when dealing with a lot of stuff or a lot of things that change (like spinning VMs, jails, etc frequently whereas I'm a bit of almost one and done then maintain.)

I think the same may be true about sysutils/ansible but I'm not sure as I haven't read into it too much or played around with it. I don't want to learn a bunch of new syntax, tooling, etc that is very specific to products designed to make large systems easier to manage when I am a small fry with small system without any need for future scalability. I suppose the same goes for sysutils/iocage where it can make sense but if you don't know it and don't deal with it frequently it probably doesn't for small home server situations (I can be totally wrong!).

I fear that if I use tools that are scalable (sylve, ansible, iocage) that it will actually increase issues, frustrations and ultimately change in the future since my needs are fairly static and small. I don't need a ton of features. I don't need scalability. Simple maintenance here and there with some custom scripts here and there as I see fit. Something I can read, understand, audit, etc. I don't want to keep up on projects that are growing, adding features, etc because it is just another learning curve and understanding all the nuance stuff with jails, bhyve, networking, etc is a lot to retain but it has all been fairly static for the past decade+ in terms of syntax, how to do stuff, etc.

I'm trying to flesh out if going straight up raw built-in base package tooling makes more sense for a home environment rather than projects that have varying degrees of scope, features, etc.
 
straight up raw built-in base package tooling makes more sense for a home environment r
That's all I use: jls, service jail start/stop jailname, jexec -l jail <command>, or jexec -l jail login -f root to get inside the jail and pretend it's a complete machine. Works like a charm. I run pkg -j jail update/upgrade from the host instead of running pkg inside the jail - no reason for this choice other than that it seems off to have each jail maintaining its own copy of the pkg tool. It's not very many tools to use, and you can do everything you need. A nice web GUI to make it look like TrueNAS or some other overlord-style command center would be great, but the truth is I get along just fine at the shell prompt.
 
A nice web GUI to make it look like TrueNAS or some other overlord-style command center would be great, but the truth is I get along just fine at the shell prompt.
This is my thinking but always exploring options to make an informed decision. I used TrueNAS for many years (back to the FreeNAS days and even bought many machines from ix systems to help support the cause). The concern is their commitment (or lack thereof) of Core and I have zero interest in Scale (Linux based). Hence, it took many many many years but eventually a very complicated and heavy lifting tool that worked really well ended up not fitting what I am looking for. At the most busy I only touched a handful of the nearly endless features.

Compare that to the built in native jail tools which are very functional. Many times the most simple tool is the best [and most reliable] tool.
 
Should I do each of these in their own jails so that I can silo the network activities and processes? Pros and cons with the added complexity?

If the application doesn't require Linux; use Jails. Keep it simple. Use your router (also FreeBSD I hope, OPNSense?) to better silo different traffic.

If you're doing kernel development, or need an application that requires a different OS; bhyve is your only bet. Otherwise, use Jails. The Solaris folk figured this out years ago.
 
Use your router (also FreeBSD I hope, OPNSense?) to better silo different traffic.
Yep, OPNSense. I used pfSense forever but when my last Netgate pfSense device failed (I believe it was the fourth hardware failure in ten years) I decided to build my own rig and go with OPNSense. I like the firewall rules page of pfSense a lot better but I think OPNSense has better overall organization of pages.

I don’t think I’ll roll OPNSense in a jail though. I think bare metal is the proper way to have the edge firewall. Right now it is rolling just fine in Proxmox but I don’t like the idea of my entire network is based upon a VM.
 
What VPN service do you use that provides in-bound traffic to your LAN at home?
I personally use tailscale as it's quite easy. If you've got a VPS or somewhere you can host with a static IP headscale also works. Personally, tailscale is more than enough for me and they make it quite easy to get ssl certificates for use over your tailnet.

Wireguard is also nice, but I don't think it's really intended for use over the internet if you haven't got static IPs to work with.

If the application doesn't require Linux; use Jails. Keep it simple. Use your router (also FreeBSD I hope, OPNSense?) to better silo different traffic.

If you're doing kernel development, or need an application that requires a different OS; bhyve is your only bet. Otherwise, use Jails. The Solaris folk figured this out years ago.
That's been my thinking. For the stuff I do, a lightweight VM for linux stuff would work, but I farm that stuff out to a separate Linux install to do. Most of the Linux only stuff I run would probably run just fine on podman in FreeBSD, but podman support was still a work in progress last time I checked and layering that on top of podman's support for docker was getting a bit tall of a stack for me.
 
Back
Top