Commit Graph

438 Commits

Author SHA1 Message Date
Olav Morken 85b1395828 Merge pull request #113 from fkooman/docs-use-entityid
use entityId instead of providerId in README
2017-03-03 17:23:09 +01:00
François Kooman 28a0bdee1a
use entityId instead of providerId in README 2017-03-03 10:52:00 +01:00
Olav Morken 499b082598 Fix repeated word in NEWS file. 2017-02-22 07:29:20 +01:00
Olav Morken 890e0fa487 Release version 0.13.0. 2017-02-22 07:17:44 +01:00
Olav Morken 6e2b4de2e0 Add NEWS file for version 0.13.0. 2017-02-22 07:17:44 +01:00
Olav Morken 922c5694a0 Update default value description for several options.
Several options have incorrect description of their default values in
their help texts. Update the values in the description.

This patch only changes the help texts Apache print if it fails to
parse an option. It doesn't change any defaults.
2017-02-08 13:42:15 +01:00
Olav Morken 64f3be2b3c httpclient: Avoid recursion when gathering data from curl.
The `am_hc_block_write()` used recursion when writing multiple blocks
of data. This patch changes it to a simple loop. This ensures that
there is no way that we can end up in a situation where recursion
overflows the stack here.

(curl would only call this function with 16 KiB of data, which isn't
enough to overflow the stack, but this patch makes it safe in case
curl at any point changes its behavior.)
2017-02-08 09:19:29 +01:00
Olav Morken 785c887ca9 Merge pull request #109 from jdennis/content-type
Use ap_set_content_type() to set "Content-Type" header
2017-01-17 09:45:55 +01:00
John Dennis 040a1ae5cb Use ap_set_content_type() to set "Content-Type" header
Formerly we were setting the response header "Content-Type" in
r->headers_out directly via the apr_table_setn() call. Although using
apr_table_setn() is appropriate for many HTTP headers Apache actively
manages a small set of headers in
http_filters.c:ap_http_header_filter(). These managed headers are
derived from values maintained in the request_rec. "Content-Type" is
one of the managed headers.

Because we didn't set r->content_type field via the
ap_set_content_type() call and instead directly updated the
r->headers_out table our value for "Content-Type" was overwriten when
the ap_http_header_filter() was run just prior to emitting the
response with the result the "Content-Type" header returned to the
client was incorrect.

Signed-off-by: John Dennis <jdennis@redhat.com>
2017-01-16 09:17:04 -05:00
Olav Morken 9f3ec6010c Add email address for reporting security vulnerabilities. 2017-01-16 12:16:16 +01:00
Olav Morken 6471dadffe Fix segmentation fault when the IdP returns an attribute without a Name.
The SAML 2.0 specification requires the name to be present, but we still
should not crash when it is missing. This patch fixes the crash by skipping
over attributes without a name.

Fixes issue #101.
2016-11-01 10:34:09 +01:00
Emmanuel Dreyfus 8aa8530cf4 Do not redirect unauthenticated AJAX request to the IdP
When MellonEnable is "auth" and we get an unauthenticated AJAX
request (identified by the X-Request-With: XMLHttpRequest HTTP
header), fail with HTTP code 403 Forbidden instead of redirecting
to the IdP. This saves resources, as the client has no opportunity
to interract with the user to complete authentification.
2016-10-18 13:42:09 +02:00
Olav Morken 39b4871422 Merge pull request #99 from vittala/same_site_cookie
Rework the MellonCookieSameSite configuration to provide a custom parser
2016-09-28 11:19:21 +02:00
Olav Morken d68fa22220 Merge pull request #98 from vittala/cache_control
Adds the MellonSendCacheControlHeader to control the cache-control header
2016-09-28 10:21:38 +02:00
Vittal Aithal 7c93add68c Rework the MellonCookieSameSite configuration to provide a custom parser
MellonCookieSameSite allows control over the SameSite cookie
attribute. With this, authentication cookies can be protected
against CRFS type attacks.

The configuration directive can have values of Strict or Lax.
If not set, the attribute is not used on the authentication cookie.
2016-09-26 16:21:46 +01:00
Vittal Aithal 411e9f6808 Adds the MellonSendCacheControlHeader to control the cache-control header
https://github.com/UNINETT/mod_auth_mellon/issues/2 raises the issue
of the Cache-Control header always being set, but with some users
needing to turn it off.

