viagra usa viagra pills discounts cialis levitra viagra buy cheap viagra uk sales viagra soft tablets mexico rx viagra cheap viagra germany viagra professional indian genric viagra viagra without rx viagra prescription or non overnight viagra how much viagra costs pfizer viagra cheap viagra in canada buy viagra no prescription pills viagra usa online sales viagra 100g viagra 50 mg delivery viagra 100 mg fast where can i get viagra germany generic viagra canada viagra fast viagra for wwomen overnight generic viagra cheap natural viagra delivery canadian viagra online sale canada non prescription viagra germany online viagra canada canada viagra viagra gel viagra no prescription canadian viagra germany viagra 100 cheap viagra canada viagra oral gel where to buy viagra online now buy viagra online without prescription viagra without a prescription viagra 100mg canadian pharmacy viagra how to buy viagra viagra pfizer viagra purchase discounts what kind of viagra canada viagra usa india viagra viagra discounts discounts viagra uk real viagra cheapest viagra online gel viagra viagra for sale viagra without prescription delivery canadian pharmacies/viagra now how does viagra work? usa pfizer viagra online viagra 100mg cheap where to get viagra for women uk now buy viagra cheap buy purchase viagra with no prescription pills generic viagra 50mg viagra soft viagra overnight canada buy india viagra buy how does viagra work viagra samples germany buy real viagra no rx viagra buy cheap viagra online pharmacy viagra - 100mg canadian buy viagra single online does viagra contains pork or alcohol should you use viagra with a catheter usa viagra sale viagra prescriptions buy pfizer viagra viagra prices usa viagra online sales now viagra side effects sales viagra price comparison viagra cost viagra sales viagra in mexico viagra low price cheap viagra price germany cost of viagra viagra sample germany purchase viagra 50mg reliable purchase of viagra where to buy viagra fast viagra discount viagra with no prescription viagra cheapest germany purchase viagra benefits of viagra germany generic viagra viagra online free viagra viagra drug buy viagra no prescription discount no prescription viagra viagra canadian pharmacy viagra no doctor fast viagra side effect viagra online ordering usa viagra on line usa is there a generic version of viagra buy viagra canada where can i get cheap viagra sales viagra now low price viagra usa discount viagra online viagra on sale cheap viagras viagra on line san marino viagra for women cialis best price cialis best way to take cialis discounts brand cialis discounts brand name cialis pharmacy buy cialis buy cialis without prescription sales buy generic cialis germany buy real cialis canada brand name cialis delivery canada pharmacy cialis canada pharmacy cialis soft buy canadian online cialis canadian pharmacy online generic cialis usa cheap cialis pharmacy cheap cialis no prescription cheapest cialis on the net cheapest price cialis fast cialis 100 cialis 100mg cialis 20mg cialis 30mg fast cialis 50mg cialis abdominal pain cialis age 45 fast cialis available cialis brand cialis canada online cialis canada pharmacy cialis canadian pharmacy cialis costs online cialis fast delivery germany cialis for sale now cialis for women cialis free cialis from canada now cialis from mexico cialis gel cialis generic cheap cialis generic on lice pills cialis in canada now cialis information canada cialis korea sales cialis levitra viagra canada cialis mailed overnight buy cialis medication sales cialis mexico cialis next day cialis next day delivery cialis no prescription pharmacy cialis online canadian delivery cialis online overnight germany cialis overnight cialis overnight delivery now cialis pills cialis pills canadian pharmacy sales cialis price pills cialis professional cialis professional singapore cialis purchase cialis purchase israel fast cialis sample cialis samples cialis side effects cialis suppliers fast cialis tablet sales cialis tablets cialis to children cialis without a prescription pills cialis without prescription pills discount cialis generic cialis buy generic cialis overnight online generic cialis overnight delivery online how cialis works delivery how much is cialis how to get cialis inquiry cialis sales low price cialis online name brand cialis canada next day delivery of cialis non-prescription cialis order cialis sales ordering cialis phentolamine in generic cialis professional cialis pharmacy canada purchase real cialis usa purchse cialis real cialis soft cialis where can i buy cialis where purchase cialis cheap where should i buy cialis online cheap where to buy real cialis buy why cialis does not work cialis daily usa generic viagra female viagra viagra buy cialis daily cialis viagra generic canada women viagra cialis price professional cialis online brand viagra professional online cialis dosage buy cialis no prescription now viagra gel viagra rx in canada buy cialis online canada fast brand viagra without prescription buy delivery viagra from india pills viagra 50 mg generic viagra made in india now cialis professional next day delivery buy cialis us discount viagra overnight delivery sales cialis soft viagra for cheap how to get viagra no prescription cialis professional 100 mg canada china viagra pharmacy buy viagra now price of cialis in canada delivery cheapest viagra online levitra vs viagra buying real viagra without prescription effect of cialis on women discounts cialis daily canada viagra in canada viagra canada pills how much does cialis cost canadian pharmacy cialis sales cialis for women viagra discount natural viagra viagra dosage germany cialis daily cialis without prescription pharmacy canadian pharmacy discount code viagra viagra soft tabs 100 mg now best viagra alternative delivery viagra tablets sale discount cialis herbal viagra viagra sales in canada viagra no prescription canada viagra generic where to purchase viagra canada buy cialis once daily sales viagra side effects viagra 100 mg sales pfizer viagra cheap 5 mg cialis buy viagra in canada no prescription canadian pharmacy viagra legal now price check 50mg viagra professional cialis online generic cialis canadian order usa viagra online now buy pfizer viagra online pills viagra cheap canada cialis professional germany buy cialis on line cheap viagra for sale mexico pharmacy cialis soft viagra real viagra without prescription discount brand name cialis buying cialis on line viagra online pharmacy usa canada online cheap viagra buy viagra china buy cialis generic cialis canada low cost viagra cialis women buy online pharmacy cialis usa cialis canadian pharmacy is pfizer viagra available in india delivery viagra fast delivery delivery get cialis online fast canada pharmacy viagra pfizer cialis professional no prescription cialis canadian pharmacy online overnight canadian viagra fast generic cialis soft tabs pfizer mexico viagra best cialis price viagra china viagra tablets canada cialis 50 mg viagra brand usa women viagra buy generic viagra made in india buy buy cialis without a prescription what better viagra or cialis canadain viagra india usa buy cialis without doctor prescription germany double dose of cialis 5 mg original brand cialis viagra no prescription sales does generic cialis work cheap viagra for women in india now one day delivery cialis pills buy cialis viagra canada generic viagra cheap canada sales buy cialis online uk how does viagra work viagra professional cialis soft canada sales cialis overnight cialis vs levitra cheap real viagra online buy cialis canada online buy viagra online viagra in india cost of viagra now female viagra viagra usa buy viagra cheap canada fast best price for generic cialis us discount viagra overnight delivery cheap viagra overnight delivery buy cialis online without prescription online order viagra overnight delivery buy cialis professional viagra in canada pfizer brand name cialis cialis fast delivery usa now pfizer viagra 50 mg online cheapest prices for viagra sales cheapest prices on viagra viagra canadian scam generic cialis in india cheap viagra for cheap cheap usa generic viagra cialis blood thinner cialisis in canada buy real cialis online overnight viagra buy get cialis online cialis for sale cialis low price cialis generic viagra order buying viagra buy viagra cookies cheap viagra oral gel pharmacy viagra samples viagra pfizer online viagra fast viagra dose sales viagra viagra cost no prescription viagra pills how to get cialis no prescription purchase cialis next day delivery canada viagra pharmacies scam brand name cialis overnight viagra online without a prescription pfizer viagra buy brand name cialis without prescription pills cialis and canada custom online viagra canadian pharmacy dosage cialis next day delivery fast brand viagra over the net can i get viagra in mexico online generic cialis 100 mg online pharmacy cialis low cost canadian viagra buy where to get viagra cheap now cialis canadian pharmacy sales where to get viagra cheap cialis samples in canada buy cialis doctor online viagra overnight delivery viagra generic canada pharmacy cialis germany pfizer female viagra cialis prescription

 

