Questions tagged [jail]

Jails improve on the concept of the traditional chroot environment in several ways. In a traditional chroot environment, processes are only limited in the part of the file system they can access.

One of the tools which can be used to enhance the security of a FreeBSD system is jails.

Jails have been available since FreeBSD 4.X and continue to be enhanced in their usefulness, performance, reliability, and security.

Jails build upon the chroot(2) concept, which is used to change the root directory of a set of processes, creating a safe environment, separate from the rest of the system. Processes created in the chrooted environment can not access files or resources outside of it. For that reason, compromising a service running in a chrooted environment should not allow the attacker to compromise the entire system.

However, a chroot has several limitations. It is suited to easy tasks which do not require much flexibility or complex, advanced features. Over time many ways have been found to escape from a chrooted environment, making it a less than ideal solution for securing services.

Jails improve on the concept of the traditional chroot environment in several ways. In a traditional chroot environment, processes are only limited in the part of the file system they can access. The rest of the system resources, system users, running processes, and the networking subsystem are shared by the chrooted processes and the processes of the host system.

Jails expand this model by virtualizing access to the file system, the set of users, and the networking subsystem. More fine-grained controls are available for tuning the access of a jailed environment. Jails can be considered as a type of operating system-level virtualization.

A jail is characterized by four elements:

A directory subtree: the starting point from which a jail is entered. Once inside the jail, a process is not permitted to escape outside of this subtree.

A hostname: which will be used by the jail.

An IP address: which is assigned to the jail. The IP address of a jail is often an alias address for an existing network interface.

A command: the path name of an executable to run inside the jail. The path is relative to the root directory of the jail environment.

Jails have their own set of users and their own root account which are limited to the jail environment.

The root account of a jail is not allowed to perform operations to the system outside of the associated jail environment.

More:

114 questions
0
votes
2 answers

PF firewall issues with FTP inside FreeBSD jail

I have recently tried to set up jails on one of my FreeBSD servers, and I’m running into strange errors while trying to download FreeBSD packages via FTP. I have these rules in the PF firewall to allow the download of packages on the host machine,…
mikl
  • 622
  • 1
  • 11
  • 17
0
votes
0 answers

ARP Connectivity Issues Between OpenMediaVault Server and BSD Jails

On my network I have two servers. Server1 is running TrueNas(BSD) with multiple applications running in iocage jails. It's connected to the network with a 3-nic LAGG. Server2 is an OpenMediaVault (Debian) installation with multiple applications that…
Jason
  • 58
  • 8
0
votes
1 answer

Services whithin jails no longer accessible after upgrade to version 13.0

After upgrading a virtual FreeBSD 12.2 system to 13.0-p3, traffic to services within jails (through Apache 2.4 reverse proxy) was blocked. This is a Hyper-V virtual server and the second one that shows the same problem (the other one being a…
GTeley
  • 21
  • 5
0
votes
1 answer

monitoring real time file access in chroot system

I was wondering if it's possible to write a shell script that: runs chroot for a given userspec and group monitors/intercepts system calls all processes started, and what libraries they attempt to load, and if the file is not available in the…
0
votes
1 answer

Is there another way to restrict SSH user other than chroot jail?

I need to create a safe environment for a foreign SSH user that has to have very restricted access to our server. That is: can only execute commands that are allowed can only use specific software that is allowed must not be allowed to…
0
votes
0 answers

Static files getting requested with internal IP address prefix instead of domain-name prefix

I have a smoothly running FreeBSD box with a couple of jails running their own servers. Nginx runs in its own jail and the main machine uses pf to redirect all http/s requests to Nginx. Nginx checks the requested domain name and does a proxy-pass…
ahron
  • 365
  • 3
  • 14
-1
votes
1 answer

Server Security: FTP and System Users

I'd be happy to get an advice about handling system users and ftp users on a Linux server (Ubuntu). Just want to do it right way. I have a sysUser.sysGroup and created virtual ftpUser.ftpGroup for ProFTPD server. Virtual ftp user (ftpUser) and…
-2
votes
1 answer

MariaDB service won't start on FreeBSD jail

Just set up a dedicated database jail running databases/mariadb55-server and for some reason it won't start on demand nor on boot. Any suggestions? # service mysql-server start Starting mysql. /usr/sbin/daemon: Permission…
dzhi
  • 800
  • 3
  • 10
  • 26
-2
votes
2 answers

Simplest way to jail users for git

I'd like to create a couple user accounts on my server such that the users can check out a specific git repository. Ideally, the user would not be able to gain access to a shell or copy any files other than the git repo. And ideally this doesn't…
notlesh
  • 125
  • 2
  • 8
1 2 3 4 5 6 7
8