This update adds the MellonSendCacheControlHeader configuration
directive which can be set to Off, resulting in the cache-control
header not being set.
2016-09-26 15:29:27 +01:00
Olav Morken 9e8919598e Fix processing of assertions without a Conditions-element.
This element isn't required by the Web Browser SSO Profile, so we shouldn't
reject assertions just because it is missing.
2016-08-26 09:39:40 +02:00
Olav Morken 0520c1ab21 Merge pull request #91 from rainerjung/consistent_lasso_error_output
Consistent lasso error reporting.
2016-06-27 15:32:23 +02:00
Olav Morken f96a3aa449 Merge pull request #90 from rainerjung/use_2_4_log_index
Support Apache 2.4 per module log level.
2016-06-27 15:31:25 +02:00
Rainer Jung a568c17b48 Consistent lasso error reporting.
All other log messages containing lasso errors already use the idiom
    Some message. Lasso error: [%i] %s", ..., rc, lasso_strerror(rc)
The different log format here leads e.g. to a double "." at the
end of the log message. Example:
    Error adding metadata "/path/to/idp-metadata.xml" to lasso
    server objects: Parsed XML is invalid..
2016-06-25 19:30:11 +02:00
Rainer Jung 0c844eab83 Support Apache 2.4 per module log level.
Use APLOG_USE_MODULE if available.
This will also add the module name to its error log messages,
e.g. "[auth_mellon:error]" instead of just "[:error]".

No change for Apache 2.2.
2016-06-25 19:23:16 +02:00
Olav Morken 6d5ae677a3 Merge pull request #89 from rainerjung/curlopt_type_long_timeout
Use "long" type in curl_easy_setopt for timeouts
2016-06-24 08:50:38 +02:00
Rainer Jung 70f8ad9705 Use "long" type in curl_easy_setopt for timeouts
Curl timeouts in auth_mellon_httpclient should be given as long
values and have semantic meaning of seconds.

The code currently passes them in as apr_time_t type which
contains seconds, although apr_time_t should contain
microseconds.

I suggest to not use apr_time_t here, because it is misleading,
and instead use a plain int. The code calling httpclient already
prepares the value as an int. Furthermore convert the value to a
long when curl_easy_setopt() is being called.
2016-06-23 18:53:54 +02:00
Olav Morken 09c3d80606 Merge pull request #87 from rainerjung/trivial-log-typo
Fix trivial typo in log message for am_handle_probe_discovery().
2016-06-23 09:20:09 +02:00
Olav Morken 12118974fe Merge pull request #88 from rainerjung/printf-format-warnings
Fix print format compiler warnings
2016-06-23 09:19:04 +02:00
Olav Morken 3f942813da Merge pull request #86 from rainerjung/ap_strcasestr
Use ap_strcasestr instead of strcasestr for improved POSIX compatibility
2016-06-23 09:16:12 +02:00
Rainer Jung f2ad9bbde3 Fix print format compiler warnings 2016-06-22 22:27:17 +02:00
Rainer Jung ab9d362094 Fix trivial typo in log message for am_handle_probe_discovery(). 2016-06-22 22:11:03 +02:00
rainerjung 018c59ff5f Use ap_strcasestr instead of strcasestr for improved POSIX compatibility
Some platforms, e.g. Solaris, do not have strcasestr(). Apache brings ap_strcasestr() since version 2.0.0.
2016-06-22 20:46:52 +02:00
Olav Morken 6bdda9170a Fix segmentation fault when receiving badly formed logout message.
If the logout message is badly formed, we won't get the entityID in
`logout->parent.remote_providerID`. If we call `apr_hash_get()` with a
null pointer, it will cause a segmentation fault.