August 31, 2007

SE Linux

Filed under: Linux Basics — @ 6:13 am

SELINUX (Security-Enhanced Linux)

SELinux History

SELinux was originally a development project from the National Security Agency (NSA), Secure Computing corporation (SCC) and others. It is an implementation of SCC and others. It is an implementation of Flask Operating System security architecture. As a step in its evolution, SELinux was integrated into Linux kernel using the Linux Security Modules (LSM) framework. SELinux motivated the creation of LSM, at the suggestion of Linus Torvalds, who wanted a modular approach to security instead of just accepting SELinux into kernel. SELinux in now a standard component of RHEL and non-commercial distros like Fedora, Debian GNU/Linux, Gentoo Linux etc.

Introduction

In the world of Linux, SELinux is the new buzzword. Most OS use access controls to limit the access a user/process has on other parts of the system such as files, devices, sockets, ports and other processes (called objects in SELinux). The two main types are

1. Discretionary Access Control (DAC)2. Mandatory Access Control (MAC)

SELinux supplements the traditional DAC mechanism of linux with MAC. Under SELinux, programs are run inside a sandbox and follow the principle of least privilege, in which programs are limited to set of necessary operations.

Discretionary Access Control (DAC)

Discretionary Access Control (DAC) is the standard mechanism for Linux security. Under DAC, all processes run with an associated user and group. That process has access to all files and directories that the user and group can access. Thus an errant process could destroy all files that belong to the user!

