Welcome To Tutorial Linux / Unix Blog's

Sunday, December 25, 2011

Kernel Security (SELinux vs AppArmor vs. grsecurity)



Linux kernel is the central component of the Linux operating systems. It is Responsible for managing the system's resources, the communications the between hardware and software and security. Kernel play a critical role in supporting security at higher levels. Unfortunately, the stock kernel is not secured out of the box. There are some Important Linux kernel patches to secure your box. They differ significantly in how They are administered and how They integrate into the system. They also allow for easy control of access the between processes and objects, processes and other processes, and objects and other objects. The following pros and cons list is based upon my personal experience.

SELinux

Security-Enhanced Linux (SELinux) is a Linux That feature provides a variety of security policies for the Linux kernel. It is included with CentOS / RHEL / Fedora Linux, Debian / Ubuntu, Suse, Slackware and many other distributions.
SELinux features

1. Clean separation of policy from enforcement
2. Well-defined policy interfaces
3. Support for applications querying the policy and enforcing access control
4. Independent of specific policies and policy languages
5. Independent of specific security label formats and contents
6. Individual labels and controls for kernel objects and services
7. Caching of access decisions for efficiency
8. Support for policy changes
9. Separate measures for protecting system integrity (domain-type) and data confidentiality (multilevel security)
10. Very flexible policy
11. Controls over process initialization and inheritance and program execution
12. Controls over file systems, directories, files, and open file descriptors
13. Controls over sockets, messages, and network interfaces
14. Controls over use of "capabilities"

Pros and Cons

* Admin skill set (learning curve) - High
* Complex and powerful access control mechanism - Yes
* Detailed configuration required - Yes
* GUI tools to write / modify rules set - Yes
* CLI tools to write / modify rules set - Yes (see list of commands here)
* Ease of use - No (Often described as horrible to use)
* Binary package - Available for most Linux distributions
* System performance impact: None
* Security Framework: mandatory access controls using Flask
* Auditing and logging is supported - Yes
* Typical user base - Enterprise users
* Documentation - Well documented

= Official project website: nsa.gov
AppArmor

AppArmor (Application Armor) is another security software for Linux is the which maintained and released by Novell under the GPL. AppArmor was created as an alternative to SELinux. AppArmor works with file paths. According to the official Novell FAQ:

AppArmor is the most effective and easy-to-use Linux application security system available on the market today. AppArmor is a security framework proactively That Protects the operating system and applications from external or internal threats, even zero-day attacks, by enforcing good behavior and program Preventing even unknown software flaws from being exploited. AppArmor security profiles completely define what system resources individual programs can access, and with what privileges. A number of default policies are included with AppArmor, and using a combination of advanced static analysis and learning-based tools, AppArmor policies for even very complex applications can be deployed successfully in a matter of hours.

AppArmor is the default in openSUSE and Suse Enterprise Linux. It was first successfully packaged for Ubuntu Linux.
Features

1. Full integration.
2. Easy deployment.
3. AppArmor includes a full suite of console and YaST-based tools to help you develop, deploy and maintain application security policies.
4. Protects the operating system, custom and third-party applications from Both external and internal threats by enforcing Appropriate application behavior.
5. Reporting and alerting. Built-in features allow you to schedule detailed event reports and configure alerts based on user-defined events.
6. Sub-process confinement. AppArmor allows you to define security policies for individual Perl and PHP scripts for Web-server tighter security.

Pros and Cons

* Admin skill set (learning curve) - Medium
* Complex and powerful access control mechanism - Yes.
* Detailed configuration required - Yes.
* GUI tools to write / modify rules set - Yes (YaST2 and wizards).
* CLI tools to write / modify rules set - Yes.
* Ease of use - Yes (Often described as less complex and Easier for the average user to learn than SELinux).
* Binary package - Available for Ubuntu / Suse / OpenSuse and distros.
* System Performance Impact - None.
* Security Framework - mandatory access controls.
* Auditing and logging is supported - Yes.
* Typical user base - Enterprise users.
* Documentation - Documented (mostly available from OpenSuse and Suse Enterprise Linux).

= Official project website: novell.com
grsecurity

grsecurity is a set of patches for the Linux kernel with an emphasis on enhancing security. It utilizes a multi-layered detection, prevention, and containment model. It is licensed under the GPL.
Features

1. An intelligent and robust Role-Based Access Control (RBAC) That the system can generate least privilege policies for your entire system with no configuration
2. Change root (chroot) hardening
3. / Tmp race prevention
4. Extensive auditing
5. Prevention of arbitrary code execution, regardless of the technique used (stack smashing, heap corruption, etc)
6. Prevention of arbitrary code execution in the kernel
7. Randomization of the stack, library, and heap the bases
8. Kernel stack base randomization
9. Protection against exploitable null-pointer dereference bugs in the kernel
10. Reduction of the risk of sensitive information being leaked by arbitrary-read kernel bugs
11. A That restriction allows a user to only view his / her processes
12. Security alerts and Audits That contain the IP address of the person Causing the alert

Pros and Cons

* Admin skill set (learning curve) - Low.
* Complex and powerful access control mechanism - No (it is Simpler to administer than other two Implementations. Also, policies are Simpler to create, since there are no roles or complicated domain / file Transitions).
* Detailed configuration required - No (works in learning mode).
* GUI tools to write / modify rules set - No.
* CLI tools to write / modify rules set - Yes (gradm tool).
* Ease of use - Yes.
* Binary package - Available for Ubuntu / RHEL / CentOS / Debian distros.
* System Performance Impact - None.
* Security Framework - mandatory access controls (precisely, it is a RBAC implementation) using access control lists.
* Auditing and logging is supported - Yes.
* Typical user base - Webserver and hosting companies.
* Documentation - unfortunately, is not well documented.

= Official project website: grsecurity.net
Conclusion:

All three offers very good protection and I can select Them based upon the following simple criteria:

* New user / ease of use: grsecurity
* Easy to Understand policies and tools: AppArmor
* Most powerful access control mechanism: SELinux

My personal choice is grsecurity as it is Easier to use and offers many other security features. I've used SELinux as it is the default choice under RHEL. AppArmor was only tested in the lab under OpenSuse. I suggest you download and install all 3 patches (also available via the binary deb and rpm files) and compare Them as per your setup to gain a deeper understanding of Their differences.

Beri peringkat terjemahan



No comments:

Post a Comment