Add a check to validate that the entityID is correctly set.
2016-05-24 10:29:38 +02:00
Olav Morken 92f9073656 Merge pull request #81 from adelton/MellonEnvVarsSetCount
Fixing default and example for MellonEnvVarsSetCount.
2016-05-13 09:37:38 +02:00
Jan Pazdziora 9316763fb7 Fixing default and example for MellonEnvVarsSetCount. 2016-05-09 16:26:03 +02:00
Olav Morken 18a01bd9e8 Merge pull request #77 from wanion/wanion-patch-1
Fix default post item size limit
2016-04-27 08:22:24 +02:00
Fred Young 44da72efdf change default post item size limit to 1 MB 2016-04-27 18:08:19 +12:00
Fred Young 690bfe15e1 Fix unit on MellonPostSize description 2016-04-27 13:13:35 +12:00
Olav Morken cc0e28af23 Merge pull request #76 from jdennis/ecp_doc
Fix Content-Type, should be "text/xml" not "application/soap+xml"
2016-04-11 09:05:24 +02:00
Olav Morken 21672ffb63 Merge pull request #75 from jdennis/check_uid_forbidden
am_check_permissions() failure should return HTTP_FORBIDDEN
2016-04-11 09:05:05 +02:00
Olav Morken a99c081b1e Merge pull request #74 from jdennis/check_uid
am_check_uid() should be no-op if mellon not enabled
2016-04-11 09:03:55 +02:00
John Dennis 483271d7f6 am_check_permissions() failure should return HTTP_FORBIDDEN
In am_check_uid() if am_check_permissions() denies access then the
proper HTTP return code is FORBIDDEN (which is what
am_check_permissions() returns on failure). Returning the result of
am_check_permissions() is what is already done in
am_auth_mellon_user(), this just makes the behavior
consistent. Returning UNAUTHORIZED is clearly wrong, that is meant to
indicate authentication needs to be performed.

Signed-off-by: John Dennis <jdennis@redhat.com>
2016-04-08 15:29:45 -04:00
Olav Morken aed464355f Merge pull request #73 from specifice/master
Allow separate configuration of mellon cookie 'HttpOnly' and 'secure' flags.
2016-04-08 17:32:06 +02:00
John Dennis 39017b2957 Fix Content-Type, should be "text/xml" not "application/soap+xml"
There was an error in the example for POST'ing the the AuthnRequest to
the IdP, the Content-Type header erroneously was
"application/soap+xml" when in fact it should have been "text/xml".

As background the Content-Type for SOAP 1.1 is "text/xml" but in SOAP
1.2 it was changed to "application/soap+xml". ECP is specificed to
used SOAP 1.1.

Signed-off-by: John Dennis <jdennis@redhat.com>
2016-04-08 09:17:17 -04:00
John Dennis 912aa852eb am_check_uid() should be no-op if mellon not enabled
mod_auth_mellon was interferring with other Apache authentication
modules (e.g. mod_auth_kerb) because when the Apache check_user_id
hook ran the logic in am_check_uid would execute even if mellon was
not enabled for the location. This short circuited the hook execution
and never allowed the authentication enabled for the location to
execute. It resulted in HTTP_UNAUTHORIZED being returned with the
client then expecting a WWW-Authenticate header field causing the
client to attempt to authenticate again.

Signed-off-by: John Dennis <jdennis@redhat.com>
2016-04-08 09:01:22 -04:00
oleg.tsernetsov c0c0fc09dc Allow separate configuration of mellon cookie 'HttpOnly' and 'secure'
flags.
Introduce new values for MellonSecureCookie configuration option:
'secure' and 'httponly' for setting just one particular cookie flag. Old
'On' and 'Off' values remain supported and behave the same way as
before.
2016-04-08 14:42:24 +03:00
Olav Morken fe0eb56e29 Return 500 Internal Server Error if probe discovery fails.
If we don't, we can end up sending an authentication request to an IdP
that is not in the MellonProbeDiscoveryIdP list, which is probably not
what the user wants.

Patch by Emmanuel Dreyfus.
2016-03-14 09:47:48 +01:00
Olav Morken 38ef347045 Fix description of MellonProbeDiscoveryTimeout.
This option has no default value, but must instead be specified in order
to use this feature.
2016-03-14 09:41:15 +01:00
Olav Morken f9d6555c36 Fix misspelling in "MellonRedirectDomains". 2016-03-09 10:45:28 +01:00
Olav Morken bbca80e039 Version 0.12.0. 2016-03-09 09:49:48 +01:00
Olav Morken 76aaae421c NEWS file for release 0.11.1. 2016-03-09 09:49:46 +01:00
Olav Morken 338c9ffb58 Add NEWS file for version 0.12.0. 2016-03-09 09:49:21 +01:00
Olav Morken 208990377b Limit POST data to 1 MiB.
To avoid exhausting memory fetching POST data from clients,
limit POST data to 1 MiB.
2016-03-07 09:40:02 +01:00