Date: Fri, 21 Apr 2006 08:45:25 -0300 From: "Ricardo A. Reis" <ricardo_bsd@yahoo.com.br> To: freebsd-stable@freebsd.org Subject: Fwd: Prototyping for basejail distribuition Message-ID: <op.s8cv9znwp1tyz6@localhost> In-Reply-To: <op.s7yqucz5p1tyz6@localhost> References: <op.s7yqucz5p1tyz6@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
------------xoP6ru58D45K5inOrWnO3m Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-1 Content-Transfer-Encoding: 8bit ------- Forwarded message ------- From: "Ricardo A. Reis" <ricardo_bsd@yahoo.com.br> To: "freebsd-security@freebsd.org" <freebsd-security@freebsd.org> Cc: "freebsd-current@freebsd.org" <freebsd-current@freebsd.org> Subject: Prototyping for basejail distribuition Date: Thu, 13 Apr 2006 17:21:38 -0300 Hi, I attach 2 files in this email, the first is a Makefile and the second is jail.conf. For demonstre my idea i resolved create one "Pseudo Prototyping", for test is necessary: 1 - Create dir /usr/local/basejail 2 - Copy Makefile to /usr/local/basejail 3 - Copy jail.conf to /etc 4 - The initial basejail is precompiled is distributed in CD1, for simular basejail is necessary a installworld structure in /usr/local/basejail cd /usr/src ; make installworld DESTDIR=/usr/local/basejail Now is necessary config jail.conf, ----- #sample template for create freebsd jail # # RC.CONF GLOBAL VARIABLES # exec_start="/bin/sh /etc/rc" exec_stop="/bin/sh /etc/rc.shutdown" devfs_enable="NO" fdescfs_enable="NO" procfs_enable="NO" mount_enable="NO" devfs_ruleset="ruleset_name" flags="-l -U root" # # JAIL RC.CONF # sendmail_enable="NO" inetd_flags="-wW -a" rpcbind_enable="NO" network_interfaces="" # # FILES # copy_to_jail="/etc/localtime /etc/resolv.conf /etc/csh.cshrc /etc/csh.login" # # JAILS # jail_node01_rootdir="/usr/jail/node01" jail_node01_hostname="node01.example.com" jail_node01_ip="127.0.0.1 " jail_node02_rootdir="/usr/jail/node02" jail_node02_hostname="node02.example.com" jail_node02_ip="127.0.0.2 " ------- In this moment is possible create large numbers of jail, i implemente in makefile, [root@daemon:/usr/local/basejail] # make >>> Sample in /usr/share/examples/etc/jail.conf jail == create jail rcconf == create rc.conf for start jails etcconfig == create rc.conf for jails and copy file showconfig == show information Thanks for any comments, Sorry for my english and poor Makefile. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ------------xoP6ru58D45K5inOrWnO3m Content-Disposition: attachment; filename=Makefile Content-Type: application/octet-stream; name=Makefile Content-Transfer-Encoding: Base64 Iy0qLSBtb2RlOiBGdW5kYW1lbnRhbDsgdGFiLXdpZHRoOiA0OyAtKi0KIyBleDp0 cz00CkRJU1RCQVNFPz0vdXNyL2xvY2FsL2Jhc2VqYWlsCkNPTkZJR0NGRz89L2V0 Yy9qYWlsLmNvbmYKSkxJU1RSIT0gZ3JlcCAnXmphaWxfW2Etel0uKl9yb290ZGly JyAkKENPTkZJR0NGRykgMj4vZGV2L251bGwgfCBjdXQgLWQ9IC1mMiB8IHNlZCAt ZSAncy8iLy9nJyB8dHIgJyAnICdcbicgCkpMSVNUTiE9IGdyZXAgJ15qYWlsX1th LXpdLipfJyAkKENPTkZJR0NGRykgMj4vZGV2L251bGwgfCBjdXQgLWQ9IC1mMSB8 Y3V0IC1kXyAtZjIgfHNvcnQgfHVuaXEKSkxJU1RJSVAhPSBncmVwICdeamFpbF8k KEpMSVNUTilfaXAnICQoQ09ORklHQ0ZHKSAyPi9kZXYvbnVsbCB8IGN1dCAtZD0g LWYyIHwgc2VkIC1lICdzLyIvL2cnClRNUERJUj89L3RtcAoKCi5pZiAhZXhpc3Rz KCR7Q09ORklHQ0ZHfSkKCUBlY2hvICIiCglAZWNobyAiPj4+IFBsZWFzZSBjb25m aWd1cmUgJChDT05GSUdDRkcpIgoJQGVjaG8gIj4+PiBTYW1wbGUgaW4gL3Vzci9z aGFyZS9leGFtcGxlcyQoQ09ORklHQ0ZHKSIKCUBlY2hvICIiCglAZXhpdCAxCi5l bHNlCi4gaW5jbHVkZSAiJChDT05GSUdDRkcpIiA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9famFpbCkiCglAZWNobyAiIgoJ QGVjaG8gIj4+SmFpbHMgQ29uZmlnOiIKCUBlY2hvICIiCglAZWNobyAkKEpMSVNU TikgfCB0ciAnICcgJ1xuJyB8IFwKCXdoaWxlIHJlYWQgX2puYW1lOyBkbyBcCgkJ CUpST09URD1gZ3JlcCAiXmphaWxfJCR7X2puYW1lfV9yb290ZGlyIiAkKENPTkZJ R0NGRykgMj4vZGV2L251bGwgfGN1dCAtZD0gLWYyIHwgc2VkIC1lICdzLyIvL2cg OyBzLyAvL2cnYCA7IFwKCQkJSklQPWBncmVwIF5qYWlsXyQke19qbmFtZX1faXAg ICQoQ09ORklHQ0ZHKSAyPi9kZXYvbnVsbCB8Y3V0IC1kPSAtZjIgfCBzZWQgLWUg J3MvIi8vZydgIDsgXAogCQkJZWNobyAiTkFNRSAgICA9ICQke19qbmFtZX0iIDtc CgkJCWVjaG8gIlJPT1RESVIgPSAkJHtKUk9PVER9IiAgO1wKCQkJZWNobyAiSVAg ICAgICA9ICQke0pJUH0iICAgICA7XAoJCQllY2hvICIiCTtcCglkb25lCg0K ------------xoP6ru58D45K5inOrWnO3m Content-Disposition: attachment; filename=jail.conf Content-Type: application/octet-stream; name=jail.conf Content-Transfer-Encoding: Base64 I3NhbXBsZSB0YW1wbGF0ZSBmb3IgY3JlYXRlIGZyZWVic2QgamFpbAojCiMgUkMu Q09ORiBHTE9CQUwgVkFSSUFCTEVTCiMKZXhlY19zdGFydD0iL2Jpbi9zaCAvZXRj L3JjIgpleGVjX3N0b3A9Ii9iaW4vc2ggL2V0Yy9yYy5zaHV0ZG93biIKZGV2ZnNf ZW5hYmxlPSJOTyIKZmRlc2Nmc19lbmFibGU9Ik5PIgpwcm9jZnNfZW5hYmxlPSJO TyIKbW91bnRfZW5hYmxlPSJOTyIKZGV2ZnNfcnVsZXNldD0icnVsZXNldF9uYW1l IgpmbGFncz0iLWwgLVUgcm9vdCIKIwojIEpBSUwgUkMuQ09ORgojCnNlbmRtYWls X2VuYWJsZT0iTk8iCmluZXRkX2ZsYWdzPSItd1cgLWEiCnJwY2JpbmRfZW5hYmxl PSJOTyIgCm5ldHdvcmtfaW50ZXJmYWNlcz0iIgojCiMgRklMRVMKIwpjb3B5X3Rv X2phaWw9Ii9ldGMvbG9jYWx0aW1lIC9ldGMvcmVzb2x2LmNvbmYgL2V0Yy9jc2gu Y3NocmMgL2V0Yy9jc2gubG9naW4iCiMKIyBKQUlMUwojCmphaWxfbm9kZTAxX3Jv b3RkaXI9Ii91c3IvamFpbC9ub2RlMDEiIApqYWlsX25vZGUwMV9ob3N0bmFtZT0i bm9kZTAxLmV4YW1wbGUuY29tIgpqYWlsX25vZGUwMV9pcD0iMTI3LjAuMC4xIgoK amFpbF9ub2RlMDJfcm9vdGRpcj0iL3Vzci9qYWlsL25vZGUwMiIKamFpbF9ub2Rl MDJfaG9zdG5hbWU9Im5vZGUwMi5leGFtcGxlLmNvbSIKamFpbF9ub2RlMDJfaXA9 IjEyNy4wLjAuMiIKDQo= ------------xoP6ru58D45K5inOrWnO3m-- _______________________________________________________ Yahoo! doce lar. Faça do Yahoo! sua homepage. http://br.yahoo.com/homepageset.html
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.s8cv9znwp1tyz6>