استفاده از chroot jail

امنیت را می توان به روش های مختلفی در سیستم ها پیاده سازی کرد.امن سازی و توجه بیشتر به قسمت هایی که ممکن است به عنوان پاشنه آشیل یک سیستم عمل کنند پایداری و اطمینان پذیری سیستم هدف را افزایش خواهند داد. یکی از همین روش ها که از نسخه 7 UNIX تا به حال ( از سال 1979 ) همواره متداول بوده است به change root jails معروف است.در این روش با استفاده از یک system call به نام chroot یک daemon با همین نام اجرا می شود و root را برای برنامه های اجرایی به یک مسیر دیگر که به آن jail ( زندان ) اطلاق می شود تغییر می دهد.

Application jails, also known as “change root jails” or “chroot jails,” are another effective countermeasure. Supported by all Linux and Unix systems, application jails put up a nearly impenetrable barrier between the “jailed” software and the rest of the system. And because a jail is enforced by the operating system and not by an application, it can provide an enormous level of safety. A chroot jail “incarcerates” untrusted applications, and acts like a guard, almost literally, for applications that already have substantial security measures built-in.

از آنجا که این روش در افزایش ضریب امنیتی برنامه ها می تواند بسیار موثر واقع شود ، بسیاری از daemon ها را می توان به این روش اجرا کرد.معروفترین استفاده از chroot jail برای FTP ها می باشد که به طور مصنوعی یک محیط با دسترسی root برای کاربر FTP ایجاد می کند در حالی که کاربر درون یک chroot jail قرار دارد. سرویس های دیگری مانند وب سرور Apache را هم می توان به این روش اجرا کرد.در این حالت حتی با اجرای CGI اسکریپت های مخرب سیستم می تواند به کار خود ادامه دهد به این دلیل که آشوب در درون زندانی بسته که به بیرون دسترسی ندارد رخ داده است. برای ساختن یک jail شما نیاز دارید تا درون دایرکتوری jail محیطی شبیه به آن چه در واقعیت وجود دارد اینجاد کنید.دایرکتوری های bin lib dev tmp  و برخی دیگر از فایل ها باید دوباره ایجاد شوند و حق دسترسی آن های تعیین شود. برای آشنایی کاملتر و راه اندازی یک chroot jail ساده می توانید از مقاله زیر از مجله Linux Magazine استفاده کنید:

Go Directly to Jail : Secure Untrusted Applications with Chroot What does that mean? Think of chroot() as a kind of reality distorter. Once a running process executes chroot(“/home /jail”), /home/jail becomes “/,” and for all intents and purposes, every file and directory outside of /home/jail (including the true root directory and true /home directory) no longer exist.

همچنین در مقاله زیر از یکی از توسعه دهنده های NetBSD توضیحاتی در مورد chroot jail و چگونگی اجرای برنامه ها در آن داده است.

Securing Systems with chroot by Emmanuel Dreyfus — Recently, support was added to the NetBSD Operating System to run the Network Time Protocol Daemon (ntpd) under an unprivileged user ID in a chroot jail. In the first of two articles, Emmanuel Dreyfus explains buffer overflows — a typical Unix security flaw, then explains a chroot jail and the motivation for running a program in it.

و یک مقاله کامل و خواندنی از LiNUX.com با عنوان Chrooting Apache که راه اندازی Apache تحت chroot jail را توضیح می دهد.

The chroot daemon allows you to run a program and have it see a given directory as the root (/) directory. This effectively locks the process into its very own filesystem (“chroot jail”) isolated from the real / filesystem. In this article we will look at how to install the Apache Web server in such an environment. Installing Apache in a chroot jail does not make Apache itself any more secure. Rather, it serves to restrict the access of Apache and its child processes to a small subset of the filesystem. The advantage in chrooting a process is not in preventing a breakin, but rather in containing a potential threat.

دیدگاه‌ها بسته شده‌اند.

پیمایش به بالا