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

Sending syslog from jail to host fails

I'm trying to send logs from a jail to the host system on FreeBSD 10. I think everything is setup correctly but I can't get it working. Sending logs directly from Nginx 1.7 works but not sending logs via syslog (e.g. PHP-FPM). This is my host's…
basbebe
  • 313
  • 2
  • 16
0
votes
1 answer

Move a Sftp User in a Subdirectory of his Jail

I've a question concerning the Jail explained later: User to be jailed: foo Jail Directory: /mnt/foo-jail Home directory of foo: /mnt/foo-jail/foo-home Everything is ok. Jail is up and the user is connecting correctly. The problem is: "foo" has…
Echoes_86
  • 173
  • 10
0
votes
1 answer

ports in freebsd jail fetching but not updating

I've created a jail to host my webserver/blog, but when attempting to build any port, I consistently get the message "portsnap: Directory is not writable: /usr/ports". Attached is a screen capture of my console outputs attempting to portsnap…
SteveMustafa
  • 429
  • 1
  • 5
  • 11
0
votes
1 answer

How to keep jailed users from changing directory to parent dirs?

I've chroot users with chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list and I'm the only user in the chroot_list file. Other users log in jailed but when they go to the relative parent directory .. they are able…
Jacksonkr
  • 465
  • 1
  • 7
  • 16
0
votes
1 answer

Centos6.4: User home directory for sftp

Currently setting up a Centos6.4 box and are wanting to jail sftp users upon login. I've been following the notes here http://www.thisisnotsupported.com/sftp-chrootjail-on-centos6. But I have one issue relating to the user home directory. This…
Simon Bennett
  • 135
  • 1
  • 5
0
votes
1 answer

FreeNAS/FreeBSD: How to access status of ZFS volume from jail?

I am trying to set up NRPE to enable remote Nagios monitoring of a new FreeNAS 0.91 system. I mostly have this working. I can connect and inquire about basic information like number of processes, users, etc. But I can't run zpool list to inquire…
StewLG
  • 271
  • 4
  • 6
0
votes
1 answer

Changing WebServer to use BSD Jails

I'm thinking of changing my web server so that Apache (and all of django web apps) run inside of a jail rather then on my host machine. I want to make this change for two reasons, the first and primary reason is to learn more about jails and how…
AlexLordThorsen
  • 147
  • 1
  • 6
0
votes
2 answers

how limit php script to access parent host directory

I've a debian linux server with apache2.2 & php5 installed. I've created many virtual hosts on my apache server, each virtual host has a separate root directory & php is enabled for all of them. Now I need to limit php scripts in each virtual host…
Ehsan Khodarahmi
  • 305
  • 1
  • 7
  • 18
0
votes
2 answers

Crossplatform "jail" for an application

We currently have a variety of systems (Linux, Solarix, *BSD, HP-UX ...) on which we are not allowed to install anything into / (but I have root access. That's strange, I know). But we'd like to run Puppet on all of them. So, the obvious idea is to…
0
votes
2 answers

Restricting User Access in Debian Squeeze

I've been contemplating ways to restrict user access to their own directories, not allowing them to navigate above their own user directory. I'm using SFTP, and don't want to install regular FTP because of all of the extra security problems that…
tacotuesday
  • 1,389
  • 1
  • 16
  • 27
0
votes
2 answers

chroot'ing Apache to prevent shell scripts?

Recently I'm being told that a user has my system 'shelled.' While there hasn't been any unusual activity or errors in Apache error log, etc.. I'd rather be safe than sorry. So: If I run chroot Apache, will it prevent shell scripts being able to…
Tar
  • 265
  • 4
  • 11
0
votes
1 answer

uWSGI touch-reload feature not working with 100% CPU

On my development box, I have configured uWSGI to reload every time a file gets touched (using the --touch-reload command line argument). When I specify a non-existent file, I get a warning in the uWSGI logs. If I specify an existing file (say,…
Romain
  • 115
  • 1
  • 6
0
votes
1 answer

using ssh why do sftp directories need to be world readable?

I added the below to sshd_config, when i chmod 770 the user folder i get this error? Why? how can i make the folder only readable to the user or group? the owner currently is root and the group is currently that username fatal: bad ownership or…
user274
0
votes
3 answers

Jail users in a directory

I have a vps running debian OS and would like to create user accounts on it. I want it so that when the user logs in with sftp, everything in var appears to be their home directory and they cannot cd out of it. For example, when user3 logs in, they…
dukevin
  • 1,630
  • 3
  • 18
  • 25
0
votes
2 answers

can I jail ssh for more that one directory?

I have working jail ssh to one directory. I would love to give r/w access for the jail ssh user to few directories. For example /tmp/user /home/user /srv/www/user is that possible?
Radek
  • 1,153
  • 4
  • 26
  • 39