Commit Graph

79 Commits

Author SHA1 Message Date
Roger Meier 59648dda65 feat: add MellonAuthnContextComparisonType option 2019-07-19 16:55:33 +02:00
Vita Batrla f9b925f21c Fix implicit function declaration: rindex on Solaris
Compilation on reports warning:

"auth_mellon_diagnostics.c", line 188: warning: implicit function declaration: rindex
"auth_mellon_diagnostics.c", line 188: warning: improper pointer/integer combination: op "="

And binary dumps core, because rindex() is assumed to be integer type, so
compiler sign extends its return value and then uses the number as pointer:

am_diag_cond_str+0x154:      call   -0x1e119 <PLT=libc.so.1`rindex>
am_diag_cond_str+0x159:      movslq %eax,%rax
am_diag_cond_str+0x15c:      testq  %rax,%rax
am_diag_cond_str+0x15f:      je     +0x7     <am_diag_cond_str+0x168>
am_diag_cond_str+0x161:      movb   $0x5d,(%rax)  <- SIGSEGV

Fixes issue #207.
2019-06-07 10:28:14 +02:00
Jakub Hrozek caea8d78dd Make the environment variable prefix configurable
mellon passes on every attribute received in a SAML assertion as an
Apache variable. By default, the variable is prefixed with "MELLON_".

In some cases, for example when migrating from a different SP to mellon
it might be beneficial to change the prefix. And while using
MellonSetEnvNoPrefix is an option as well, the MellonSetEnvNoPrefix has
to be specified for each variable independently.
2019-04-12 14:38:41 +02:00
Olav Morken f86a86519e
Merge pull request #156 from jdennis/sign_alg
Add MellonSignatureMethod to control signature algorithm
2018-02-22 07:20:00 +01:00
John Dennis 9b17e5c107 Add MellonSignatureMethod to control signature algorithm
Previously there was no way to control the signature algorithm used
when Mellon signed it's SAML messages. It simply defaulted to whatever
the default was in the LassoServer server object. Currently the lasso
default is LASSO_SIGNATURE_METHOD_RSA_SHA1. Some IdP's require a
different or more secure method (e.g. ADFS). This patch allows
controlling the signature method on a per directory basis via the
MellonSignatureMethod configuration directive.

It currently supports the following configuration values which map to
these Lasso enumerated constants (provided these definition exist in
Lasso):

rsa-sha1:    LASSO_SIGNATURE_METHOD_RSA_SHA1
rsa-sha256:  LASSO_SIGNATURE_METHOD_RSA_SHA256
rsa-sha384:  LASSO_SIGNATURE_METHOD_RSA_SHA384
rsa-sha512:  LASSO_SIGNATURE_METHOD_RSA_SHA512

configure.ac was modified to test for the existence of the above
Lasso definitions, support is only compiled into Mellon if they
are defined at build time.

Important: This patch also changes the default used by Mellon from
rsa-sha1 to rsa-sha256. This was done because SHA1 is no longer
considered safe, SHA256 is now the current recommendation.

The patch also includes a few corrections in the diagnostics code
where it failed to use CFG_VALUE. Also fixed the diagnostics code when
an unknown value was encounted to print what that unknown value was.

Signed-off-by: John Dennis <jdennis@redhat.com>
2018-02-21 18:39:46 -05:00
John Dennis 582f283c49 Log SAML status response information
Knowing if a SAML operation failed and the reason why is essential to
diagnose problems. The SAML Status Response is always included in all
SAML responses. In addition to the major reason why a transaction
failed it may also include extra expository information giving
additional details. Unfortunately we never logged any of the status
response information when a failure occurred. This patch adds code to
log the status response information.

In addition the patch adds diagnostic logging of received POST data.

Signed-off-by: John Dennis <jdennis@redhat.com>
2018-02-20 16:55:17 -05:00
Olav Morken 70e8abc3a4 Give clear error if building with diagnostics support on old Apache
This patch ensures that we fail with a clear error message if building
with diagnostics support on Apache 2.2 or older.
2018-01-18 18:44:28 +01:00
Olav Morken 15fcbf7c9d Fix build error on Apache 2.2.
The `mi` parameter to `ap_log_rerror()` was added in Apache 2.4. This
makes the macro expansion in `AM_LOG_RERROR()` incorrect on Apache
2.2.

This patch works around this issue by forwarding the `AM_LOG_RERROR()`
macro directly to `ap_log_rerror()`.

Fixes issue 151.
2018-01-18 18:36:22 +01:00
John Dennis de853e1554 Add user_guide to distribution, use AC_DEFINE instead of CFLAGS
This patch corrects a few minor autotool issues.

The user_guide was recently added but that commit failed to include
adding the new documentation to the tarball, Makefile.in was augmented
to include the new files to the list of distribution files.

Formerly the #defines generated by configure were passed to the
compiler on the command line in various CFLAGS values. Although that
works the more -Dxxx that configure generates the longer the compile
command becomes and it starts to get unreadable and possibly exceed
command line length. A more common practice with autotools is to
employ autoheader whereby configure generates a file typically called
config.h which then is included by the C files. The contents of
config.h contains the #defines as generated by configure. configure.ac
was updated to utilize the AC_DEFINE in lieu of adding -Dxxx to CFLAGS
and to generate and output config.h.

Note: autogen.sh needs to be re-run to pick up these changes so that
the configure included in the tarball contains the updated version.

Signed-off-by: John Dennis <jdennis@redhat.com>
2017-09-29 13:42:24 -04:00
John Dennis 8d49ab65a1 Replace ap_log_rerror with AM_LOG_RERROR
If diagnostics is enabled we want error messages written to the
diagnostics log as well as the Apache error_log. AM_LOG_RERROR
replaces the use of ap_log_rerror, it invokes ap_log_rerror as
previously but then also logs the same message to the diagnostics
log. If diagnostics is not enabled it reverts to ap_log_rerror.

Signed-off-by: John Dennis <jdennis@redhat.com>
2017-09-25 11:09:23 -04:00
John Dennis e8579f6387 Add diagnostic logging
Field experience with Mellon has demonstrated there are many
opportunities for deployment problems. Although there are tools such
as browser plugins which can capture SAML messages it's onerous for
site personnel to install and capture the relevant information. The
problem with this approach is further compounded by the fact the
external SAML messages are not correlated to Mellon's
requests/responses. Mellon currently can dump the Lasso session and
SAML Response messages and place them in Apache environment variables,
however these do not appear in the log file. To get them into the log
you have to add custom logging to the Apache config. Another issue is
the dumps are not human readable, they are base64 encoded, anyone
looking at the logs after setting up the custom logging will have to
find the base64 text and then manually copy the text into an external
base64 decoder. At that point you'll discover the XML is not pretty
printed making human interpretation difficult.

The Mellon debug messages written to the Apache error are often
insufficient to diagnose problems. And since the Mellon log messages
are written to the Apache error log they are interspersed with a lot
of non-Mellon message.

Compounding the problem of writing Mellon debug messages to the Apache
error log is the fact Apache log messages have a fixed maximum length
(currently 8192) which is insufficient to completely write out such
things as SAML Assertions, metadata, etc. Apache logging also escapes
all control characters with the consequence line breaks are not
preserved and what was a nicely formatted human readable piece of text
becomes a single line with escape characters and may be truncated.

It would be really nice if we could capture diagnostic information
with these properties:

* All relevant data is collected in exactly one file.

* Only information relevant to Mellon appears in the file.

* All information is human readable (pretty printed, decrypted) with
  no need to rely on other tools.

* The diagnostic information is grouped by requests.

* The requests can be cross correlated with other Apache logs because
  they utilize the same unique request identifier.

This patch adds diagnostic logging to a independent Mellon diagnostics
log file. Every piece of relevant information is captured, including:

* Request information which includes:

  - Request method
  - Request URL (raw and processed)
  - Scheme
  - Port
  - Request query parameters
  - Server name
  - Unique request ID
  - process ID, thread ID
  - Request headers

* Mellon per directory configuration

  A complete dump of the entire am_dir_cfg_rec structure keyed using
  both the Mellon directive it is associated with and it's internal
  name. This is emitted once on first use for a given URL.

  The per directory dump includes the pathname of each file read as
  well as the file contents. This includes:

  - IdP metadata
  - SP metadata
  - SP cert
  - SP key
  - IdP public key file
  - IdP CA file

* All session management operations

  - cookie
  - session lookup
  - session creation
  - session deletion
  - cache management
  - cache entry information

* All SAML messages

  Each SAML message is decrypted, decoded and XML pretty printed in
  human readable form.

* Request pipeline operations

  What operations Mellon performs, what decisions it makes and what
  data is being used to make those decisions.

* Response

  - response status
  - response headers
  - Apache user name
  - auth_type
  - all Apache environment variables

Diagnostics can be enabled/disabled both at compile time and run
time. Compile time inclusion of diagnostics is managed with the
ENABLE_DIAGNOSTICS preprocssor symbol. The configure script now accepts
the

  --enable-diagnostics and --disable-diagnostics

option. Building with diagnostics is disabled by default, you must
specify --enable-diagnostics to enable the run time option of generating
diagnostics.

The following server config directives have been added (e.g. may be
specified in the main server config area or within a <VirtualHost>
directive). If Mellon was not built with diagnostics enabled then
these config directives are no-ops and their use will generated a
warning in the log file indicating they have been ignored and to be
effective you must builld Mellon with diagnostics enabled.

  MellonDiagnosticsFile:
    The name of the diagnostics file or pipe,
    (default is logs/mellon_diagnostics)

  MellonDiagnosticsEnable:
    Currently either On or Off but it is designed so it can take other
    flags in the future to control what type of information is
    reported.

Signed-off-by: John Dennis <jdennis@redhat.com>
2017-09-25 11:09:10 -04:00
John Dennis 6d2ee845c0 Track file information
File information was handled inconsistently. Some configuration
directives which specified a file path replaced the file path with the
contents of the file. This made it impossible to report where the data
was read from. Other file configuration simply recorded the path. The
directives which immediately read the file contents would generate a
configuration error if the file wasn't readable, but those directives
which simply recorded the file path didn't check on the validity of
the path and relied on Lasso to report an error, however these errors
come significantly after configuration parsing because they are
evaluated in a lazy fashion on first use. The Lasso error reporting
can sometimes be cryptic making it difficult to realize the problem is
due to a improperly specified path in a configuration directive.

We want to be able to log the file pathnames where various files are
read from for diagnostic logging purposes.

This patch introduces a new struct am_file_data_t that encapsulates
all information concerning a file including it's pathname, it's stat
information, optionally it's content, when it was read, etc. as well
as maintaing error codes and an error description.

All file specifications and operations now use this mechanism for
consistency.

Signed-off-by: John Dennis <jdennis@redhat.com>
2017-09-22 13:44:13 -04:00
John Dennis 119cbdd525 modify cache functions to take request_rec parameter instead of server_rec
The entire point of the cache is to persist state between requests so
conceptually it makes sense the cache functions would receive a
server_rec pointer because the cache is a server level data
structure. However most cache operations occur in the context of a
request. Passing a request_rec to a cache function has the following
advantages:

1) Any logging during a cache operation should be tied to the request.

2) Any need for temporary memory allocation is much easier to handle
with access to the request's memory pool which is cleaned up at the
end of the request as opposed to trying manage memory allocations at
the server level.

3) Any need for access to the server_rec is trivially easy to obtain
from the request_rec via r->server. In fact the caller of cache
functions inside requests simplyy provided the server_rec parameter
via r->server, so why not just pass the request_rec?

These changes are in anticipation of adding enhanced logging and
diagnostics into the cache functions, they will need access to the
request_rec and it's memory pool.

Signed-off-by: John Dennis <jdennis@redhat.com>
2017-09-02 12:31:24 -04:00
Olav Morken 7af21c53da Fix Cross-Site Session Transfer vulnerability
mod_auth_mellon did not verify that the site the session was created
for was the same site as the site the user accessed. This allows an
attacker with access to one web site on a server to use the same
session to get access to a different site running on the same server.

This patch fixes this vulnerability by storing the cookie parameters
used when creating the session in the session, and verifying those
parameters when the session is loaded.

Thanks to François Kooman for reporting this vulnerability.

This vulnerability has been assigned CVE-2017-6807.
2017-03-13 09:55:48 +01: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
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
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
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 9d28908e28 Add MellonRedirectDomains option.
Limit the domains that we will redirect to after login / logout to a
set of trusted domains. By default we only allow redirects to the
current domain.

This change breaks backwards compatibility with any site that relies on
redirects to separate domains.

Fixes #35
2015-12-11 11:32:03 +01:00
John Dennis d300d3abcf Support ECP service options in PAOS request
The OASIS specification "SAML V2.0 Enhanced Client or Proxy Profile
Version 2.0" added ECP service options into the HTTP PAOS header. We
previously were not looking for these optional flags. The function
am_validate_paos_header() was rewritten to correctly parse the service
value and the optional URN flags and return a bitmask of the ECP
service flags.

The following flags were added:

  * ECP_SERVICE_OPTION_CHANNEL_BINDING
  * ECP_SERVICE_OPTION_HOLDER_OF_KEY
  * ECP_SERVICE_OPTION_WANT_AUTHN_SIGNED
  * ECP_SERVICE_OPTION_DELEGATION

The flags are stored in the am_req_cfg_rec.ecp_service_options member.

Currently only the want_authn_signed option is acted upon, it sets the
lasso signature hint when generating a AuthnRequest.

Lasso as of 2.5.0 is missing 3 of the URN flag identifier constants, a
patch was submitted to upstream Lasso to include them and was
accepted. As a fallback they are conditionally added to lasso_compat.h
in case the version of lasso this is compiled against does not yet
have the new constants.

The function am_is_paos_request() was modified to return an error.
New error codes were added to auth_mellon.h.

New utility code to tokenize a string was added. This is used to
parse the PAOS header, primarily to handle quoted strings.

A new utility routine, *am_ecp_service_options_str() was added so log
messages could include the ECP service option flags in their output.

Signed-off-by: John Dennis <jdennis@redhat.com>
2015-11-10 09:13:18 -05:00
John Dennis 6c1012e202 Add support for SAML ECP.
The modifications in this commit address the changes necessary to
support the SP component of SAML ECP. The Lasso library needs
additional modifications before SAML ECP will be fully functional,
those fixes have been submitted to upstream Lasso, mod_auth_mellon
will continue to operate correctly without the Lasso upgrade, it just
won't properly support ECP without the Lasso fixes.

Below are the major logical changes in the commit and the rationale
behind them.

* Allow compilation against older versions of Lasso by conditionally
  compiling.

  Add the following CPP symbols set by configure:

  * HAVE_ECP
  * HAVE_LASSO_UTILS_H

* Add lasso_compat.h

  If we can't include lasso utils.h than pull in our own
  local definitions so we can use some of the valuable
  utilities.

* Add ECP specific documentation file

  Documentation specific to ECP is now contained in ECP.rst
  (using reStructuredText formatting). Information on general ECP
  concepts, mod_auth_mellon user information, and internal
  mod_auth_mellon coding issues are covered.

* Add am_get_boolean_query_parameter() utility

* Add am_validate_paos_header() utility

  This utility routine validates the PAOS HTTP header. It is used
  in conjunction with am_header_has_media_type() to determine if a
  client is ECP capable.

* Add am_is_paos_request() utility

  This utility checks to see if the request is PAOS based on the
  required HTTP header content.

* Add utility function am_header_has_media_type() to check if an HTTP
  Accept header includes a specific media type. This is necessary
  because the SP detects an ECP client by the presence of a
  application/vnd.paos+xml media type in the Accept
  header. Unfortunately neither Apache nor mod_auth_mellon already had
  a function to check Accept media types so this was custom written
  and added to mod_auth_mellon.

* Add utility function am_get_assertion_consumer_service_by_binding()
  because Lasso does not expose that in it's public API. It's
  necessary to get the URL of the PAOS AssertionConsumerService.

* Add MellonECPSendIDPList config option

  This option controls whether to include a list of IDP's when
  sending an ECP PAOS <AuthnRequest> message to an ECP client.

* We need to do some bookkeeping during the processing of a
  request. Some Apache modules call this "adding a
  note". mod_auth_mellon was already doing this but because it only
  needed to track one value (the cookie value) took a shortcut and
  stuffed the cookie value into the per module request slot rather
  than defining a struct that could hold a variety of per-request
  values. To accommodate multiple per request bookkeeping values we
  define a new struct, am_req_cfg_rec, that holds the previously used
  cookie value and adds a new ECP specific value. This struct is now
  the bookkeeping data item attached to each request. To support the
  new am_req_cfg_rec struct the am_get_req_cfg macro was added (mirrors
  the existing am_get_srv_cfg, am_get_mod_cfg and am_get_dir_cfg
  macros). The am_create_request() Apache hook was added to
  initialize the am_req_cfg_rec at the beginning of the request
  pipeline.

* A new endpoint was added to handle PAOS responses from the ECP
  client. The endpoint is called "paosResponse" and lives along side
  of the existing endpoints (e.g. postResponse, artifactResponse,
  metadata, auth, logout, etc.). The new endpoint is handled by
  am_handle_paos_reply(). The metadata generation implemented in
  am_generate_metadata() was augmented to add the paosResponse
  endpoint and bind it to the SAML2 PAOS binding.

* am_handle_reply_common() was being called by am_handle_post_reply()
  and am_handle_artifact_reply() because replies share a fair amount
  of common logic. The new am_handle_paos_reply() also needs to
  utilize the same common logic in am_handle_reply_common() but ECP
  has slightly different behavior that has to be accounted for. With
  ECP there is no SP generated cookie because the SP did not initiate
  the process and has no state to track. Also the RelayState is
  optional with ECP and is carried in the PAOS header as opposed to an
  HTTP query/post parameter. The boolean flag is_paos was added as a
  parameter to am_handle_reply_common() so as to be able to
  distinguish between the PAOS and non-PAOS logic.

* Add PAOS AssertionConsumerService to automatically generated metadata.
  Note, am_get_assertion_consumer_service_by_binding() should be able
  to locate this endpoint.

* Refactor code to send <AuthnRequest>, now also supports PAOS

  The creation and initialization of a LassoLogin object is different
  for the ECP case. We want to share as much common code as possible,
  the following refactoring was done to achieve that goal.

  The function am_send_authn_request() was removed and it's logic
  moved to am_init_authn_request_common(),
  am_send_login_authn_request() and
  am_set_authn_request_content(). This allows the logic used to create
  and initialize a LassoLogin object to be shared between the PAOS and
  non-PAOS cases. am_send_paos_authn_request() also calls
  am_init_authn_request_common() and
  am_set_authn_request_content(). The function
  am_set_authn_request_content() replaces the logic at the end of
  am_send_authn_request(), it is responsible for setting the HTTP
  headers and body content based on the LassoLogin.

Signed-off-by: John Dennis <jdennis@redhat.com>
2015-09-03 13:32:45 -04:00
Thijs Kinkhorst 885b991af9 Obsolete the MellonDecoder configuration directive.
The only supported options were 'none' and 'feide', where there is
no usecase anymore for 'feide', leaving only 'none'. This changes
the function into a no-op, it will still accept the MellonDecoder
directive for backwards compatibility.
2015-08-31 10:03:38 +00:00
Jan Pazdziora 9c6b27c54e MellonMergeEnvVars can now take second optional parameter to specify the separator. 2015-04-17 16:59:10 +02:00
Jan Pazdziora 24b9a2e8c6 Adding MellonEnvVarsSetCount functionality. 2015-04-16 11:02:21 +02:00
Jan Pazdziora 3e2f2af6c7 Adding MellonEnvVarsIndexStart functionality. 2015-04-15 10:59:21 +02:00
Alex Vandiver e31dfc79ed Replace newly-added apr_uintptr_t with apr_size_t, for apr < 1.3.0
As per e6f60211; apr_uintptr_t was added in apr 1.3.0.  Switching to
apt_size_t restores compatibility with earlier versions of apr.

Signed-off-by: Alex Vandiver <alex@chmrr.net>
2015-03-26 02:39:14 -04:00
Olav Morken f02f4c7c7c Merge pull request #9 from jaroslawp/master
Adding mulitple-valued ENV variables option to mod_auth_mellon
2014-11-25 12:52:52 +01:00
Jarek Polok 1d61071f18 Adding MellonMergeEnvVars (optional) functionality
Allows to concatenate env. variables values
in single variable name, ie:

VAR=val1;val2;val3;...

instead of standard mod_auth_mellom behaviour:

VAR=val1
VAR_0=val1
VAR_1=val2
VAR_2=val3
...
2014-11-13 19:39:59 +01:00
Jarek Polok d133a1c50d Define envirnment size spacious enough to hold large number of attributes. 2014-11-13 13:11:57 +01:00
Olav Morken 4062e36456 Move session table initialization into session file.
This moves all the code working on the session table to that file.
2014-08-27 15:15:35 +02:00
olavmrk 519f22493e Convert session user name to dynamic size storage
Using the previously introduced storage facility convert storage of the
user name from being constrained to fixed sized strings to being
constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@236 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:28 +00:00
olavmrk 5ad49a4c84 Convert session env array to dynamic size storage
Using the previously introduced storage facility convert storage of env
key/value pairs from being constrained to fixed sized strings to being
constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@235 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:22 +00:00
olavmrk e486a708c5 Convert lasso_saml_response to dynamic size storage
Using the previously introduced storage facility converts storage
of lasso_saml_reponse from being constrained to a fixed sized string
to being constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@234 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:16 +00:00
olavmrk f60d394094 Convert lasso_session to dynamic size storage
Using the previously introduced storage facility converts storage
of lasso_session from being constrained to a fixed sized string
to being constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@233 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:25:02 +00:00
olavmrk f91a46b9b4 Convert lasso_identity to dynamic size storage
Using the previously introduced storage facility converts storage
of lasso_identity from being constrained to a fixed sized string
to being constrained only by the overall entry cache size.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@232 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:24:56 +00:00
olavmrk 8dacb03887 Introduce dynamic memory pool for sessions
This pool has a fixed size and the aim is to avoid arbitrary limits
on entry's components, while maintaining an overall fixed entry size.

Accessors function for a storage unit are provided for future use.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@231 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:24:38 +00:00
olavmrk c7a0d4d8f5 Add a helper to redirect on unauthorized error
In case we are going to return a HTTP_UNAUTHORIZED
error we can also redirect the client to an admin chosen
page to let the application handle the error on its own.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@227 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-04-25 09:11:46 +00:00
olavmrk d1a2b63b74 Handle non successful status posted by the Idp
Idps may decide to deny authentication for a variety of reasons.
In such a case they will post to the application with an unsuccessful
status error code.

Handle the case by returning a more appropriate 401 Unauthorized
HTTP error code.

iDo this using an extensible mechanism to map arbitrary lasso errors
to HTTP errors.

Signed-off-by: Simo Sorce <simo@redhat.com>

git-svn-id: https://modmellon.googlecode.com/svn/trunk@226 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-04-25 09:11:40 +00:00
olavmrk b88de1e317 Simplify cache disabling headers.
This patch changes the headers sent to prevent errornous caching of the
responses sent to only use a single header:

   Cache-Control: private, must-revalidate

This single header should ensure that the data isn't shared between
multiple users, and that the browser checks that the content is still
valid for each request (enabling logout to work as expected).

This drops the Exires-header, which should be unnecessary since all
modern browsers support the Cache-Control-header.

Thanks to Arthur Müller for providing this patch.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@223 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-02-13 09:05:21 +00:00
olavmrk 8f403cc3d5 Add MellonSetEvnNoPrefix option.
This option allows you to set environment variables without the
"MELLON_" prefix.

Thanks to Laas Toom for implementing this!

git-svn-id: https://modmellon.googlecode.com/svn/trunk@211 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-30 07:35:54 +00:00
olavmrk 68d3b04aaa Move GLib compatibility helpers to a separate file.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@207 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-08 12:24:19 +00:00
manu@netbsd.org 1d2c882ba1 Add MellonSPentityId to control entityId in autogenerated metadata
git-svn-id: https://modmellon.googlecode.com/svn/trunk@205 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-04-15 14:54:38 +00:00
olavmrk 540d7e4eea Rename am_generate_session_id() to am_generate_id().
Since this function is used for both generating session IDs and for
generating POST data identifiers for POST replay, it should have a
generic name.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@181 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-06 12:53:54 +00:00
olavmrk 81cf686843 Disable replay of POST request by default.
Since we are going to disable autocreation of the POST data directory,
we will need to disable POST replay by default. This patch adds the
MellonPostReplay option, which can be used to enable and disable the
POST replay functionality on a per-location basis.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@177 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-06 12:53:38 +00:00
benjamin.dauvergne 4abc14dbdd add implementation of g_hash_table_get_keys to compile under Centos 5
git-svn-id: https://modmellon.googlecode.com/svn/trunk@171 a716ebb1-153a-0410-b759-cfb97c6a1b53
2012-10-10 10:35:15 +00:00
benjamin.dauvergne 0e35cd2063 Add configuration directive MellonDoNotVerifyLogoutSignature
This directive allows to list IdP entityID for which the signature of
their logout request must not be verified.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@168 a716ebb1-153a-0410-b759-cfb97c6a1b53
2012-10-09 08:41:45 +00:00
benjamin.dauvergne ce1a5d08aa Add directive MellonSubjectConfirmationDataAddressCheck
MellonSubjectConfirmationDataAddressCheck allows to block client address
checking as given in IdP assertion in the SubjectConfirmationData node,
it can be necessary when client and IdP or SP are in a NAT-ed network or
when the SP is behind a reverse proxy.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@152 a716ebb1-153a-0410-b759-cfb97c6a1b53
2012-02-17 14:01:24 +00:00
olavmrk 463d0450de Add MellonAutnContextClassRef to configuration directives
You can list many class refs they will be concatenated inside an array.
Beware that in each directory, if there is any
MellonAuthnContextClassRef directive, any settings from the previous
level is overwritten.

Thanks to Benjamin Dauvergne for implementing this.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@140 a716ebb1-153a-0410-b759-cfb97c6a1b53
2011-12-07 10:19:35 +00:00
manu@netbsd.org 9dfc3a92ef Honour MellonProbeDiscoveryIdP order when sending probes
git-svn-id: https://modmellon.googlecode.com/svn/trunk@139 a716ebb1-153a-0410-b759-cfb97c6a1b53
2011-12-05 19:06:44 +00:00