Debian Codegraph @

src/man/authselect-profiles.5.adoc

raw
1 authselect-profiles(5)
2 ======================
3 :revdate: 2018-02-17
4
5 NAME
6 ----
7 authselect-profiles - how to extend authselect profiles.
8
9 DESCRIPTION
10 -----------
11 This manual page explains how are authselect profiles organized and
12 how to create new profiles.
13
14 PROFILE DIRECTORIES
15 -------------------
16 Profiles can be found in one of three directories.
17
18 *{AUTHSELECT_PROFILE_DIR}*::
19 Read-only directory containing profiles shipped together with authselect.
20
21 *{AUTHSELECT_VENDOR_DIR}*::
22 Read-only directory for vendor-specific profiles that can override the
23 ones in _default_ directory.
24
25 *{AUTHSELECT_CUSTOM_DIR}*::
26 Place for administrator-defined profiles.
27
28 PROFILE FILES
29 -------------
30 Each profile consists of one or more of these files which provide
31 a mandatory profile description and describe the changes that are
32 done to the system.
33
34 *README*::
35 Description of the profile. The first line must be a name of the profile.
36
37 *system-auth*::
38 PAM stack that is included from nearly all individual service configuration
39 files.
40
41 *password-auth*, *smartcard-auth*, *fingerprint-auth*::
42 These PAM stacks are for applications which handle authentication from
43 different types of devices via simultaneously running individual
44 conversations instead of one aggregate conversation.
45
46 *postlogin*::
47 The purpose of this PAM stack is to provide a common place for all
48 PAM modules which should be called after the stack configured in
49 system-auth or the other common PAM configuration files. It is included
50 from all individual service configuration files that provide login service
51 with shell or file access. _NOTE: the modules in the postlogin
52 configuration file are executed regardless of the success or failure of
53 the modules in the system-auth configuration file._
54
55 *nsswitch.conf*::
56 Name Service Switch configuration file.
57
58 *dconf-db*::
59 Changes to dconf database. The main use case of this file is to set
60 changes for gnome login screen in order to enable or disable smartcard
61 and fingerprint authentication.
62
63 *dconf-locks*::
64 This file defines locks on values set in dconf database.
65
66 CONDITIONAL LINES
67 ~~~~~~~~~~~~~~~~~
68 Each of these files serves as a template. A template is a plain text file with
69 optional usage of several operators that can be used to provide some optional
70 profile features.
71
72 *{continue if "feature"}*::
73 Immediately stop processing of the file unless "feature" is defined (the
74 rest of the file content will be removed). If "feature" is defined, the
75 whole line with this operator will be removed and the rest of the template
76 will be processed.
77
78 *{stop if "feature"}*::
79 Opposite of "continue if". Immediately stop processing of the file if
80 "feature" is defined (the rest of the file content will be removed).
81 If "feature" is not defined, the whole line with this operator will be
82 removed and the rest of the template will be processed.
83
84 *{include if "feature"}*::
85 Include the line where this operator is placed only if "feature" is
86 defined.
87
88 *{exclude if "feature"}*::
89 Opposite to "include-if". Include the line where this operator is placed
90 only if "feature" is not defined.
91
92 *{imply "implied-feature" if "feature"}*::
93 Enable feature "implied-feature" if feature "feature" is enabled. The whole
94 line with this operator is removed, thus it is not possible to add anything
95 else around this operator at the same line.
96
97 *{if "feature":true|false}*::
98 If "feature" is defined, replace this operator with string "true", otherwise
99 with string "false".
100
101 *{if "feature":true}*::
102 If "feature" is defined, replace this operator with string "true", otherwise
103 with an empty string.
104
105 It is also possible to use logical expression in conditional line instead of
106 specifying single feature name. In this case the expression will evaluate to
107 true or false and the conditional operator will act upon the result.
108
109 The expression syntax consists of feature names (e.g. _"feature"_) which returns
110 _true_ if the feature is defined or _false_ if it is not defined and from the
111 following logical operators: _and_, _or_ and _not_. The expression may also
112 be enclosed in parentheses and contain multiple subexpressions.
113
114 For example:
115
116 *{if "feature1" or "feature2":true}*::
117 If "feature1" or "feature2" is defined, replace this operator with string
118 "true", otherwise with an empty string.
119
120 *{if not "feature":true|false}*::
121 If "feature" is not defined, replace this operator with string "true",
122 otherwise with string "false".
123
124 *{if not "feature":true}*::
125 If "feature" is not defined, replace this operator with string "true",
126 otherwise with an empty string.
127
128 *{if "feature1" and ("feature2" or "feature3"):true}*::
129 If "feature1" is defined, and one of "feature2" and "feature3" is defined
130 replace this operator with string "true", otherwise with an empty string.
131
132 EXAMPLE
133 ~~~~~~~
134 Here is an example of using "if" operator. If "with-sudo" feature is enabled,
135 it will add "sss" to sudoers line.
136
137 passwd: sss files
138 group: sss files
139 netgroup: sss files
140 automount: sss files
141 services: sss files
142 sudoers: files {if "with-sudo":sss}
143
144 Here is an example of "continue-if" and "include-if" operators. The resulting
145 file will be empty unless "with-smartcard" feature is enabled. If it is enabled
146 and also "with-faillock" feature is enabled, it will also enable support
147 for pam_faillock.
148
149 {continue if "with-smartcard"}
150 auth required pam_env.so
151 auth required pam_faildelay.so delay=2000000
152 auth required pam_faillock.so preauth silent deny=4 unlock_time=1200 {include if "with-faillock"}
153 auth [default=1 ignore=ignore success=ok] pam_succeed_if.so uid >= 1000 quiet
154 auth [default=1 ignore=ignore success=ok] pam_localuser.so
155 auth sufficient pam_unix.so nullok
156 auth requisite pam_succeed_if.so uid >= 1000 quiet_success
157 auth sufficient pam_sss.so forward_pass
158 auth required pam_faillock.so authfail deny=4 unlock_time=1200 {include if "with-faillock"}
159 auth required pam_deny.so
160 ...
161
162 Here is an example of "continue-if" using logical expression. The file will
163 be empty unless "with-smartcard" or "with-smartcard-required" is set. This
164 will simplify the call of _authselect select_ command which does not have
165 to include both features but only "with-smartcard-required" is necessary.
166
167 {continue if "with-smartcard" or "with-smartcard-required"}
168 auth required pam_env.so
169 auth required pam_faildelay.so delay=2000000
170 auth required pam_faillock.so preauth silent deny=4 unlock_time=1200 {include if "with-faillock"}
171 auth [default=1 ignore=ignore success=ok] pam_succeed_if.so uid >= 1000 quiet
172 auth [default=1 ignore=ignore success=ok] pam_localuser.so
173 auth sufficient pam_unix.so nullok
174 auth requisite pam_succeed_if.so uid >= 1000 quiet_success
175 auth sufficient pam_sss.so forward_pass
176 auth required pam_faillock.so authfail deny=4 unlock_time=1200 {include if "with-faillock"}
177 auth required pam_deny.so
178 ...
179
180 Here is an example of "imply-if" operator. Enabling feature
181 "with-smartcard-required" will also enable "with-smartcard" to make sure that
182 all relevant PAM modules are used. This will achieve the same behavior as the
183 previous example.
184
185 {imply "with-smartcard" if "with-smartcard-required"}
186 auth required pam_env.so
187 auth required pam_faildelay.so delay=2000000
188 auth [success=1 default=ignore] pam_succeed_if.so service notin login:gdm:xdm:kdm:kde:xscreensaver:gnome-screensaver:kscreensaver quiet use_uid {include if "with-smartcard-required"}
189 auth [success=done ignore=ignore default=die] pam_sss.so require_cert_auth ignore_authinfo_unavail {include if "with-smartcard-required"}
190 auth [default=1 ignore=ignore success=ok] pam_succeed_if.so uid >= 1000 quiet
191 auth [default=1 ignore=ignore success=ok] pam_localuser.so {exclude if "with-smartcard"}
192 auth [default=2 ignore=ignore success=ok] pam_localuser.so {include if "with-smartcard"}
193 auth [success=done authinfo_unavail=ignore user_unknown=ignore ignore=ignore default=die] pam_sss.so try_cert_auth {include if "with-smartcard"}
194 auth sufficient pam_unix.so {if not "without-nullok":nullok}
195 auth requisite pam_succeed_if.so uid >= 1000 quiet_success
196 auth sufficient pam_sss.so forward_pass
197 auth required pam_deny.so
198 ...
199
200 CREATING A NEW PROFILE
201 ----------------------
202 To register a new profile within authselect, create a directory in one of the
203 authselect profile locations with the files listed above. Not all of the files
204 must be present, only *README* is mandatory. Other files can be created on
205 per-need basis.
206
207 You may find *authselect create-profile* command helpful when creating new
208 profile. See *authselect(8)* manual page or *authselect create-profile --help*
209 for more information.
210
211 SEE ALSO
212 --------
213 authselect(8), nsswitch.conf(5), PAM(8)