Debian Codegraph @

README

raw ◀ ▶
Source reconstructed at patch state 1 of 3 — not the installed (fully patched) source.
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: CASCookieHttpOnly
279 Default: On
280 Description: Set the optional 'HttpOnly' flag for cookies issues by mod_auth_cas.
281 Set the HttpOnly flag as described in in RFC 6265. This flag prevents the
282 mod_auth_cas cookies from being accessed by client side Javascript.
283
284 Directive: CASAuthoritative
285 Default: Off
286 Description: This directive determines whether an optional authorization directive
287 (see 'Require cas-attribute') is authoritative and thus binding or
288 if other authorization modules will also be applied.
289 'On' means authoritative, 'Off' means not authoritative.
290 NOTE: This directive is unavailable with Apache 2.4. See the RequireAny,
291 RequireNone, and RequireAll directives instead.
292
293 Directive: CASValidateSAML
294 Default: Off
295 Description: If enabled, the response from the CAS Server will be parsed for SAML
296 attributes which will be associated with the user. Requires setting
297 CASValidateURL appropriately; typical URLs are of the form
298 https://login.example.org/cas/samlValidate.
299
300 Directive: CASAttributePrefix
301 Default: CAS_ (Apache < 2.4)
302 CAS- (Apache 2.4)
303 Description: The prefix to use when adding CAS or SAML attributes to the HTTP headers,
304 which will be named <CASAttributePrefix><attr_name>. CASAuthNHeader
305 must be set for this directive to be used.
306 NOTE: In Apache 2.4 and newer, headers containing "invalid" characters
307 (including underscores) are silently dropped, so you must set this to
308 a "valid" name containing only alphabetic characters and hyphens.
309
310 Directive: CASAttributeDelimiter
311 Default: ,
312 Description: mod_auth_cas will set the value of the attribute header (as described
313 in CASAttributePrefix) to <attrvalue><CASAttributeDelimiter><attrvalue>
314 in the case of multiple attribute values.
315
316 Directive: CASPreserveTicket
317 Default: Off
318 Description: This directive leaves CAS ticket parameters intact when a valid
319 session cookie exists. This helps prevent infinite redirect loops when
320 CAS protection is being used at multiple levels.
321
322 Directive: CASGatewayCookieDomain
323 Default: NULL
324 Description: Specify the value for the 'Domain=' parameter in the Set-Cookie header
325 when setting the CASGatewayCookie.
326
327 Valid Directory/.htaccess Directives
328 ------------------------------------
329 Directive: CASScope
330 Default: Off
331 Description: Use this directive with an argument as a relative path (e.g. /application/) to specify
332 the scope for which a mod_auth_cas cookie is valid. This is beneficial to prevent
333 additional round trips to the CAS server. Assume someone authenticates to /application/subdir/
334 and then browses to /application/ - without CASScope set, each request would result in
335 a round trip to the CAS server and a new cookie being created (one for each directory).
336 CASScope would set one cookie, which will be presented on access to both directories.
337 Note that if someone accessed /application/ and then /application/subdir/ this would not
338 be an issue, but that order of access can not be guaranteed. To disable this feature,
339 the special argument 'Off' will return to per-directory cookie paths for this directory
340 and subdirectories.
341
342 Directive: CASRenew
343 Default: Off
344 Description: Use this directive with an argument as a relative path (e.g. /application/secure/
345 for http://www.example.com/application/secure/*) to force a user to renew their
346 credentials when accessing that directory. The argument MUST be a relative path.
347 To disable this requirement, the special argument 'Off' will disable this requirement
348 for this directory and subdirectories.
349
350 Directive: CASGateway
351 Default: Off
352 Description: Use this directive with an argument as a relative path (e.g. /application/insecure/
353 for http://www.example.com/application/insecure/*) to allow anonymous access to that directory.
354 The argument MUST be a relative path. To disable this feature, the special argument 'Off'
355 will reinstate the requirement for authentication.
356
357 Directive: CASCookie
358 Default: MOD_AUTH_CAS
359 Description: The name of the cookie used to store the session ID over HTTP connections.
360 It should be changed if it will interfere with the application protected
361 by mod_auth_cas.
362
363 Directive: CASSecureCookie
364 Default: MOD_AUTH_CAS_S
365 Description: The name of the cookie used to store the session ID over HTTPS connections.
366 It should be changed if it will interfere with the application protected
367 by mod_auth_cas.
368
369 Directive: CASGatewayCookie
370 Default: MOD_AUTH_CAS_G
371 Description: The name of the cookie used to store whether or not the user has attempted
372 to access this resource before. It should be changed if it will interfere
373 with the application protected by mod_auth_cas.
374
375 Directive: CASAuthNHeader
376 Default: None
377 Description: If enabled, this will store the user returned by CAS in the specified
378 HTTP header accessible to your web applications, and any additional
379 attributes received in headers named according to CASAttributePrefix.
380 This is in addition to the REMOTE_USER environment variable, which is
381 always set to the CAS user.
382
383 Directive: CASSSOEnabled
384 Default: Off
385 Description: If enabled, this activates support for Single Sign Out within the CAS
386 protocol. Please note that this feature is currently experimental and
387 may mangle POST data.
388
389 Directive: CASScrubRequestHeaders
390 Default: Off
391 Description: mod_auth_cas will strip request inbound request headers that may have
392 special meaning, such as those set with the CASAttributePrefix or the
393 CASAuthNHeader value.
394
395 Directive: Require cas-attribute <attribute>:<value>
396 Default: NULL
397 Description: Use this directive to authorize based on CAS or SAML attributes
398 returned via the session validation call. Multiple directives
399 are OR-ed. If directive is present with no attributes defined,
400 the request is declined. If value has spaces, wrap the pair in quotes.
401 See also CASAuthoritative.
402
403 Directive: Require cas-attribute <attribute>~<value>
404 Default: NULL
405 Description: Use this form of the directive to authorize based on CAS or SAML
406 attributes returned via the session validation call. Multiple
407 directives are OR-ed. If directive is present with no attributes
408 defined, the request is declined. The value is interpreted as a
409 Perl-Compatible Regular Expression (PCRE) using case-sensitive
410 matching. See also CASAuthoritative.
411
412 ========================================================================
413 CONTACT INFORMATION AND WEBSITE
414 ========================================================================
415 We welcome your feedback, suggestions and contributions. Contact us
416 via email if you have questions, feedback, code submissions,
417 and bug reports. To reach the development team, send an e-mail to:
418
419 cas-user [at] apereo [dot] org
420
421 Google Group link:
422
423 https://groups.google.com/a/apereo.org/forum/#!forum/cas-user
424
425 ========================================================================