Under DAC, ownership of a file object provides potentially crippling or risky control over the object, A user can expose a file or directory to a security or confidentiality breach with a misconfigured ‘chmod’ command and an unexpected propagation of access rights. A process started by that user, such as a CGI script, can do anything to the files owned by the user. A compromised apache HTTP server can perform any operation on file in the Apache group. Malicious or broken software can have root-level access to entire system, either by running as a root process or using ‘setuid’ or ‘setgid’.

Mandatory Access Control (MAC)

Also called non-discretionary access control, this framework allows you to define permissions for how all processes (called subjects) interact with other objects. This is done through a security policy defined by administrator, over all processes and objects are controlled through the kernel, and security decisions are made or all available information rather than just the user identity. With this model , a process can be granted just the permissions needed to be functional. This follows the principle of least privilege. Under MAC, for example, users who have exposed their data using ‘chmod’ are protected by the fact that their data is a kind only associated with user home directories, and confined processes cannot touch those files without permission and purpose written into the policy.

SELinux Architecture

SELinux adds another layer of access control permissions on top of standard file permission and ACLs, which are defined by the system security policy. Every object (files and other items) ad every subject security (process) has security context, with three attributes – a User Identity , a role and a type. Collectively, these attributes limit the authority of the subject over the object, Typically , the security context is displayed as a colon-separated triplet in this format

user_identity:role:type

To view the security context information associated with obejects, you may use commands with –Z option:

For example:

# ls –Z vmlinuz-2.6.9.5.0.3.EL-rw—r—r root root system_u:object_r:boot_rvmlinuz-2.6.9.5.0.3.EL

User Identity indicates the SELinux user account that is associated with a subject or object. SELinux user identities are different from UNIX identities. They are applied as a part of the security label and can be changed in real-time under limited conditions. SELinux uses it own database and mapping that associates SELinux user identities with Linux users. Role define a set of permissions a user can be granted. A user can reside only in a single role at any given time. Types or domains are primary security attributes used for making authorization decision.

The SELinux policy defined in /etc/selinux/targeted/policy/ controls these omportant aspects:

1.

The particular roles that identities can use.
2.

Which domains roles can enter
3. The type that domains can access

The SELinux policy is highly configurable. For RHEL 4, RedHat Supports a single policy – targeted policy. Under this policy, every subject and object runs in unconfined_t domain except for the specific targeted daemons. The objects on the system that are in the unconfined_t domains are allowed by SELinux to have no restriction and fall back to using standard Linux security, which is DAC. This policy is flexible enough to fit into enterprise infrastructures, The daemons that are part of targeted policy run in their own domains and are restricted in every operations they can perform on the system. This way, daemons that are broken or exploited are limited in the damage that are broken or exploited are limited in the damage that they can do.

Controlling SELinux

The SELinux policy may be adjusted or diabled through a number of utilities. The easiest to use is the graphical system-config-securitylevel tool, which can turn SELinux off, set it to permissive mode, or set it to enforcing mode. It also allows the adjustments of “Booleans” which can fine tune the rules enforced by the policy.

When SELinux is enabled, there are two modes:

1. Permissive2. Enforcing

Permissive mode is the ‘warn’ only mode. That is, it allows all process access to the file system using standard DAC, but it will log all access violations that would have been there, if SELinux has been in the enforcing mode in /var/log/messages.

The Enforcing mode allows SELinux to control access to the system using MAC, and thus enforces the SELinux policy. These modes can be controlled dynamically using the setenforce command, and can be permemently set in the file /etc/sysconfig/selinux

Setenforce is a command-line tool that allows SELinux to the set enforcing mode or permissive mode. To completely disable SELinux, one must use system-config-securitylevel to pass selinux=0 on the kernel line, or in the /etc/sysconfig/selinux file.

The kernel option enforcing=0 can be passed through GRUB at the boot time to set SELinux in warn-only mode; enforcing=1 sets enforcing mode. The /selinux virtual file system is similar to /proc and /sys. It presets information about the state of SELinus in the kernel to user programs like the ones above. sestatus shows the actual SELinux settings.

The contexts of files can be changed using the ‘chcon’ command. It has a –reference option, which can be used to copy and apply the context from particular file.

Troubleshooting SELinux

SELinux policy violations are logged to /var/log/messages.

Reference:http://www.nsa.gov/selinuxhttp://www.redhat.com

*********************************

Article Authored by Jomos

Author, Jomos, is a Systems Engineer with SupportPRO. Jomos specializes in Cpanel, Linux and Windows servers. SupportPRO offers 24X7 technical support services to Web hosting companies and service providers.

AddThis Social Bookmark Button

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress