Debootstrap is intended for package building and testing.
And I would not consider chroot a security feature, to start with.
If your goal is to harden a server hosting a web server + web application, other measures are more appropriate, namely:
- dedicated separated partitions/LVs with restricted mount options:
For example, I have the DocumentRoot of my webserver set to /srv/www
, which is a dedicated logical volume mounted whit restrictive options
/dev/mapper/root_vg-srv_lv on /srv type ext4 (rw,nosuid,nodev,noexec,relatime,seclabel,quota,usrquota,grpquota,data=ordered,usrquota,grpquota)
the relevant ones being nodev, noexec, seclabel
and *quota
.
All because developers can upload content via git hub/live repositories, and I choose not to trust them regarding safe permissions, ownership, SELinux labeling, etc...
- SELinux/AppArmor (the second possibly having better support in Debian as of now)
SELinux is, unfortunately, not fully functional in Debian (although squeeze is better supported than wheezy, IIRC). I suggest AppArmor for this reason. It should be easier to implement than SELinux.
You definitely want a web application firewall.
Combining these two tools can, at a very least, decrease the chances of an attack to succeed.
- Possibly quite a lot more depending on what your application is for.
Does you application use fill-in forms? does it manage a database? user authentication?
Securing a website is not an easy task, I'd suggest to read a lot before exposing anything in the wild.