Commit Graph

45 Commits

Author SHA1 Message Date
Benjamin Dauvergne fec1f4ae26 Compute version using git tags 2020-02-18 10:29:10 +01:00
Olav Morken 7d681177cb Bump version to 0.14.2 2019-03-21 14:58:35 +01:00
Olav Morken 881d11cafd Bump version to 0.14.1 2019-02-11 08:26:56 +01:00
Olav Morken 29d2872f9b Bump version to 0.14.0. 2018-03-16 08:21:38 +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 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 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
Olav Morken 1851412d77 Version 0.13.1. 2017-03-13 10:14:53 +01:00
Olav Morken 890e0fa487 Release version 0.13.0. 2017-02-22 07:17:44 +01:00
Olav Morken bbca80e039 Version 0.12.0. 2016-03-09 09:49:48 +01:00
Olav Morken cee415cfe1 Version 0.11.0. 2015-09-16 16:29:32 +02: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
Olav Morken 0c86f8a79a Bump version to 0.10.0. 2014-12-18 11:00:32 +01:00
Olav Morken d8649e8afc Version 0.9.1. 2014-09-01 10:12:09 +02:00
Olav Morken 6390db7356 Version 0.9.0. 2014-08-27 15:37:48 +02:00
olavmrk a887d8cb3c Update news file and version number for version 0.8.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@238 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-24 08:24:36 +00:00
olavmrk 66f6d2cb08 Compile in C99-mode.
Some of the following patches use features from C99, so make sure that
we are compiling using that version.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@230 a716ebb1-153a-0410-b759-cfb97c6a1b53
2014-06-20 11:24:33 +00:00
olavmrk edd4e78db4 Version 0.7.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@214 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-05-30 07:45:21 +00:00
olavmrk 0b11c9f3ee Version 0.6.1.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@204 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-22 11:55:05 +00:00
olavmrk 1e6f81f03a Version 0.6.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@199 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 09:20:37 +00:00
olavmrk f1455f5b8a Revert "Revert "Directly link to GLib.""
I accidentally committed a revert that I had done for debugging.

This commit reverts the revert :)

git-svn-id: https://modmellon.googlecode.com/svn/trunk@197 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:50:23 +00:00
olavmrk 66487eb08d Revert "Directly link to GLib."
This reverts commit ee8e7f205d6c7cecdc56491877de88a361e027e3.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@195 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:20:23 +00:00
olavmrk ba7530132d Directly link to GLib.
Instead of relying on the Lasso library including GLib for us,
we should link directly with it.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@194 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-15 08:20:19 +00:00
olavmrk 380377d5d3 Version 0.6.0-rc1.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@190 a716ebb1-153a-0410-b759-cfb97c6a1b53
2013-03-06 12:54:31 +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
olavmrk 1c334c09f1 Version 0.5.0
git-svn-id: https://modmellon.googlecode.com/svn/trunk@156 a716ebb1-153a-0410-b759-cfb97c6a1b53
2012-04-16 09:13:16 +00:00
olavmrk 6be1eb4530 Check for version 2.14 of GLib.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@138 a716ebb1-153a-0410-b759-cfb97c6a1b53
2011-09-23 11:27:49 +00:00
olavmrk 31e25148a1 Version 0.4.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@132 a716ebb1-153a-0410-b759-cfb97c6a1b53
2011-05-18 10:49:43 +00:00
olavmrk 72ae1cf687 Add support for loading federation metadata files.
Patch originally created by Emmanuel Dreyfus, some changes by me.

git-svn-id: https://modmellon.googlecode.com/svn/trunk@129 a716ebb1-153a-0410-b759-cfb97c6a1b53
2011-05-18 10:49:25 +00:00
olavmrk beae36f11e Version 0.3.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@104 a716ebb1-153a-0410-b759-cfb97c6a1b53
2010-08-12 11:06:32 +00:00
olavmrk 53b999c82f configure: Fix test for apxs.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@103 a716ebb1-153a-0410-b759-cfb97c6a1b53
2010-07-02 11:51:00 +00:00
olavmrk 525ba0c50b Version 0.2.7
git-svn-id: https://modmellon.googlecode.com/svn/trunk@86 a716ebb1-153a-0410-b759-cfb97c6a1b53
2010-05-31 13:13:49 +00:00
olavmrk f9de5380ec Version 0.2.6
git-svn-id: https://modmellon.googlecode.com/svn/trunk@78 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-12-21 14:06:29 +00:00
olavmrk 3dd79b7cc2 Version 0.2.5
git-svn-id: https://modmellon.googlecode.com/svn/trunk@73 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-11-16 09:20:06 +00:00
olavmrk 727a602582 Version 0.2.4
git-svn-id: https://modmellon.googlecode.com/svn/trunk@66 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-08-11 13:52:06 +00:00
olavmrk e56fed8e02 Version 0.2.3
git-svn-id: https://modmellon.googlecode.com/svn/trunk@63 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-08-07 12:57:02 +00:00
manu@netbsd.org 94926d954a Bump to 0.2.2
git-svn-id: https://modmellon.googlecode.com/svn/trunk@58 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-06-15 14:10:23 +00:00
manu@netbsd.org f79b9efaca Bump to 0.2.1
git-svn-id: https://modmellon.googlecode.com/svn/trunk@53 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-06-05 20:17:14 +00:00
olavmrk ec12ba32a5 Version 0.2.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@47 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-05-13 06:44:04 +00:00
olavmrk b5e1926a71 Version 0.1.1
git-svn-id: https://modmellon.googlecode.com/svn/trunk@42 a716ebb1-153a-0410-b759-cfb97c6a1b53
2009-03-06 08:34:29 +00:00
olavmrk 7a1a61171f Version 0.1.0.
git-svn-id: https://modmellon.googlecode.com/svn/trunk@39 a716ebb1-153a-0410-b759-cfb97c6a1b53
2008-11-11 21:05:58 +00:00
olavmrk e8069a2825 Use lasso_server_new_from_buffer if available.
Recent versions of Lasso supports loading the SP metadata,
certificate and private key from memory. This patch changes mod_mellon
to use this function if it is available. This makes it possible to store
the SP private key readable only from root.

Thanks to Emmanuel Dreyfus for this patch.


git-svn-id: https://modmellon.googlecode.com/svn/trunk@35 a716ebb1-153a-0410-b759-cfb97c6a1b53
2008-11-10 18:33:55 +00:00
olavmrk daeadc382d Update version to 0.0.7
git-svn-id: https://modmellon.googlecode.com/svn/trunk@26 a716ebb1-153a-0410-b759-cfb97c6a1b53
2008-07-01 13:44:45 +00:00
olavmrk 1fa6146abe Initial import of version 0.0.6
git-svn-id: https://modmellon.googlecode.com/svn/trunk@3 a716ebb1-153a-0410-b759-cfb97c6a1b53
2007-09-24 09:56:34 +00:00