pam_selinux.8 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. '\" t
  2. .\" Title: pam_selinux
  3. .\" Author: [see the "AUTHOR" section]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
  5. .\" Date: 09/03/2021
  6. .\" Manual: Linux-PAM Manual
  7. .\" Source: Linux-PAM Manual
  8. .\" Language: English
  9. .\"
  10. .TH "PAM_SELINUX" "8" "09/03/2021" "Linux-PAM Manual" "Linux\-PAM Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. pam_selinux \- PAM module to set the default security context
  32. .SH "SYNOPSIS"
  33. .HP \w'\fBpam_selinux\&.so\fR\ 'u
  34. \fBpam_selinux\&.so\fR [open] [close] [restore] [nottys] [debug] [verbose] [select_context] [env_params] [use_current_range]
  35. .SH "DESCRIPTION"
  36. .PP
  37. pam_selinux is a PAM module that sets up the default SELinux security context for the next executed process\&.
  38. .PP
  39. 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
  40. \fBexecve\fR(2)
  41. call, the file security context for the controlling terminal, and the security context used for creating a new kernel keyring\&.
  42. .PP
  43. 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\&.
  44. .PP
  45. Adding pam_selinux into the PAM stack might disrupt behavior of other PAM modules which execute applications\&. To avoid that,
  46. \fIpam_selinux\&.so open\fR
  47. should be placed after such modules in the PAM stack, and
  48. \fIpam_selinux\&.so close\fR
  49. should be placed before them\&. When such a placement is not feasible,
  50. \fIpam_selinux\&.so restore\fR
  51. could be used to temporary restore original security contexts\&.
  52. .SH "OPTIONS"
  53. .PP
  54. \fBopen\fR
  55. .RS 4
  56. Only execute the open_session part of the module\&.
  57. .RE
  58. .PP
  59. \fBclose\fR
  60. .RS 4
  61. Only execute the close_session part of the module\&.
  62. .RE
  63. .PP
  64. \fBrestore\fR
  65. .RS 4
  66. 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\&.
  67. .RE
  68. .PP
  69. \fBnottys\fR
  70. .RS 4
  71. Do not setup security context of the controlling terminal\&.
  72. .RE
  73. .PP
  74. \fBdebug\fR
  75. .RS 4
  76. Turn on debug messages via
  77. \fBsyslog\fR(3)\&.
  78. .RE
  79. .PP
  80. \fBverbose\fR
  81. .RS 4
  82. Attempt to inform the user when security context is set\&.
  83. .RE
  84. .PP
  85. \fBselect_context\fR
  86. .RS 4
  87. Attempt to ask the user for a custom security context role\&. If MLS is on, ask also for sensitivity level\&.
  88. .RE
  89. .PP
  90. \fBenv_params\fR
  91. .RS 4
  92. 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
  93. \fISELINUX_ROLE_REQUESTED\fR,
  94. \fISELINUX_LEVEL_REQUESTED\fR, and
  95. \fISELINUX_USE_CURRENT_RANGE\fR\&. 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\&.
  96. .RE
  97. .PP
  98. \fBuse_current_range\fR
  99. .RS 4
  100. 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\&.
  101. .RE
  102. .SH "MODULE TYPES PROVIDED"
  103. .PP
  104. Only the
  105. \fBsession\fR
  106. module type is provided\&.
  107. .SH "RETURN VALUES"
  108. .PP
  109. PAM_SUCCESS
  110. .RS 4
  111. The security context was set successfully\&.
  112. .RE
  113. .PP
  114. PAM_SESSION_ERR
  115. .RS 4
  116. Unable to get or set a valid context\&.
  117. .RE
  118. .PP
  119. PAM_USER_UNKNOWN
  120. .RS 4
  121. The user is not known to the system\&.
  122. .RE
  123. .PP
  124. PAM_BUF_ERR
  125. .RS 4
  126. Memory allocation error\&.
  127. .RE
  128. .SH "EXAMPLES"
  129. .sp
  130. .if n \{\
  131. .RS 4
  132. .\}
  133. .nf
  134. auth required pam_unix\&.so
  135. session required pam_permit\&.so
  136. session optional pam_selinux\&.so
  137. .fi
  138. .if n \{\
  139. .RE
  140. .\}
  141. .SH "SEE ALSO"
  142. .PP
  143. \fBexecve\fR(2),
  144. \fBtty\fR(4),
  145. \fBpam.d\fR(5),
  146. \fBpam\fR(8),
  147. \fBselinux\fR(8)
  148. .SH "AUTHOR"
  149. .PP
  150. pam_selinux was written by Dan Walsh <dwalsh@redhat\&.com>\&.