Debian Codegraph @

README

raw ◀ ▶
3 Debian patches touch this file
1 ========================================================================
2 MOD_AUTH_CAS 1.2 README
3 ========================================================================
4 Apache CAS Authentication Module for the JASIG/Apereo CAS Server.
5
6 ========================================================================
7 LICENSE
8 ========================================================================
9 Licensed under the Apache License, Version 2.0 (the "License");
10 you may not use this file except in compliance with the License.
11 You may obtain a copy of the License at
12
13 http://www.apache.org/licenses/LICENSE-2.0
14
15 Unless required by applicable law or agreed to in writing, software
16 distributed under the License is distributed on an "AS IS" BASIS,
17 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 See the License for the specific language governing permissions and
19 limitations under the License.
20
21 ========================================================================
22 INTRODUCTION
23 ========================================================================
24 The purpose of this module is to allow an Apache web server to interact
25 with an authentication server that conforms to the CAS version 1 or 2
26 protocol or SAML protocol as used by the JASIG/Apereo CAS Server.
27 At the time of this writing, the CAS protocol specification is here:
28
29 http://apereo.github.io/cas/development/protocol/CAS-Protocol-Specification.html
30
31 ========================================================================
32 Getting Started
33 ========================================================================
34
35 --------------------------------------------------------------------
36 Linux Distribution Packaging
37 --------------------------------------------------------------------
38 mod_auth_cas is available in most major Linux distributions, including
39 Debian, Ubuntu, Fedora, and is available from EPEL for CentOS and RHEL.
40
41
42 --------------------------------------------------------------------
43 Building from Source
44 --------------------------------------------------------------------
45
46 The following development libraries and utilities must be installed:
47 * OpenSSL - 0.9.8c or higher
48 * Apache Portable Runtime - 1.2.8 or higher
49 * Apache Portable Runtime Utilities - 1.2.7 or higher
50 * Apache Web Server - 2.2.3 or higher
51 * libcurl - 7.18.2 or higher
•52 * libpcre2 - 10 or higher
53
54 Download the distribution via git or tarball. Because git does not
55 preserve timestamps, autoconf may determine it is necessary to bootstrap
56 the project. If building from source, please start with:
57
58 autoreconf -ivf
59
60 Build is performed with the standard Autoconf incantation:
61
62 ./configure && make && sudo make install
63
64 Edit your Apache configuration to load the mod_auth_cas module:
65
66 LoadModule auth_cas_module /path/to/mod_auth_cas.so
67
68 Set a few required parameters in your Apache configuration:
69
70 CASCookiePath /var/cache/apache2/mod_auth_cas/
71 CASLoginURL https://login.example.org/cas/login
72 CASValidateURL https://login.example.org/cas/serviceValidate
73
74 Protect a "Location" or "Directory" block in your Apache
75 configuration:
76
77 <Location /secured>
78 Authtype CAS
79 Require valid-user
80 </Location>
81
82 If attribute-based authorization is also desired, specify cas-attribute
83 name:value in your Require rule (please note: both attribute name and value are
84 case-sensitive):
85
86 CASCookiePath /var/cache/apache2/mod_auth_cas/
87 CASLoginURL https://login.example.org/cas/login
88 CASValidateURL https://login.example.org/cas/samlValidate
89 CASValidateSAML On
90
91 <Location /secured>
92 Authtype CAS
93 Require cas-attribute edupersonaffiliation:staff
94 </Location>
95
96 Both the CAS 2.0 and SAML 1.1 protocols support including additional attributes
97 in the CAS validation response, which may also be added as HTTP headers (see
98 CASAttributePrefix and CASAttributeDelimiter). This example uses the SAML
99 protocol and requires that the 'edupersonaffiliation' attribute is set to
100 'staff'.
101
102
103 ========================================================================
104 NEW FEATURES AND FUNCTIONS IN THIS RELEASE
105 ========================================================================
106 * OpenSSL 1.1 support.
107 * CASv2 attributes.
108 * CASPreserveTicket, which allows tickets to pass through when a valid session exists.
109 * CASGatewayCookieDomain, to set the gateway cookie domain.
110 * Use a dynamic buffer to store the CAS validation response.
111 * Various bug and documentation fixes.
112 https://github.com/apereo/mod_auth_cas/milestone/6?closed=1
113
114 ========================================================================
115 KNOWN ISSUES
116 ========================================================================
117 * Autoconf does not work well on code freshly checked out of git. Autoconf
118 artifacts must be rebuilt using `autoreconf -ivf` .
119
120 ========================================================================
121 KNOWN LIMITATIONS
122 ========================================================================
123 These limitations are known to exists in this release of the software:
124
125 * CAS Proxy Validation is not implemented in this version.
126
127 * CAS Ticket Validation can only be performed over an SSL connection.
128 The CAS protocol does not explicitly require this, but to not do so
129 leaves this system open to a man-in-the-middle attack.
130
131 * CAS single sign out is currently not functional and disabled. It
132 is only safe to use in the case where all requests are GET and not
133 POST (the module inadvertently 'eats' some content of the POST
134 request while determining if it should process it as a SAML logout
135 request).
136
137 * Reports of slow performance on some systems (particularly
138 virtual machines) have been reported. This is related to the
139 entropy that is gathered when creating a session cookie for
140 the end user. To combat this, there are 3 solutions. The
141 first is to upgrade the version of the Apache Portable Runtime
142 on your system to >= 1.3.0. In that version, entropy is gathered
143 from a nonblocking source. The second method would be to install
144 a package such as rng-tools and feed random data from /dev/urandom
145 to /dev/random("-r /dev/urandom"). The last way is to reduce
146 the size of the CASCookieEntropy setting, reducing the demand on
147 the pool.
148
149 * Win32 support has been dropped (but not removed) due to lack of
150 development resources, and seemingly minimal community usage.
151 You are welcome to try it, but YMMV for success.
152
153
154
155 ========================================================================
156 Configuration
157 ========================================================================
158 First, you must tell Apache to load the module. In your httpd.conf,
159 add:
160
161 LoadModule auth_cas_module /path/to/mod_auth_cas.so
162
163 Then, in the location(s) you want to protect, use the following
164 directive:
165
166 AuthType CAS
167
168 Be sure to set authorization parameters in the locations you
169 are protecting(e.g. 'require valid-user', 'require group foo')
170
171 The following are valid configuration options and their default:
172
173 Valid Server/VirtualHost Directives
174 -----------------------------------
175 Directive: CASVersion
176 Default: 2
177 Description: The version of the CAS protocol to adhere to (1 or 2).
178 This affects whether Gateway mode is available and how
179 the CAS validation response is parsed.
180
181 Directive: CASDebug
182 Default: Off
183 Description: Enable or disable debugging mode for troubleshooting. Please
184 note that LogLevel must be set to Debug for the VirtualHost in
185 order for these logs to be visible.
186
187 Directive: CASValidateDepth
188 Default: 9
189 Description: This directive will set the maximum depth for chained certificate
190 validation. The default (according to OpenSSL documentation) is 9.
191
192 Directive: CASCertificatePath
193 Default: /etc/ssl/certs/
194 Description: The path to the X509 certificate of the Certificate Authority for
195 the server in CASLoginURL and CASValidateURL. This may be either
196 a file, or a directory containing the certificate files linked to
197 by their hashed names.
198
199 Directive: CASLoginURL
200 Default: NULL
201 Description: The URL to redirect users to when they attempt to access a CAS
202 protected resource and do not have an existing session. The
203 'service', 'renew', and 'gateway' parameters will be appended to
204 this by mod_auth_cas if necessary. Include 'http[s]://...'
205
206 Directive: CASValidateURL
207 Default: NULL
208 Description: The URL to use when validating a ticket presented by a client in
209 the HTTP query string (ticket=...). Must include 'https://' and
210 must be an HTTPS URL.
211
212 Directive: CASProxyValidateURL
213 Default: NULL
214 Description: The URL to use when performing a proxy validation. This is currently
215 an unimplemented feature, so setting this will have no effect.
216
217 Directive: CASRootProxiedAs
218 Default: NULL
219 Description: This URL represents the URL that end users may see in the event that
220 access to this Apache server is proxied. This will override the
221 automatic generation of service URLs and construct them using this
222 prefix. As an example: If the site being protected is http://example.com/
223 and the Apache instance of this server is http://internal.example.com:8080,
224 setting CASRootProxiedAs to http://example.com would result in proper
225 service parameter generation.
226
227 Directive: CASCookiePath
228 Default: /dev/null
229 Description: When users first authenticate to mod_auth_cas with a valid service ticket,
230 a local session is established. Information about this session (the
231 username, time of creation, last activity time, the resource initially
232 requested, and whether or not the credentials were renewed) is stored
233 in this directory. This location should be writable by the web server ONLY.
234 Any user that can write to this location can falsify authentication information
235 by creating a fake data file.
236 NOTE : Some distributions purge the contents of /tmp/ on a reboot, including
237 user created directories. This will prevent mod_auth_cas from storing
238 cookie information until that directory is created. To avoid this, try
239 using a different location, such as /var/cache/apache2/mod_auth_cas/
240
241 Directive: CASCookieEntropy
242 Default: 32
243 Description: When creating a local session, this many random bytes are used to
244 create a unique session identifier. Using large values for this
245 field may result in delays when generating session IDs if not
246 enough entropy is available.
247
248 Directive: CASTimeout
249 Default: 7200 (2 hours)
250 Description: This is the hard limit, in seconds, for a mod_auth_cas session (whether
251 it is idle or not). When a session has reached this age and a new
252 request is made, the user is redirected to the CASLoginURL to
253 obtain a new service ticket. When this new ticket is validated,
254 they will be assigned a new mod_auth_cas session. Set this value to '0'
255 in order to allow a non-idle session to not expire.
256
257 Directive: CASIdleTimeout
258 Default: 3600 (1 hour)
259 Description: This is a limit, in seconds, of how long a mod_auth_cas session can be idle.
260 When a request comes in, if it has been inactive for CASIdleTimeout
261 seconds, the user is redirected to the CASLoginURL to obtain a new
262 service ticket.
263
264 Directive: CASCacheCleanInterval
265 Default: 1800 (30 minutes)
266 Description: This is the minimum amount of time that must pass inbetween cache
267 cleanings. When a new ticket is issued, or when an expired session
268 is presented, the time of the last cache clean is compared against
269 this value. If CASCacheCleanInterval seconds have passed since the
270 last cleaning, then all files in CASCookiePath are examined and if
271 they have expired, they are removed. This is merely to prevent the
272 file system from becoming excessively cluttered.
273
274 Directive: CASCookieDomain
275 Default: NULL
276 Description: Specify the value for the 'Domain=' parameter in the Set-Cookie header.
277
•278 Directive: CASCookieSameSite
279 Default: NULL
280 Description: Specify the value for the 'SameSite=' parameter in the Set-Cookie header.
281 Allowed values are 'None', 'Lax', and 'Strict'.
282
283 Directive: CASCookieHttpOnly
284 Default: On
285 Description: Set the optional 'HttpOnly' flag for cookies issues by mod_auth_cas.
286 Set the HttpOnly flag as described in in RFC 6265. This flag prevents the
287 mod_auth_cas cookies from being accessed by client side Javascript.
288
•289 Directive: CASCookieSecure
290 Default: Auto
291 Description: Set the optional 'Secure' attribute for cookies issued by mod_auth_cas.
292 Set the Secure attribute as described in in RFC 6265. This flag prevents the
293 mod_auth_cas cookies from being sent over an unencrypted HTTP connection.
294 By default, mod_auth_cas sets the 'Secure' attribute depending on information about
295 the connection (the 'Auto' option). The options 'On' and 'Off' can be used to override
296 the automatic behaviour.
297
298 Directive: CASAuthoritative
299 Default: Off
300 Description: This directive determines whether an optional authorization directive
301 (see 'Require cas-attribute') is authoritative and thus binding or
302 if other authorization modules will also be applied.
303 'On' means authoritative, 'Off' means not authoritative.
304 NOTE: This directive is unavailable with Apache 2.4. See the RequireAny,
305 RequireNone, and RequireAll directives instead.
306
307 Directive: CASValidateSAML
308 Default: Off
309 Description: If enabled, the response from the CAS Server will be parsed for SAML
310 attributes which will be associated with the user. Requires setting
311 CASValidateURL appropriately; typical URLs are of the form
312 https://login.example.org/cas/samlValidate.
313
314 Directive: CASAttributePrefix
315 Default: CAS_ (Apache < 2.4)
316 CAS- (Apache 2.4)
317 Description: The prefix to use when adding CAS or SAML attributes to the HTTP headers,
318 which will be named <CASAttributePrefix><attr_name>. CASAuthNHeader
319 must be set for this directive to be used.
320 NOTE: In Apache 2.4 and newer, headers containing "invalid" characters
321 (including underscores) are silently dropped, so you must set this to
322 a "valid" name containing only alphabetic characters and hyphens.
323
324 Directive: CASAttributeDelimiter
325 Default: ,
326 Description: mod_auth_cas will set the value of the attribute header (as described
327 in CASAttributePrefix) to <attrvalue><CASAttributeDelimiter><attrvalue>
328 in the case of multiple attribute values.
329
330 Directive: CASPreserveTicket
331 Default: Off
332 Description: This directive leaves CAS ticket parameters intact when a valid
333 session cookie exists. This helps prevent infinite redirect loops when
334 CAS protection is being used at multiple levels.
335
336 Directive: CASGatewayCookieDomain
337 Default: NULL
338 Description: Specify the value for the 'Domain=' parameter in the Set-Cookie header
339 when setting the CASGatewayCookie.
340
341 Valid Directory/.htaccess Directives
342 ------------------------------------
343 Directive: CASScope
344 Default: Off
345 Description: Use this directive with an argument as a relative path (e.g. /application/) to specify
346 the scope for which a mod_auth_cas cookie is valid. This is beneficial to prevent
347 additional round trips to the CAS server. Assume someone authenticates to /application/subdir/
348 and then browses to /application/ - without CASScope set, each request would result in
349 a round trip to the CAS server and a new cookie being created (one for each directory).
350 CASScope would set one cookie, which will be presented on access to both directories.
351 Note that if someone accessed /application/ and then /application/subdir/ this would not
352 be an issue, but that order of access can not be guaranteed. To disable this feature,
353 the special argument 'Off' will return to per-directory cookie paths for this directory
354 and subdirectories.
355
356 Directive: CASRenew
357 Default: Off
358 Description: Use this directive with an argument as a relative path (e.g. /application/secure/
359 for http://www.example.com/application/secure/*) to force a user to renew their
360 credentials when accessing that directory. The argument MUST be a relative path.
361 To disable this requirement, the special argument 'Off' will disable this requirement
362 for this directory and subdirectories.
363
364 Directive: CASGateway
365 Default: Off
366 Description: Use this directive with an argument as a relative path (e.g. /application/insecure/
367 for http://www.example.com/application/insecure/*) to allow anonymous access to that directory.
368 The argument MUST be a relative path. To disable this feature, the special argument 'Off'
369 will reinstate the requirement for authentication.
370
371 Directive: CASCookie
372 Default: MOD_AUTH_CAS
373 Description: The name of the cookie used to store the session ID over HTTP connections.
374 It should be changed if it will interfere with the application protected
375 by mod_auth_cas.
376
377 Directive: CASSecureCookie
378 Default: MOD_AUTH_CAS_S
379 Description: The name of the cookie used to store the session ID over HTTPS connections.
380 It should be changed if it will interfere with the application protected
381 by mod_auth_cas.
382
383 Directive: CASGatewayCookie
384 Default: MOD_AUTH_CAS_G
385 Description: The name of the cookie used to store whether or not the user has attempted
386 to access this resource before. It should be changed if it will interfere
387 with the application protected by mod_auth_cas.
388
389 Directive: CASAuthNHeader
390 Default: None
391 Description: If enabled, this will store the user returned by CAS in the specified
392 HTTP header accessible to your web applications, and any additional
393 attributes received in headers named according to CASAttributePrefix.
394 This is in addition to the REMOTE_USER environment variable, which is
395 always set to the CAS user.
396
397 Directive: CASSSOEnabled
398 Default: Off
399 Description: If enabled, this activates support for Single Sign Out within the CAS
400 protocol. Please note that this feature is currently experimental and
401 may mangle POST data.
402
403 Directive: CASScrubRequestHeaders
404 Default: Off
405 Description: mod_auth_cas will strip request inbound request headers that may have
406 special meaning, such as those set with the CASAttributePrefix or the
407 CASAuthNHeader value.
408
409 Directive: Require cas-attribute <attribute>:<value>
410 Default: NULL
411 Description: Use this directive to authorize based on CAS or SAML attributes
412 returned via the session validation call. Multiple directives
413 are OR-ed. If directive is present with no attributes defined,
414 the request is declined. If value has spaces, wrap the pair in quotes.
415 See also CASAuthoritative.
416
417 Directive: Require cas-attribute <attribute>~<value>
418 Default: NULL
419 Description: Use this form of the directive to authorize based on CAS or SAML
420 attributes returned via the session validation call. Multiple
421 directives are OR-ed. If directive is present with no attributes
422 defined, the request is declined. The value is interpreted as a
423 Perl-Compatible Regular Expression (PCRE) using case-sensitive
424 matching. See also CASAuthoritative.
425
426 ========================================================================
427 CONTACT INFORMATION AND WEBSITE
428 ========================================================================
429 We welcome your feedback, suggestions and contributions. Contact us
430 via email if you have questions, feedback, code submissions,
431 and bug reports. To reach the development team, send an e-mail to:
432
433 cas-user [at] apereo [dot] org
434
435 Google Group link:
436
437 https://groups.google.com/a/apereo.org/forum/#!forum/cas-user
438
439 ========================================================================