/usr/share/doc/pam/html
NameSizeModeActions
Linux-PAM_SAG.html91960644editdlrm
sag-author.html31110644editdlrm
sag-configuration-directory.html29660644editdlrm
sag-configuration-example.html55220644editdlrm
sag-configuration-file.html175190644editdlrm
sag-configuration.html30650644editdlrm
sag-copyright.html36170644editdlrm
sag-introduction.html44460644editdlrm
sag-module-reference.html381520644editdlrm
sag-overview.html79950644editdlrm
sag-pam_access.html181200644editdlrm
sag-pam_cracklib.html202710644editdlrm
sag-pam_debug.html80870644editdlrm
sag-pam_deny.html47040644editdlrm
sag-pam_echo.html57520644editdlrm
sag-pam_env.html127960644editdlrm
sag-pam_exec.html83710644editdlrm
sag-pam_faildelay.html45900644editdlrm
sag-pam_filter.html93420644editdlrm
sag-pam_ftp.html62030644editdlrm
sag-pam_group.html101360644editdlrm
sag-pam_issue.html63780644editdlrm
sag-pam_keyinit.html70150644editdlrm
sag-pam_lastlog.html85240644editdlrm
sag-pam_limits.html181140644editdlrm
sag-pam_listfile.html105340644editdlrm
sag-pam_localuser.html54460644editdlrm
sag-pam_loginuid.html52090644editdlrm
sag-pam_mail.html77620644editdlrm
sag-pam_mkhomedir.html61960644editdlrm
sag-pam_motd.html77530644editdlrm
sag-pam_namespace.html206400644editdlrm
sag-pam_nologin.html53320644editdlrm
sag-pam_permit.html43040644editdlrm
sag-pam_pwhistory.html84760644editdlrm
sag-pam_rhosts.html64040644editdlrm
sag-pam_rootok.html51090644editdlrm
sag-pam_securetty.html64800644editdlrm
sag-pam_selinux.html83130644editdlrm
sag-pam_shells.html42610644editdlrm
sag-pam_succeed_if.html91540644editdlrm
sag-pam_time.html97250644editdlrm
sag-pam_timestamp.html68890644editdlrm
sag-pam_umask.html63180644editdlrm
sag-pam_unix.html150560644editdlrm
sag-pam_userdb.html85850644editdlrm
sag-pam_warn.html45690644editdlrm
sag-pam_wheel.html71810644editdlrm
sag-pam_xauth.html84200644editdlrm
sag-security-issues-other.html29930644editdlrm
sag-security-issues-wrong.html29630644editdlrm
sag-security-issues.html21610644editdlrm
sag-see-also.html22830644editdlrm
sag-text-conventions.html31870644editdlrm
Edit: /usr/share/doc/pam/html/sag-pam_selinux.html (8313B)
6.29. pam_selinux - set the default security context

6.29. pam_selinux - set the default security context

pam_selinux.so [ open ] [ close ] [ restore ] [ nottys ] [ debug ] [ verbose ] [ select_context ] [ env_params ] [ use_current_range ]

6.29.1. DESCRIPTION

pam_selinux is a PAM module that sets up the default SELinux security context for the next executed process.

When a new session is started, the open_session part of the module computes and sets up the execution security context used for the next execve(2) call, the file security context for the controlling terminal, and the security context used for creating a new kernel keyring.

When the session is ended, the close_session part of the module restores old security contexts that were in effect before the change made by the open_session part of the module.

Adding pam_selinux into the PAM stack might disrupt behavior of other PAM modules which execute applications. To avoid that, pam_selinux.so open should be placed after such modules in the PAM stack, and pam_selinux.so close should be placed before them. When such a placement is not feasible, pam_selinux.so restore could be used to temporary restore original security contexts.

6.29.2. OPTIONS

open

Only execute the open_session part of the module.

close

Only execute the close_session part of the module.

restore

In open_session part of the module, temporarily restore the security contexts as they were before the previous call of the module. Another call of this module without the restore option will set up the new security contexts again.

nottys

Do not setup security context of the controlling terminal.

debug

Turn on debug messages via syslog(3).

verbose

Attempt to inform the user when security context is set.

select_context

Attempt to ask the user for a custom security context role. If MLS is on, ask also for sensitivity level.

env_params

Attempt to obtain a custom security context role from PAM environment. If MLS is on, obtain also sensitivity level. This option and the select_context option are mutually exclusive. The respective PAM environment variables are SELINUX_ROLE_REQUESTED, SELINUX_LEVEL_REQUESTED, and SELINUX_USE_CURRENT_RANGE. The first two variables are self describing and the last one if set to 1 makes the PAM module behave as if the use_current_range was specified on the command line of the module.

use_current_range

Use the sensitivity level of the current process for the user context instead of the default level. Also suppresses asking of the sensitivity level from the user or obtaining it from PAM environment.

6.29.3. MODULE TYPES PROVIDED

Only the session module type is provided.

6.29.4. RETURN VALUES

PAM_SUCCESS

The security context was set successfully.

PAM_SESSION_ERR

Unable to get or set a valid context.

PAM_USER_UNKNOWN

The user is not known to the system.

PAM_BUF_ERR

Memory allocation error.

6.29.5. EXAMPLES

auth     required  pam_unix.so
session  required  pam_permit.so
session  optional  pam_selinux.so
    

6.29.6. AUTHOR

pam_selinux was written by Dan Walsh <dwalsh@redhat.com>.