include("site.inc"); $template = new Page; $template->initCommon(); $template->displayHeader(); ?>
Francesco Tombolini
Copyright © 2004, 2005 Red Hat, Inc., Karsten Wade
Copyright © 2006 Chad Sellers, Paul W. Frields
Permission is granted to copy, distribute, and/or modify this document under the terms of the Open Publication Licence, Version 1.0, or any later version. The terms of the OPL are set out below.
Open Publication works may be reproduced and distributed in whole or in part, in any medium physical or electronic, provided that the terms of this license are adhered to, and that this license or an incorporation of it by reference (with any options elected by the author(s) and/or publisher) is displayed in the reproduction.
Proper form for an incorporation by reference is as follows:
Copyright (c) <year> by <author's name or designee>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, vX.Y or later (the latest version is presently available at http://www.opencontent.org/openpub/).
The reference must be immediately followed with any options elected by the author(s) and/or publisher of the document (see section VI). Commercial redistribution of Open Publication-licensed material is permitted. Any publication in standard (paper) book form shall require the citation of the original publisher and author. The publisher and author's names shall appear on all outer surfaces of the book. On all outer surfaces of the book the original publisher's name shall be as large as the title of the work and cited as possessive with respect to the title.
The copyright to each Open Publication is owned by its author(s) or designee.
The following license terms apply to all Open Publication works, unless otherwise explicitly stated in the document.
Mere aggregation of Open Publication works or a portion of an Open Publication work with other works or programs on the same media shall not cause this license to apply to those other works. The aggregate work shall contain a notice specifying the inclusion of the Open Publication material and appropriate copyright notice.
SEVERABILITY. If any part of this license is found to be unenforceable in any jurisdiction, the remaining portions of the license remain in force.
NO WARRANTY. Open Publication works are licensed and provided "as is" without warranty of any kind, express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose or a warranty of non-infringement.
All modified versions of documents covered by this license, including translations, anthologies, compilations and partial documents, must meet the following requirements:
The modified version must be labeled as such.
The person making the modifications must be identified and the modifications dated.
Acknowledgement of the original author and publisher if applicable must be retained according to normal academic citation practices.
The location of the original unmodified document must be identified.
The original author's (or authors') name(s) may not be used to assert or imply endorsement of the resulting document without the original author's (or authors') permission.
In addition to the requirements of this license, it is requested from and strongly recommended of redistributors that:
If you are distributing Open Publication works on hardcopy or CD-ROM, you provide email notification to the authors of your intent to redistribute at least thirty days before your manuscript or media freeze, to give the authors time to provide updated documents. This notification should describe modifications, if any, made to the document.
All substantive modifications (including deletions) be either clearly marked up in the document or else described in an attachment to the document.
Finally, while it is not mandatory under this license, it is considered good form to offer a free copy of any hardcopy and CD-ROM expression of an Open Publication-licensed work to its author(s).
The author(s) and/or publisher of an Open Publication-licensed document may elect certain options by appending language to the reference to or copy of the license. These options are considered part of the license instance and must be included with the license (or its incorporation by reference) in derived works.
A. To prohibit distribution of substantively modified versions without the explicit permission of the author(s). "Substantive modification" is defined as a change to the semantic content of the document, and excludes mere changes in format or typographical corrections.
To accomplish this, add the phrase 'Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.' to the license reference or copy.
B. To prohibit any publication of this work or derivative works in whole or in part in standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder.
To accomplish this, add the phrase 'Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.' to the license reference or copy.
Revision History | ||
---|---|---|
Revision 1.5.6 | 2006-04-28 | CS |
Fix for bz #18727, bz#139744, bz#144696, bz#147915, and bz#190181; other fixes, including from http://fedoraproject.org/wiki/SELinux/FAQ/ProposedAdditions | ||
Revision 1.5.5 | 2006-04-07 | KW |
Fix for bz #188219; legal notice fix. | ||
Revision 1.5.4 | 2006-03-21 | CS |
Updated log file location for FC5 release, added targeted domains FAQ | ||
Revision 1.5.3 | 2006-03-21 | CS |
Numerous content updates for FC5 release | ||
Revision 1.5.2 | 2006-02-10 | PWF |
Make admonition more easily maintainable | ||
Revision 1.5.1 | 2006-02-05 | PWF |
Style and readability editing; some element clarifications | ||
Revision 1.5 | 2006-02-03 | CS |
First round of editing. |
The information in this FAQ is valuable for those who are new to SELinux. It is also valuable if you are new to the latest SELinux implementation in Fedora Core, since some of the behavior may be different than you have experienced.
This FAQ is specific to Fedora Core 5 | |
---|---|
If you are looking for the FAQ for other versions of Fedora Core, refer to http://fedora.redhat.com/docs/selinux-faq/. |
For more information about how SELinux works, how to use SELinux for general and specific Linux distributions, and how to write policy, these resources are useful:
External Link List
NSA SELinux main website — http://www.nsa.gov/selinux/
NSA SELinux FAQ — http://www.nsa.gov/selinux/info/faq.cfm
SELinux community page — http://selinux.sourceforge.net
UnOfficial FAQ — http://www.crypt.gen.nz/selinux/faq.html
Writing traditional SE Linux policy HOWTO — https://sourceforge.net/docman/display_doc.php?docid=21959&group_id=21266
Reference Policy (the new policy found in Fedora Core 5) — http://serefpolicy.sourceforge.net/
SELinux policy development training courses — http://tresys.com/services/training.shtml and https://www.redhat.com/training/security/courses/rhs429.html
Getting Started with SE Linux HOWTO: the new SE Linux (Debian) — https://sourceforge.net/docman/display_doc.php?docid=20372&group_id=21266
List of SELinux object classes and permissions — http://tresys.com/selinux/obj_perms_help.shtml
On IRC — irc.freenode.net, #fedora-selinux
Fedora mailing list — mailto:fedora-selinux-list@redhat.com; read the archives or subscribe at http://www.redhat.com/mailman/listinfo/fedora-selinux-list
Making changes/additions to the Fedora SELinux FAQ | |
---|---|
This FAQ is available at http://fedora.redhat.com/docs/selinux-faq-fc5/.
For changes or additions to the Fedora SELinux FAQ, use this bugzilla template, which pre-fills most of the
bug report. Patches should be a diff -u against the
XML, which is available from CVS (refer to http://fedora.redhat.com/projects/docs/ for details on
obtaining the fedora-docs/selinux-faq module from anonymous CVS; you can
get just the For a list of all bug reports filed against this FAQ, refer to https://bugzilla.redhat.com/bugzilla/showdependencytree.cgi?id=118757. |
1.1. Understanding SELinux | ||||
| ||||
Q: | What is SELinux? |
|||
A: |
SELinux (Security-Enhanced Linux) in Fedora Core is an implementation of mandatory access control in the Linux kernel using the Linux Security Modules (LSM) framework. Standard Linux security is a discretionary access control model.
In a DAC model, file and resource decisions are based solely on user identity and ownership of the objects. Each user and program run by that user has complete discretion over the user's objects. Malicious or flawed software can do anything with the files and resources it controls through the user that started the process. If the user is the super-user or the application is setuid or setgid to root, the process can have root level control over the entire file system. A MAC system does not suffer from these problems. First, you can administratively define a security policy over all processes and objects. Second, you control all processes and objects, in the case of SELinux through the kernel. Third, decisions are based on all the security relevant information available, and not just authenticated user identity. MAC under SELinux allows you to provide granular permissions for all subjects (users, programs, processes) and objects (files, devices). In practice, think of subjects as processes, and objects as the target of a process operation. You can safely grant a process only the permissions it needs to perform its function, and no more. The SELinux implementation uses role-based access control (RBAC), which provides abstracted user-level control based on roles, and Type Enforcement® (TE). TE uses a table, or matrix to handle access controls, enforcing policy rules based on the types of processes and objects. Process types are called domains, and a cross-reference on the matrix of the process's domain and the object's type defines their interaction. This system provides extremely granular control for actors in a Linux system. |
|||
Q: | What is SELinux policy? |
|||
A: |
The SELinux policy describes the access permissions for all subjects and objects, that is, the entire system of users, programs, and processes and the files and devices they act upon. Fedora Core policy is delivered in a package, with an associated source package. Current shipping policy packages are:
More information on the different policies available in SELinux can be found at http://fedoraproject.org/wiki/SELinux/Policies. |
|||
Q: | What is the SELinux targeted policy? |
|||
A: |
When SELinux was initially introduced in Fedora Core, it enforced the NSA strict policy. For testing purposes, this effectively exposed hundreds of problems in the strict policy. In addition, it demonstrated that applying a single strict policy to the many environments of Fedora users was not feasible. To manage a single strict policy for anything other than default installation would require local expertise. At this point, the SELinux developers reviewed their choices, and decided to try a different strategy. They decided to create a targeted policy that locks down specific daemons, especially those vulnerable to attack or which could devastate a system if broken or compromised. The rest of the system runs exactly as it would under standard Linux DAC security.
Under the targeted policy, most processes run in the
Those network daemons which are addressed in the targeted policy
make a transition to the targeted policy when the application
starts. For example, at system boot, init runs
under the For more information on enabling or disabling targeted policy on each of the specific daemons, refer to How to use system-config-securitylevel. More information on the different policies available in SELinux can be found at http://fedoraproject.org/wiki/SELinux/Policies. |
|||
Q: | What programs are protected by the targeted policy? |
|||
A: |
Currently, the list of programs is approximately:
|
|||
Q: | What about the strict policy? Does it even work? |
|||
A: |
The strict policy does work on Fedora Core. It is challenged by the unique environments of different users. To use the strict policy in your environment, you may need to fine-tune both the policy and your systems. To make the strict policy easier to use, SELinux developers have tried to make the change from one policy to the other easier. For example, system-config-securitylevel builds a relabel into the startup scripts. More information on the different policies available in SELinux can be found at http://fedoraproject.org/wiki/SELinux/Policies. |
|||
Q: | What is the mls policy? Who is it for? |
|||
A: |
The mls policy is similar to the strict policy, but adds an additional field to security contexts for separating levels. SELinux can use these levels to separate data in an environment that calls for strict hierarchical separation. A typical example is a military setting, where data is classified at a certain level. This policy is geared toward this sort of environment, and is probably not useful to you unless you fall into this category. More information on the different policies available in SELinux can be found at http://fedoraproject.org/wiki/SELinux/Policies. |
|||
Q: | What is the Reference Policy? |
|||
A: |
The Reference Policy is a new project maintained by Tresys Technology (http://www.tresys.com/) designed to rewrite the entire SELinux policy in a way that is easier to use and understand. To do this, it uses the concepts of modularity, abstraction, and well-defined interfaces. Refer to http://serefpolicy.sourceforge.net/ for more information on the Reference Policy. Note that Reference Policy is not a new type of policy, like targeted or strict. Rather, it is a new base that policies can be built from. Targeted, strict, and mls policies can all be built from Reference Policy. In fact, one of the design goals of Reference Policy is to have a single unified source tree for the different policy variants. Fedora policies at version 1.x are based on the traditional example policy. Version 2.x policies (as used in Fedora Core 5) are based on the Reference Policy. |
|||
Q: | What are file contexts? |
|||
A: |
File contexts are used by the setfiles command to generate persistent labels which describe the security context for a file or directory.
Fedora Core ships with the fixfiles script, which
supports three options: |
|||
Q: | How do I view the security context of a file, user, or process? |
|||
A: |
The new option
ls -alZ
|
|||
Q: | What is the difference between a domain and a type? |
|||
A: | There is no difference between a domain and a type, although domain is sometimes used to refer to the type of a process. The use of domain in this way stems from Domain and Type Enforcement (DTE) models, where domains and types are separate. |
|||
Q: | What are policy modules? |
|||
A: |
Prior to Fedora Core 5, SELinux policies were monolithic, meaning making a change required getting the entire policy source, modifying it, compiling it, and replacing the current policy with it. With Fedora Core 5, the policy is now modular. This means that third party developers can ship policy modules with their applications, and then they can be added to the policy without having to switch out the entire policy. The new module is then added to the module store, which results in a new policy binary that is a combination of the previous policy and the new module. This actually works by separating out compile and link steps in the policy build procedure. Policy modules are compiled from source, and linked when installed into the module store (see Managed Policy). This linked policy is then loaded into the kernel for enforcement. The primary command for dealing with modules is semodule, which lets you perform basic functions such as installing, upgrading, or removing modules. Other useful commands include checkmodule, which is the module compiler and is installed with the checkpolicy rpm, as well as semodule_package, which creates a policy package file (.pp) from a compiled policy module.
Modules are usually stored as policy package file (.pp
extension) in
To see how to write a simple policy module, check out Local Policy Customizations. |
|||
Q: | What is managed policy? |
|||
A: |
Prior to Fedora Core 5, SELinux policies were handled as user-editable
config files in etc. Unfortunately, this made it difficult to
address many of the usability issues arising with SELinux. So, a
new library, You should never have to edit the store directly. Instead, you should use tools that link against libsemanage. One example tool is semanage, which is a command line tool for managing much of the policy such as SELinux user mappings, SELinux port mappings, and file contexts entries. Other examples of tools that use libsemanage include semodule which uses it to manage the SELinux policy modules installed to the policy store and setsebool which uses it manage SELinux policy booleans. Additionally, graphical tools are currently being developed to utilize the functionality provided by libsemanage. |
|||
1.2. Controlling SELinux | ||||
| ||||
Q: | How do I install/not install SELinux? |
|||
A: | The installer follows the choice you make in the Firewall Configuration screen. The default running policy is the targeted policy, and it is on by default. |
|||
Q: | As an administrator, what do I need to do to configure SELinux for my system? |
|||
A: |
The answer might be nothing. There are many Fedora users that don't even realize that they are using SELinux. SELinux provides protection for their systems with an out-of-the-box configuration. That said, there are a couple of things an administrator might want to do to configure their system. These include:
|
|||
Q: | How do I enable/disable SELinux protection on specific daemons under the targeted policy? |
|||
A: |
Use system-config-securitylevel, also known as
the Security Level Configuration
graphical tool, to control the
Boolean values of specific daemons. For example, if you need to
disable SELinux for Apache to run correctly in your environment, you
can disable the value in
system-config-securitylevel. This change
disables the transition to the policy defined in
|
|||
Q: | In the past I have written local.te file in policy sources for my own local customization to policy, how do I do this in Fedora Core 5? |
|||
A: |
Since Fedora Core 5 uses a modular policy, you don't have to have the complete policy source any more. Now, you can just create a local policy module for your local policy customizations. To do this, follow these steps.
|
|||
Q: | I have some avc denials that I would like to allow, how do I do this? |
|||
A: |
If you have specific AVC messages you can use audit2allow to generate a Type Enforcement file that is ready to load as a policy module.
audit2allow -M local < /tmp/avcs
This creates a
audit2allow -m local -l -i /var/log/messages > local.te
Note that the above assumes you are not using the audit daemon.
If you were using the audit daemon, then you should use
You can hand edit this file, removing allow statements that you don't want to allow, and then recompile and reload it using
|
|||
Q: | How can I help write policy? |
|||
A: |
Your help is definitely appreciated.
Also, since the Fedora Core 5 policy is based on the Reference Policy, you should look at the
documentation on its project page. Another excellent source of
information is the example policy files in
If you want to create a new policy domain, you can look at the
interface files in the
Now you can collect avc messages. You can use
audit2allow to translate the avc messages to
allow rules and begin updating your
|
|||
Q: | How do I switch the policy I am currently using? |
|||
A: |
To use the automated method, run the Security Level Configuration tool. From the GUI Main Menu, select → → , or from a terminal, run system-config-securitylevel. Change the policy as desired and ensure that the Relabel on next reboot option is enabled. You can also perform these steps manually with the following procedure:
|
|||
Q: | How can I back up files from an SELinux file system? |
|||
A: |
Use the star utility, which supports the
extended attributes that store the security context labels.
Specify the ls -Z /var/log/maillog -rw------- root root system_u:object_r:var_log_t /var/log/maillog cd /var/log star -xattr -H=exustar -c -f maillog.star ./maillog*
|
|||
Q: | How can I install the strict policy by default with kickstart? |
|||
A: |
|
|||
Q: |
How do I make a user |
|||
A: |
This process presumes that you have enabled user public HTML
directories in your Apache configuration file,
|
|||
Q: | How do I turn SELinux off at boot? |
|||
A: |
Set
Alternatively, you can add
|
|||
Q: | How do I turn enforcing on/off at boot? |
|||
A: |
You can specify the SELinux mode using the configuration file
Setting the value to
However, setting the value to
|
|||
Q: | How do I temporarily turn off enforcing mode without having to reboot? |
|||
A: |
Occasionally you may need to perform an action that is normally prevented by policy. Run the command setenforce 0 to turn off enforcing mode in real time. When you are finished, run setenforce 1 to turn enforcing back on.
|
|||
Q: | How do I turn system call auditing on/off at boot? |
|||
A: |
Add
System-call auditing is on by default. When
on, it provides information about the system call that was
executing when SELinux generated a
|
|||
Q: | How do I temporarily turn off system-call auditing without having to reboot? |
|||
A: | Run auditctl -e 0. Note that this command does not affect auditing of SELinux AVC denials. |
|||
Q: | How do I get status info about my SELinux installation? |
|||
A: |
As root, execute the command /usr/sbin/sestatus
-v. For more information, refer to the
|
|||
Q: | How do I write policy to allow a domain to use pam_unix.so? |
|||
A: |
Very few domains in the SELinux world are allowed to read the
allow mydomain_t shadow_t:file read;
In RHEL4 you can setup your domain to use the unix_chkpwd command. The easiest way is to use the unix_chkpwd attribute. So if you were writing policy for an ftpd daemon you would write something like
daemon_domain(vsftpd, `auth_chkpwd')
This would create a context where
vsftpd_t -> chkpwd_exec_t -> system_chkpwd_t which can read
In Fedora Core 5/RHEL5, add the rule
auth_domtrans_chk_passwd(vsftpd_t)
|
|||
Q: | I created a new Policy Package, where do I put it to make sure that it gets loaded into the kernel? |
|||
A: |
You need to execute the command semodule -i myapp.pp. This modifies the policy that is stored on the machine. Your policy module now is loaded with the rest of the policy. You can even remove the pp file from the system. semodule -l lists the currently loaded modules.
If you later would like to remove the policy package, you can execute semodule -r myapp. |
|||
1.3. Resolving Problems | ||||
| ||||
Q: | Where are SELinux AVC messages (denial logs, etc.) stored? |
|||
A: |
In Fedora Core 2 and 3, SELinux AVC messages could be found in
|
|||
Q: |
My application isn't working as expected and I am seeing
|
|||
A: |
This message means that the current SELinux policy is not allowing the application to do something. There are a number of reasons this could happen.
First, one of the files the application is trying to access could
be mislabeled. If the AVC message refers to a specific file,
inspect its current label with ls -alZ
Denials are sometimes due to a configuration change in the program
that triggered the denial message. For example, if you change
Apache to also listen on port 8800, you must also change the
security policy, If you are having trouble getting a specific application like Apache to work, refer to How to use system-config-securitylevel for information on disabling enforcement just for that application. |
|||
Q: |
I installed Fedora Core on a system with an existing
|
|||
A: |
Your
If you just want to relabel
/sbin/restorecon -v -R /home
If you want to be sure there are no other files incorrectly labeled, you can relabel the entire file system:
/sbin/fixfiles relabel
You must have the |
|||
Q: |
After relabeling my |
|||
A: |
You can read the files from a non-SELinux distribution, or one with
SELinux disabled. However, files created by a system not using SELinux
systems do not have a security context, nor do any files you
remove and recreate. This could be a challenge with files such as
|
|||
Q: | How do I share directories using NFS between Fedora Core and non-SELinux systems? |
|||
A: |
Just as NFS transparently supports many file system types, it can be used to share directories between SELinux and non-SELinux systems.
When you mount a non-SELinux file system via NFS, by default SELinux
treats all the files in the share as having a context of
mount -t nfs -o context=system_u:object_r:tmp_t server:/shared/foo /mnt/foo
When SELinux exports a file system via NFS, newly created files have the context of the directory they were created in. In other words, the presence of SELinux on the remote mounting system has no effect on the local security contexts. |
|||
Q: | How can I create a new Linux user account with the user's home directory having the proper context? |
|||
A: |
You can create your new user with the standard
useradd command. First you must become
For the targeted policy you do not need
to switch roles, staying in
The initial context for a new user directory has an identity of
|
|||
Q: | Does the su command change my SELinux identity and role? |
|||
A: |
In previous versions of Fedora Core, security context transitions were
integrated into the su via
Other forms of Linux/UNIX® identity change, for example setuid(2), also do not cause an SELinux identity change. |
|||
Q: | I'm having troubles with avc errors filling my logs for a particular program. How do I choose not to audit the access for it? |
|||
A: |
If you wanted to not audit dmesg, for example,
you would put this in your
This eliminates the error output to the terminal for all
user domains, including |
|||
Q: |
Even running in permissive mode, I'm getting a large number of
|
|||
A: |
In a non-enforcing mode, you should actually receive more messages than in enforcing mode. The kernel logs each access denial as if you were in an enforcing mode. Since you are not restricted by policy enforcement, you can perform more actions, which results in more denials being logged. If an application running under an enforcing mode is denied access to read a number of files in a directory, it is stopped once at the beginning of the action. In a non-enforcing mode, the application is not stopped from traversing the directory tree, and generates a denial message for each file read in the directory. |
|||
Q: |
I get a specific permission denial only when SELinux is in enforcing
mode, but I don't see any audit messages in
|
|||
A: |
The most common reason for a silent denial is when the policy
contains an explicit
To look for your particular denial, enable
auditing of all
semodule -b /usr/share/selinux/targeted/enableaudit.pp
Once you have found your problem you can reset to the default mode by executing
semodule -b /usr/share/selinux/targeted/base.pp
|
|||
Q: | Why do I not see the output when I run certain daemons in debug or interactive mode? |
|||
A: |
SELinux intentionally disables access to the tty devices to stop daemons from communicating back with the controlling terminal. This communication is a potential security hole because such daemons could insert commands into the controlling terminal. A broken or compromised program could use this hole to cause serious problems. There are a few ways you can capture standard output from daemons. One method is to pipe the output to the cat command.
snmpd -v | cat
When debugging a daemon, you may want to turn off the transition of the daemon to its specific domain. You can do this using system-config-securitylevel or setsebool on the command line. A final option is to turn off enforcing mode while debugging. Issue the command setenforce 0 to turn off enforcing mode, and use the command setenforce 1 to re-enable SELinux when you are finished debugging. |
|||
Q: | When I do an upgrade of the policy package (for example, using yum), what happens with the policy? Is it updated automatically? |
|||
A: |
Policy reloads itself when the package is updated. This behavior replaces the manual make load.
In certain situations, you may need to relabel the file system.
This might occur as part of an SELinux bug fix where file contexts
become invalid, or when the policy update makes changes to the
file
After the file system is relabeled, a reboot is not required, but is useful in ensuring every process and program is running in the proper domain. This is highly dependent on the changes in the updated policy. To relabel, you have several options. You may use the fixfiles command:
fixfiles relabel
reboot
Alternately, use the
touch /.autorelabel
reboot
|
|||
Q: | If the policy shipping with an application package changes in a way that requires relabeling, will RPM handle relabeling the files owned by the package? |
|||
A: | Yes. The security contexts for the files owned by the package are stored in the header data for the package. The file contexts are set directly after the cpio copy, as the package files are being put on the disk. |
|||
Q: |
Why do binary policies distributed with Fedora, such as
|
|||
A: |
When you install a policy package, pre-compiled binary policy
files are put directly into |
|||
Q: | Will new policy packages disable my system? |
|||
A: |
There is a possibility that changes in the policy package or in
the policy shipping with an application package can cause errors,
more denials, or other unknown behaviors. You can
discover which package caused the breakage by reverting policy and
application packages one at a time. If you don't want to return
to the previous package, the older version of the configuration
files will be saved with the extension |
|||
Q: | My console is being flooded with messages. How do I turn them off? |
|||
A: |
To regain useful control, turn off kernel messages to the console with this command:
dmesg -n 1
|
|||
Q: | Can I test the default policy without installing the policy source? |
|||
A: |
You can test SELinux default policy by installing just the
The command fixfiles relabel is the equivalent
of make relabel. During the relabeling, it
will delete all of the files in
Other commands are fixfiles check, which checks
for mislabeled files, and fixfiles restore,
which fixes the mislabeled files but does not delete the files in
|
|||
Q: | Why are some of my KDE applications having trouble under SELinux? |
|||
A: |
KDE executables always appear as kdeinit, which limits what can be done with SELinux policy. This is because every KDE application runs in the domain for kdeinit.
Problems often arise when installing SELinux because it is not
possible to relabel The solution is to fully log out of KDE and remove all KDE temporary files:
rm -rf /var/tmp/kdecache-
At your next login, your problem should be fixed. |
|||
Q: |
Why does |
|||
A: |
Be careful of white space in the file
|
|||
Q: |
I have a process running as
|
|||
A: |
We have begun to confine the
These show up in
which indicates that the library is trying to perform a text relocation and failing. Text relocations are bad, but can be allowed via the first hint below. Below are the SELinux memory permissions that are denied, as well as hints at how to address these denials.
|
|||
Q: | What do these rpm errors mean? |
|||
A: |
During the update process, the selinux package runs restorecon on the difference between the previously install policy file_context and the newly install policy context. This maintains the correct file context on disk.
This indicates that the updated policy has removed the boolean from policy. |
|||
Q: | I want to run a daemon on a non standard port but SELinux will not allow me. How do get this to work? |
|||
A: |
You can use the semanage command to define additional ports. So say you want httpd to be able to listen on port 8082. You could enter the command.
semanage port -a -p tcp -t http_port_t 8082
|
|||
Q: | How do I add additional translations to my MCS/MLS system? |
|||
A: |
Translations are handled through libsemanage. Use semanage translation -l to list all current translations.
Now pick an unused category. Say you wanted to add Payroll as a translation, and s0:c6 is unused.
|
|||
Q: | I have setup my MCS/MLS translations, now I want to designate which users can read a given category? |
|||
A: |
You can modify the range of categories a user can login with by using semanage, as seen in this example.
In the above example, the user csellers was given access to the
|
|||
Q: | I am writing a php script that needs to create files and possibly execute them. SELinux policy is preventing this. What should I do? |
|||
A: |
First, you should never allow a system service to execute anything it can write. This gives an attacker the ability to upload malicious code to the server and then execute it, which is something we want to prevent.
If you merely need to allow your script to create
(non-executable) files, this is possible. That said,
you should avoid having system applications writing to the
|
|||
Q: | I am setting up swapping to a file, but I am seeing AVC messages in my log files? |
|||
A: |
You need to identify the swapfile to SELinux by setting its file
context to
chcon -t swapfile_t
|
|||
Q: |
Please explain the
|
|||
A: |
For files, Useful documents to look at:
|
|||
1.4. Deploying SELinux | ||||
Q: | What file systems can I use for SELinux? |
|||
A: |
The file system must support
Note that XFS SELinux support is broken in upstream kernel 2.6.14 and 2.6.15, but fixed (worked around) in 2.6.16. Your kernel must include this fix if you choose to use XFS with SELinux. |
|||
Q: | How does SELinux impact system performance? |
|||
A: | This is a variable that is hard to measure, and is heavily dependent on the tuning and usage of the system running SELinux. When performance was last measured, the impact was around 7% for completely untuned code. Subsequent changes in system components such as networking are likely to have made that worse in some cases. SELinux performance tuning continues to be a priority of the development team. |
|||
Q: | What types of deployments, applications, and systems should I leverage SELinux in? |
|||
A: |
Initially, SELinux has been used on Internet facing servers that are performing a few specialized functions, where it is critical to keep extremely tight security. Administrators typically strip such a box of all extra software and services, and run a very small, focused set of services. A Web server or mail server is a good example. In these edge servers, you can lock down the policy very tightly. The smaller number of interactions with other components makes such a lock down easier. A dedicated system running a specialized third-party application would also be a good candidate. In the future, SELinux will be targeted at all environments. In order to achieve this goal, the community and independent software vendors (ISVs) must work with the SELinux developers to produce the necessary policy. So far, a very restrictive strict policy has been written, as well as a targeted policy that focuses on specific, vulnerable daemons. For more information about these policies, refer to What is SELinux policy? and What is the SELinux targeted policy?. |
|||
Q: | How does SELinux affect third-party applications? |
|||
A: |
One goal of implementing a targeted SELinux policy in Fedora Core is to allow third-party applications to work without modification. The targeted policy is transparent to those unaddressed applications, and it falls back on standard Linux DAC security. These applications, however, will not be running in an extra-secure manner. You or another provider must write policy to protect these applications with MAC security. It is impossible to predict how every third-party application might behave with SELinux, even running the targeted policy. You may be able to fix issues that arise by changing the policy. You may find that SELinux exposes previously unknown security issues with your application. You may have to modify the application to work under SELinux. Note that with the addition of Policy Modules, it is now possible for third-party developers to include policy modules with their application. If you are a third-party developer or a package-maintainer, please consider including a policy module in your package. This will allow you to secure the behavior of your application with the power of SELinux for any user installing your package. One important value that Fedora Core testers and users bring to the community is extensive testing of third-party applications. With that in mind, please bring your experiences to the appropriate mailing list, such as the fedora-selinux list, for discussion. For more information about that list, refer to http://www.redhat.com/mailman/listinfo/fedora-selinux-list/. |