Questions tagged [jail]

"The FreeBSD jail mechanism is an implementation of operating system-level virtualization that allows administrators to partition a FreeBSD-based computer system into several independent mini-systems called jails." source: Wikipedia

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. Traditional security issues which plagued the original chroot(2) design will not affect FreeBSD jails.

  • A hostname -- the hostname which will be used within the jail. Jails are mainly used for hosting network services, therefore having a descriptive hostname for each jail can really help the system administrator.

  • An IP address -- this will be assigned to the jail and cannot be changed in any way during the jail's life span. The IP address of a jail is usually an alias address for an existing network interface, but this is not strictly necessary.

  • A command -- the path name of an executable to run inside the jail. This is relative to the root directory of the jail environment, and may vary a lot, depending on the type of the specific jail environment.

source: https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html#jails-synopsis

Links

76 questions
1
vote
1 answer

How possible is it to write an effective jail for OpenBSD without altering it's source code?

I've been researching possible operating systems to host websites and am interested in security. I really like the FreeBSD jail system and understand that OpenBSD discontinued it's jail system some years back due to the possible exploitation of…
user4333011
1
vote
1 answer

Instantiating BSD jails from C

I have been trying to be able to create BSD jails from an application. Based on the FreeBSD man pages for jail(2) I've come up with: struct jail _jail; _jail->version = ; _jail->path = "/some/path/"; _jail->hostname =…
Christian Grabowski
  • 2,782
  • 3
  • 32
  • 57
1
vote
1 answer

How do I prevent an include of files out of system directories?

I have to prevent the #include of any files out of system directories because of security reasons. Is there any restrictions that can prevent #include<...> and #include"..."from including unsafe files like #include or #include…
Fissure Blue
  • 181
  • 1
  • 7
1
vote
1 answer

Ezjail and /etc/jail.conf in FreeBSD 10.2

I have a question regarding the following warning when using Ezjail-3.4.1 on FreeBSD 10.2 /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* var "enter code here" iables is obsolete. Please consider to migrate to /etc/jail.conf "enter code…
Mr.hill
  • 11
  • 4
1
vote
1 answer

PHP, Apache and MySQL on FreeBSD jail

I am trying PHP, Apache, MySQL stack on FreeBSD. I created two jails in one FreeBSD host. I installed PHP, Apache in one jail and MySQL Server in another. All these components working fine in their own jail. My target is to host a PHP application…
ASDF
  • 99
  • 1
  • 9
1
vote
0 answers

Git server in jail: working directory in different jail

I'm setting up a FreeBSD server with five jails. some of them are web server with web apps. Some of those apps should be updated using git. I was now thinking about running the git server in his own jail. But would there be any way to keep the git…
basbebe
  • 567
  • 1
  • 9
  • 25
1
vote
2 answers

How to chroot Django

Can one run Django in a chroot? Notably, what's necessary in order to set up (for example) /var/www as a chroot'd directory and then have Django run in that chroot'd directory? Thank you - I'm grateful for any input.
Brian M. Hunt
  • 81,008
  • 74
  • 230
  • 343
1
vote
2 answers

Create a Chroot Jail and copy all system files into jail

I am creating chroot jail in linux , but i do not have access to any system file like ls/cd/gcc/g++. What are the necessary libs/bin/systme files i need to copy to my chroot jail ?
user1159517
  • 5,390
  • 8
  • 30
  • 47
1
vote
1 answer

Mosh via two-level ssh (FreeBSD, jails)

I am fond of mosh but I have problem connecting via two-level ssh. Consider this scenario: host machine running FreeBSD which has closed all ports from outside first jail having ssh port 2222 open from the outside is on public IP let's say…
geronime
  • 573
  • 4
  • 15
1
vote
1 answer

Php-fpm does not find the files from the chrooted nginx

I installed arch linux and nginx in a chroot (archlinux wiki). Thats working. Now I want to get fastcgi running. I set the php-fpm socket to 127.0.0.1:9000 to reach it from the chroot (/srv/http). While the html files are printed successfully the…
fvosberg
  • 677
  • 10
  • 30
1
vote
2 answers

freebsd9 jail can not start jails

I'm trying to start jail in FreeBSD 9 configs: etc/rc.conf: #jails: jail_enable="YES" jail_interface="re0" jail_devfs_enable="YES" jail_procfs_enable="YES" jail_set_hostname_allow="YES" jail_list="test" ifconfig_em0_alias0="inet…
Vlad
  • 73
  • 1
  • 10
1
vote
0 answers

Man-in-the-middle: Intercepting an applications function/library calls

Basically, what I want to achieve is to run a program in an environment which will give any value asked by the program on basis criteria decided by me. Say e.g., games regularly query system about the time so as to execute animations, now if I have…
pareshverma91
  • 804
  • 2
  • 8
  • 14
0
votes
1 answer

How Can I get the result of child process of a command executed in subprocess?

I want run Valgrind in a jail that created before and copyied required file in Jail. We know Valgrind generate two files XML and TXT files. I want to run python script that can cache the results of Valgrind files (XML and TXT file) and carry them to…
Alex
  • 31
  • 4
0
votes
1 answer

Best way for a user within a BSD jail to have full access to a particular user's files on the hosting system

This happens to be a TrueNAS (BSD) system. The system itself has an id of pedz with UID of 1000. (I'll call him Gpedz). I created a jail so I could write an application and run it safely on the NAS and created a user of pedz within the jail which…
pedz
  • 2,271
  • 1
  • 17
  • 20
0
votes
1 answer

How to share files between two (desktop) applications in a secure way

The problem is that I need to share files between 2 programs, but I don't want that those files are accessible by the user of the computer and other programs than these 2. So the flow of the files are like this: Program A (which I will code myself)…
Wouter
  • 769
  • 3
  • 9