
Set up the lab with VirtualBox and install FreeBSD from scratch to run jails. Learn to manage jails with vassal BSD and explore Raspberry Pi installations.
Explore what jails are as a security feature in FreeBSD, viewing them as containers to run applications in safe, isolated environments for testing, hosting, and segregating systems.
Jails provide operating system level virtualization, letting you run multiple isolated applications in separate environments, similar to containers. They ensure complete separation at process and network levels, protecting the host.
Discover tools for managing FreeBSD jails, from low-level jail commands to the best child BSD tool used in this course, with cross-environment support from servers to Raspberry Pi and cloud.
learn how to set up a lab by downloading FreeBSD 13.x from freebsd.org, selecting the AMD64 ISO or Raspberry Pi SD card image for a ready-to-use installation.
Create a VirtualBox lab environment for FreeBSD jails by configuring a 64-bit FreeBSD VM named 'FreeBSD 13.1 jail', with a dynamic disk, 1 GB RAM, multiple CPU cores, and bridged wifi networking.
Install a minimal FreeBSD system in VirtualBox with auto file system and a striped disk. Configure root password, DHCP network, and boot into FreeBSD 13.1 with SSH enabled.
Enable external ssh access to a FreeBSD 13.x jail by editing the ssh server configuration and restarting the ssh service for lab use.
Update your FreeBSD 13.x installation to the latest version with the freebsd update command, then switch to the latest repo to install nano, grep, and Midnight Commander for jails.
Explore Bastille BSD, a one-command tool for managing FreeBSD jails with automation templates, networking, and content management, including Raspberry Pi support and up-to-date documentation.
Install Bastille from the official FreeBSD repo on a fresh system and use the latest Bastille version. Enable Bastille as a service, start it, and review jail-management commands for FreeBSD.
Configure Bastille by editing /usr/local/etc/bastille, enabling zfs support and pool name, review defaults, and reuse the bootstrapped 13.1 release cache for all future jails.
Create your first jail with Bastille Create on FreeBSD 13, specifying jail name, release, ip address, and network adapter.
Create and use VirtualBox snapshots of a running FreeBSD with Bastille jails to safely experiment, then stack snapshots and restore previous states, restarting jails after boot.
Manage FreeBSD jails with Bastille: list, connect to jail consoles, start, stop, restart, and destroy jails, and install packages like nano inside isolated environments.
Create a FreeBSD jail for MongoDB, install MongoDB 4.4, enable and start the service, bind to all IPs, and test connectivity from inside and outside the jail.
Install a Nats messaging server in a dedicated jail with Bastille on FreeBSD 13.x, enable it and configure it to listen on all addresses while MongoDB runs in separate jails.
Monitor FreeBSD jails from outside using Bastille cmd to run commands across all jails or a single jail, view statistics, manage packages, and verify services and installations efficiently.
Leverage Bastille templates to bootstrap Apache and other services in FreeBSD jails, using git-backed templates and the Bastille template command to apply to new or existing jails.
Switch from quarterly to latest repo, copy the latest repo config to all jails, then run Bastille package update across all jails to fetch and upgrade packages.
Clone an existing jail with Bastille clone by naming the new jail and assigning a new IP address, then start it using the template option for a command-list based clone.
Master jail backup and restore with Bastille. Export a running jail to a compressed archive, then import it with network and ZFS settings preserved, enabling restore without interrupting the jail.
Explore networking options for jails, including ip alias, shared interface, and vnet. Assess local and public network configurations, from local loopback adapter to packet filter shaping for traffic.
Configure a shared interface (ip alias) by assigning an additional IP to the host's network adapter, then create and run a jail with Bastille and verify connectivity.
Learn to set up a loopback adapter with Bastille, enable pf, and redirect external ports to jailed services like ssh and apache for a secure, local network.
Bind a FreeBSD jail to a vnet using Bastille and -V, verify the bridge, and apply must-have def fs rules and cis variables per documentation.
Explore FreeBSD on the Raspberry Pi as a platform for running jails. Learn to install FreeBSD on Raspberry Pi 3b+ using an arm-based SD card image and boot from it.
Run FreeBSD 13 on Raspberry Pi with arm 64, delivering native jails and full features. Install MongoDB or Apache from arm repos without compilation on four-core, 1 GB RAM device.
Expose multiple FreeBSD jails on a 1gb Raspberry Pi using Bastille to host caddy, MongoDB, Postgres, Redis, and other services across separate IPs.
Upgrade a FreeBSD jail from 13.2 to 14 by Bastille bootstrap, edit fstab, start the jail, then run Bastille package upgrade to match the host.
Hello,
welcome to the ‘FreeBSD 13.x - Mastering JAILS’ course. The purpose of this course is to give a deep overview of what Jails are, and how to use them for building testing or production-ready environments. All this using a great BastilleBSD project.
What you'll learn:
Create FreeBSD lab environment for a safe Jails testings
Get deeper understanding what Jails are
Maintain Jails using BastileBSD
Understand Jails networking
Get some practice with Jails backups
Use BastileBSD for maintaining multiple Jails environment in seamless way
What are FreeBSD Jails from Wikipedia:
"The jail mechanism is an implementation of FreeBSD's OS-level virtualization that allows system administrators to partition a FreeBSD-derived computer system into several independent mini-systems called jails, all sharing the same kernel, with very little overhead. It is implemented through a system called jails, as well as a userland utility plus, depending on the system, a number of other utilities. The functionality was committed into FreeBSD in 1999 by Poul-Henning Kamp after some period of production use by a hosting provider and was first released with FreeBSD 4.0, thus being supported on a number of FreeBSD descendants, including DragonFly BSD, to this day.
The need for the FreeBSD jails came from a small shared-environment hosting provider's (R&D Associates, Inc.'s owner, Derrick T. Woolworth) desire to establish a clean, clear-cut separation between their own services and those of their customers, mainly for security and ease of administration (jail(8)). Instead of adding a new layer of fine-grained configuration options, the solution adopted by Poul-Henning Kamp was to compartmentalize the system – both its files and its resources – in such a way that only the right people are given access to the right compartments."
Topics covered in this course:
'Mastering Jails' course covers most of the Jails setup options available and required for running Jails in real live scenarios. The main topics include:
Jails Essentials
Creating a FreeBSD Lab environment
Using BastilleBSD for managing Jails in many different ways
Setting Jails networking in the right way
BONUS: Running FreeBSD Jail on Raspberry PI
During the course, we build a lab environment with fresh FreeBSD installation and we setup Jails from the ground to a production-ready environment. We will practice working with Jails, backing them up, or do networking the right way. All this using a great BastilleBSD project.
Summary:
FreeBSD 13.x Mastering Jails course covers various topics related to using Jails to manage running different software packages in a secure way. Using Jails you can avoid security issues/holes in software packages you host on your system.