John Dennis [Mon, 14 Sep 2015 21:24:23 +0000 (17:24 -0400)]
Modify is_lasso_ecp_enabled() to test for library symbol
The function is_lasso_ecp_enabled() in saml2idp.py was testing for a
specific lasso version. That has proved problematic because we've had
too many "unofficial" versions floating around and sometimes the
version check produces the wrong result.
A better test is to test for the presence of a symbol in the lasso
library we know will only be there with full ECP support.
Now we test for the presence of ECP_ERROR_MISSING_AUTHN_REQUEST.
Ticket: 167
Signed-off-by: John Dennis <jdennis@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Sat, 5 Sep 2015 20:58:43 +0000 (22:58 +0200)]
Bump version to 1.1.0
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Sat, 5 Sep 2015 00:27:47 +0000 (02:27 +0200)]
Make it possible to use PluginLoader without store
In the case of OpenID extensions, a backend store is not needed
for the PluginLoader, since the IDP Plugin has its own configuration
for enabled extensions.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 4 Sep 2015 20:28:40 +0000 (22:28 +0200)]
Also create plugin UserStore data tables
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 4 Sep 2015 20:27:27 +0000 (22:27 +0200)]
Also add the store name when reporting data load error
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 4 Sep 2015 18:46:04 +0000 (20:46 +0200)]
Make the database upgrade system use logger
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 4 Sep 2015 17:37:34 +0000 (19:37 +0200)]
Implement cleanup for OpenIDStore
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 4 Sep 2015 16:16:51 +0000 (18:16 +0200)]
Make it possible to enable database query echoing
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 4 Sep 2015 16:13:39 +0000 (18:13 +0200)]
Implement cleanup for sessions
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 4 Sep 2015 16:05:33 +0000 (18:05 +0200)]
Implement cleeanup for TranStore
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Wed, 2 Sep 2015 15:49:08 +0000 (17:49 +0200)]
Implement automatic database cleanup
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Fri, 4 Sep 2015 15:37:09 +0000 (11:37 -0400)]
Derive splink when registering SP, allow visible = True in SP portal
The splink value wasn't being passed when registering a new client.
We don't need to prompt for this since we know it already
Accept 'True' as a value for visible when determining if we
should show a provider on the SP portal page.
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Fri, 4 Sep 2015 15:00:09 +0000 (11:00 -0400)]
saml_base must be a subpath of saml_auth in client installer
If the authenticated path doesn't reside under saml_base (which
defaults to /) then mod_auth_mellon can't find the IdP.
https://fedorahosted.org/ipsilon/ticket/163
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewd-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Fri, 4 Sep 2015 13:53:40 +0000 (09:53 -0400)]
Flip some debug messages to error messages in SAML2 provider
Some failures were only being logged at the debug level which
would be difficult if not impossible to track down on an
operational server. This should give an operator a chance to
figure out what is going on.
https://fedorahosted.org/ipsilon/ticket/159
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:55:39 +0000 (16:55 -0400)]
Update REST test to include attributes for SP Portal
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:13:15 +0000 (16:13 -0400)]
Ship the PatternFlyIcons font in fonts-local.
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:12:29 +0000 (16:12 -0400)]
Build and ship CSS for SP Portal
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:58:34 +0000 (16:58 -0400)]
Regenerate the CSS, add patternfly and styles
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:16:03 +0000 (16:16 -0400)]
CSS for the SP Portal
This controls the SP tiles and auto-generates an
image for an SP that doesn't have one based on
the first letter of its name.
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:54:23 +0000 (16:54 -0400)]
Update bootstrap, update/add all of PatternFly, add font-awesome
These are required for the SP Portal as designed by the UI team.
Some local changes were done to patternfly to fix the location of
bootstrap and font-awesome but it should be fairly similar to
the upstream version.
patternfly 2.0.0
bootstrap 3.3.5
fontawesome 4.3.0
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 21:03:16 +0000 (17:03 -0400)]
Add CSS to preview an uploaded image
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:56:26 +0000 (16:56 -0400)]
Javascript for filtering the SP by name and description
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:55:56 +0000 (16:55 -0400)]
End-user UI for SP Portal
Update the root page to include the list of SAML2
Service Providers in a dynamic layout with a
filter which can search on SP name and description.
Hide providers that the admin does not want visible.
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:53:16 +0000 (16:53 -0400)]
Create cache directory for storing images for SP Portal
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 2 Sep 2015 20:51:32 +0000 (16:51 -0400)]
SP Portal administrative interface
Add database values for the SP: visible, image, SP link and
description.
Update REST interface to accept values for these attributes.
https://fedorahosted.org/ipsilon/ticket/148
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Thu, 3 Sep 2015 23:32:00 +0000 (01:32 +0200)]
Close connections after creating the tables
This needs to be done manually in the case of upgrades, because
there is no cherrypy end_request to help us close sessions.
Everytime we do a self._query a new connection is allocated, so
we need to make sure to terminate them all.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Thu, 3 Sep 2015 22:55:24 +0000 (00:55 +0200)]
Fix the database upgrade for readonly databases (file-conf)
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Thu, 3 Sep 2015 21:01:56 +0000 (23:01 +0200)]
Add openid_extensions table to be created
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Thu, 3 Sep 2015 19:36:20 +0000 (21:36 +0200)]
Fix database upgrades from partially initialized schema 1 databases
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Thu, 3 Sep 2015 14:30:47 +0000 (16:30 +0200)]
Fix initialization of plugin_data table in AdminStore
This was created ad-hoc before, but now has to be created by the
upgrade script.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Mon, 31 Aug 2015 23:33:02 +0000 (01:33 +0200)]
Add test suite for database upgrades
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Mon, 31 Aug 2015 21:48:31 +0000 (23:48 +0200)]
Implement database upgrade for indexes
This implements upgrading from schema version 1 to 2.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Tue, 11 Aug 2015 09:52:13 +0000 (11:52 +0200)]
Add SQL primary key and indexes
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
John Dennis [Thu, 27 Aug 2015 20:34:40 +0000 (16:34 -0400)]
Define PAOS AssertionConsumerService in ipsilon-client-install
A SAML SP will not be able to perform ECP unless a
AssertionConsumerService for the PAOS binding has been defined in it's
metadata. The PAOS AssertionConsumerService participates in the ECP
protocol exchange, specifically it's where the ECP client sends the
IdP Assertion.
If lasso starts to engage in an ECP transaction by trying to generate a
Samlp:AuthnRequest and no PAOS AssertionConsumerService is defined in
the SP metadata it will fail with a unknown provider error.
Note, AssertionConsumerService elements are indexed endpoints, there
may be one per protocol binding. Now that there is more than 1
AssertionConsumerService we set the isDefault flag to True on the
existing post response at index 0. This isn't strictly necessary
because the spec says if the default flag isn't set on any
AssertionConsumerService endpoint then the first one is selected, but
it's good practice anyway.
FWIW, if mod_auth_mellon is not configured with metadata then
mod_auth_mellon will generate it's own metadata which includes the
PAOS AssertionConsumerService. However in ipsilon-client we generate
the SP metadata and were failing to add the PAOS
AssertionConsumerService, something mellon would have done
automatically for us. This is why this bug was only first seen using
ipsilon-client-install.
Ticket: 162
Signed-off-by: John Dennis <jdennis@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Mon, 31 Aug 2015 05:08:05 +0000 (07:08 +0200)]
Rename the SAML2 sessions database to saml2_sessions
This makes it possible to have saml2 sessions and Ipsilon sessions
in the same database without any problems.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Sun, 30 Aug 2015 10:55:21 +0000 (12:55 +0200)]
Create database upgrade framework
This creates a framework for uprading database scheme to the latest version,
and a script that will execute them.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Sun, 30 Aug 2015 22:56:16 +0000 (00:56 +0200)]
Move initialization of SAML2 cleanup to init_idp
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Mon, 31 Aug 2015 17:27:58 +0000 (13:27 -0400)]
Add city to info plugin, fetch correct attrs in SSSD
Add missing variable in the info plugins common list
for city.
Fix the mapping in the infosssd plugin where locality
was being passed in as state. It is now set as city
and st as state.
Care needs to be taken with LDAP attributes as Ipsilon
doesn't currently handle attribute aliases.
https://fedorahosted.org/ipsilon/ticket/161
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Wed, 19 Aug 2015 03:29:20 +0000 (05:29 +0200)]
Fix transaction check
This fixes OpenID specification compliance, since the main
OpenID endpoint URL needs to serve a non-error result on
query, and the current code would error out.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Wed, 19 Aug 2015 14:13:36 +0000 (10:13 -0400)]
Validate options of the LDAP auth plugin on installation
Few of the LDAP options had any validation at all so it was
easy to provide a bad DN template, basedn and server URL.
These types of errors are now sufficient to kill the installer
rather than letting it limp along and hope the user notices the
failures in the output.
https://fedorahosted.org/ipsilon/ticket/40
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Mon, 24 Aug 2015 17:42:19 +0000 (17:42 +0000)]
Log a message when authentication is successful but doesn't
match the NameID required by the SAML request.
https://fedorahosted.org/ipsilon/ticket/157
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Mon, 24 Aug 2015 18:27:35 +0000 (18:27 +0000)]
Count IPA as a login plugin when checking for enabled plugins
The installer ensures that at least one login plugin is enabled.
It didn't consider IPA, which automatically enables gssapi,
when doing this calculation. Add a check so that IPA counts as well.
https://fedorahosted.org/ipsilon/ticket/152
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Jan Pazdziora [Tue, 25 Aug 2015 11:56:35 +0000 (11:56 +0000)]
Make wellknowndir substitution work on Alias line as well.
Signed-off-by: Jan Pazdziora <jpazdziora@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Tue, 18 Aug 2015 15:10:46 +0000 (17:10 +0200)]
Enable auto-escaping templates
This will prevent most cases of insertion of HTML or other
code into the generated HTML.
Fixes: CVE-2015-5215
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Tue, 18 Aug 2015 14:26:50 +0000 (16:26 +0200)]
Fix permission check on SP update
The permission check for owner was checking the wrong field,
which would make it possible for anyone to update the Service
Provider owner, making it possible for anyone to change the
SP owner, allowing anyone to change the SP name.
Fixes: CVE-2015-5217
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Mon, 20 Jul 2015 20:42:36 +0000 (16:42 -0400)]
Report to user if an LDAP error occurs
Catch LDAP errors and display them properly rather than
just dumping the exception.
Rename variable authed to authok.
Add test for case where LDAP server is not started to
confirm the user receives the error alert.
https://fedorahosted.org/ipsilon/ticket/55
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Tue, 18 Aug 2015 16:36:18 +0000 (18:36 +0200)]
Clear testdir before test run
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Fri, 17 Jul 2015 18:07:16 +0000 (14:07 -0400)]
Mark the service as readonly in the UI in authpam plugin
Update the Option class to take a readonly keyword argument,
defaulting to False. Extend its subclasses to pass this value
along.
The page template will add the disabled keyword to input and
textarea if a config option is marked as readonly.
https://fedorahosted.org/ipsilon/ticket/6
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Fri, 17 Jul 2015 14:03:15 +0000 (16:03 +0200)]
Only initialize the Persona IDP when actually enabled
This has the same reasoning as the OpenID patch (commit
ac7c20cca81c3d23ee66f224030b316bdff2274a), with additionally
that it will otherwise error on loading the signing key.
(This is not critical though as it will retry loading and
succeed, this is just to make it not spit that error).
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Thu, 6 Aug 2015 15:12:16 +0000 (15:12 +0000)]
Use full path when constructing "Other authentication methods"
It was previously providing just a relative path and if the paths
overlapped I guess the browser was trying to smash them together.
This would result in a double "gssapi" in the gssapi URL like:
https://my.ipsilon.org/idp/login/gssapi/gssapi/negotiate?ips...
Don't rely on the browser to get the path right, use self.basepath.
https://fedorahosted.org/ipsilon/ticket/153
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Pierre-Yves Chibon [Tue, 28 Jul 2015 11:19:49 +0000 (11:19 +0000)]
Drop all the calls to .keys() when iterating on the keys of a dict
When browsing the keys of a dictionary, you can use the ``.keys()`` method but
that is in fact only really useful if you want to store the list of keys first
and act on them (like sorting them or so).
If you just want to iterate through all the keys, no matter the order, then it
is much much faster to just do: ``for key in dict``
Some stats about this can be found there:
http://blog.pingoured.fr/index.php?post/2012/03/12/Python-notes-to-self
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Fri, 17 Jul 2015 15:39:34 +0000 (11:39 -0400)]
Log caught exceptions in server installer at debug level
exception() is a helper that logs a traceback at the ERROR
level. Since the stdout logs at INFO the traceback was going to
both the log file and stdout. We really only want it in the debug
log.
https://fedorahosted.org/ipsilon/ticket/143
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Fri, 17 Jul 2015 20:15:35 +0000 (16:15 -0400)]
Set the value of WantAuthnRequestsSigned to True
The spec says the default should be False if not specified
but lasso sets it to true unless it is explicitly set to
False. So let's be explicit and set it to True.
https://fedorahosted.org/ipsilon/ticket/136
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Thu, 16 Jul 2015 18:04:56 +0000 (14:04 -0400)]
Include timezone in metadata validUntil value and use UTC time
The python datetime module doesn't append the timezone in its
isoformat() output, so add a Z indicating that the time is
UTC time. Also generate the output using utcnow() rather than
now() so the times line up.
https://fedorahosted.org/ipsilon/ticket/137
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Fri, 17 Jul 2015 13:57:28 +0000 (15:57 +0200)]
Only initialize the SAML IDP when actually enabled
This has the same reasoning as the OpenID patch (commit
ac7c20cca81c3d23ee66f224030b316bdff2274a), with additionally
that it will otherwise error on finding the metadata.
(This is not critical though as it will retry loading and
succeed, this is just to make it not spit that error).
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Mon, 13 Jul 2015 20:32:02 +0000 (16:32 -0400)]
Refactor SP generation to simplify logout testing
This adds the ability to quickly and easily add more SPs as needed
to test more complex logout scenarios.
Create five SP's, two of which support only HTTP-Redirect to ensure
that logout works in a mixed environment.
https://fedorahosted.org/ipsilon/ticket/59
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Mon, 13 Jul 2015 21:43:20 +0000 (17:43 -0400)]
Add client install option to disable logout over SOAP
This is at least somewhat for testing to ensure that
a mixed environment works but HTTP Redirect is the
recommended mechanism in the spec so some may want
to use only that.
https://fedorahosted.org/ipsilon/ticket/59
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Thu, 25 Jun 2015 15:00:59 +0000 (11:00 -0400)]
Add support for logout over SOAP
As each login session comes in, store the supported logout
mechanisms in the SP metadata.
Upon a logout request, loop through all of those SP's that
support SOAP and log those out first, then log out any
remaining sessions using HTTP Redirect.
https://fedorahosted.org/ipsilon/ticket/59
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Tue, 14 Jul 2015 19:35:21 +0000 (15:35 -0400)]
Return PAM errors from mod_intercept_form_submit
This fixes several problems:
1. The PAM error was being retrieved from the wrong location
2. The error was not always logged properly
3. The error was not propogated up
4. Even if the error had been propgated up the auth_failed
routine failed to pass it to the error page template.
A dictionary is used to translate the PAM errors into something
more consulable. This can be used eventually to translate
into other languages.
https://fedorahosted.org/ipsilon/ticket/69
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Wed, 8 Jul 2015 10:37:04 +0000 (12:37 +0200)]
Only initialize the OpenID IDP when actually enabled
This is needed because otherwise it will try to set the database schema version
before it read the configuration for providers, which means it will do this
in the default (openid.sqlite) database file.
If you are running as a non-privileged user (as your should) with the working
directory pointing somewhere this user is unable to write, this means it will
fail to write this.
Note: the working directory is not in the default wsgi file, which means that
people using that will not likely hit this bug.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Patrick Uiterwijk [Wed, 8 Jul 2015 01:01:50 +0000 (03:01 +0200)]
Replace some type(...) checks with isinstance(...)
This is needed because otherwise the pylint version in
Fedora 22 will complain.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Jamie Lennox [Mon, 6 Jul 2015 05:08:33 +0000 (05:08 +0000)]
Default --saml-sp-logout/post base on --saml-sp
In ipsilon-client-install salow setting only --saml-sp and have
--saml-sp-logout and --saml-sp-post values based upon the provided value
rather than complaining that the defaults are wrong.
Closes-Ticket: 145
Signed-off-by: Jamie Lennox <jamielennox@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Patrick Uiterwijk [Mon, 22 Jun 2015 15:38:33 +0000 (17:38 +0200)]
Add missing requirement on mod_ssl for ipsilon-client
https://fedorahosted.org/ipsilon/ticket/144
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rich Megginson [Mon, 8 Jun 2015 22:22:27 +0000 (16:22 -0600)]
ipsilon-client-install give password in env. var.
https://fedorahosted.org/ipsilon/ticket/142
If --admin-password is not given, see if the IPSILON_ADMIN_PASSWORD
environment variable is set, and use it for the admin_password, before
doing getpass().
Signed-off-by: Rich Megginson <rmeggins@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Mon, 11 May 2015 23:12:15 +0000 (01:12 +0200)]
Bump version for 1.0.0 release
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Wed, 6 May 2015 22:22:55 +0000 (18:22 -0400)]
Install man pages for client and server
This includes the man pages for the installers and for
ipsilon.conf.
https://fedorahosted.org/ipsilon/ticket/34
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Thu, 7 May 2015 20:34:27 +0000 (16:34 -0400)]
Add man page for ipsilon.conf.
https://fedorahosted.org/ipsilon/ticket/34
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Thu, 7 May 2015 18:55:20 +0000 (14:55 -0400)]
Add more text to ipsilon(7) man page
https://fedorahosted.org/ipsilon/ticket/34
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 6 May 2015 22:15:15 +0000 (18:15 -0400)]
ipsilon-server-install man page
https://fedorahosted.org/ipsilon/ticket/34
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Wed, 6 May 2015 18:54:19 +0000 (14:54 -0400)]
ipsilon-client-install man page
https://fedorahosted.org/ipsilon/ticket/34
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Mon, 11 May 2015 22:15:51 +0000 (18:15 -0400)]
Add logout to pgdb, fix name in tests
Add a logout to the postgres test to ensure that sessions are
updated properly on logout.
Fix the name in the tests, it was test1.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Mon, 11 May 2015 22:14:42 +0000 (18:14 -0400)]
Use plugin-specific configuration, better expiration
Use a SAML2 plugin specific option to specify the database uri
for sessions.
Use a much more robust method to find sessions that need
expiration (thanks Patrick).
https://fedorahosted.org/ipsilon/ticket/90
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Mon, 20 Apr 2015 20:44:41 +0000 (16:44 -0400)]
Remove expired SAML2 sessions
Run a cherrypy background task to sift through the sessions
database and find expired entries and remove them.
From my testing if a previous execution of the background task
is still executing when the next one is scheduled to run, it will
skip it. In other words, you can't end up with multiple expirations
running at the same time.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Tue, 21 Apr 2015 13:44:04 +0000 (09:44 -0400)]
Update IdP-initiated logout to use SAML2 Store
This moves the order in which the "fake" session is created and
it gives it a unique ID rather than using a fixed value.
Rely on the LogoutRequest request ID so we can get the
order of logout correct.
The basic idea is a logout request is created for the IdP
containing the URL of the IdP itself as the RelayState. A
session is picked and a LogoutRequest generated and sent.
There will be a LogoutRequest/LogoutResponse back and forth
until there are no more sessions to log out. The last
session will be this "fake" session that started it all
and the user will be redirected to the main page of the IdP.
https://fedorahosted.org/ipsilon/ticket/90
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Tue, 21 Apr 2015 13:40:30 +0000 (09:40 -0400)]
Convert logout code to use SAML2 Store
This is functionally the same. The primary differences are:
- When logging out, fetch all requested session indexes in the
LogoutRequest.
- Store the LogoutRequest request ID to be used later when a
LogoutResponse is received to look up the logout.
https://fedorahosted.org/ipsilon/ticket/90
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Tue, 21 Apr 2015 13:38:14 +0000 (09:38 -0400)]
Create a SAML2 session during login
Use the updated session API to create a SAML2 session.
Note that each session is stored discretely. Previously if
a session for a provider already existed then that one session
held all the session indexes. Now if a new session comes in
it is added separately. During logout all sessions for a provider
are retrieved and all logged-in sessions sent to the SP to
log out.
https://fedorahosted.org/ipsilon/ticket/90
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Tue, 21 Apr 2015 13:35:25 +0000 (09:35 -0400)]
Change SAML2 sessions backend to use Store API
The basic session API remains the same, just replace
the calls to pull data out of the user session to
instead pull from the database.
The per-session logout state is now a constant rather than
being a member of either the logged_in or logging_out
dictionaries.
https://fedorahosted.org/ipsilon/ticket/90
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Tue, 21 Apr 2015 13:34:41 +0000 (09:34 -0400)]
Configure the SAML2 session database during installation
https://fedorahosted.org/ipsilon/ticket/90
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Tue, 21 Apr 2015 13:30:31 +0000 (09:30 -0400)]
Add support for storing SAML2 sessions
Store SAML2 session information in a table rather than with the
user entry so sessions can be persisted past IdP restarts and if
the user accesses the system via multiple browsers SLO will log
out all sessions, not just the user session that initiated the
logout.
https://fedorahosted.org/ipsilon/ticket/90
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Patrick Uiterwijk [Fri, 8 May 2015 16:30:02 +0000 (18:30 +0200)]
Add uninstallation support to infosssd
This should make it revert any changes it made during
installation.
https://fedorahosted.org/ipsilon/ticket/67
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 8 May 2015 16:12:06 +0000 (18:12 +0200)]
Implement change registration
This will make it possible for plugins to register what they
have changed during installation, so that they can revert
any changes they made during the uninstallation.
https://fedorahosted.org/ipsilon/ticket/67
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Patrick Uiterwijk [Fri, 8 May 2015 14:56:36 +0000 (16:56 +0200)]
Add database schema versioning
With this skeleton code we can add upgrade code
if we ever change the database schema.
https://fedorahosted.org/ipsilon/ticket/56
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
John Dennis [Mon, 26 Jan 2015 21:04:40 +0000 (16:04 -0500)]
Implement ECP in Ipsilon
* add saml2/SSO/SOAP endpoint.
* add check for lasso version, ECP endpoint only exposed in metadata
if lasso has full ECP support.
* add SSO_SOAP soap authentication handler (used for ECP).
* add SAML binding to transaction so we can determine if cookies
and other HTTP concepts are expected. Each handler is responsible
for setting the binding.
* add some constants needed for ECP
https://fedorahosted.org/ipsilon/ticket/4
Signed-off-by: John Dennis <jdennis@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Fri, 8 May 2015 02:40:19 +0000 (22:40 -0400)]
Update Copyright header point to COPYING file
Point to a file containing the license rather than including
it in every single source file. This will make it easier to
manage the license in the future without another humongous
commit.
https://fedorahosted.org/ipsilon/ticket/126
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Fri, 8 May 2015 13:46:24 +0000 (09:46 -0400)]
Remove extraneous logging arg in authform login plugin
If you didn't provide credentials at all at the form by
pressing ENTER then a 500 error would be thrown rather
than an authentication error.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Rob Crittenden [Fri, 8 May 2015 13:44:26 +0000 (09:44 -0400)]
Set infosssd config value preconfigured as a boolean
It was storing a python boolean which saved as integer 1
but when reading the data the Condition translates text into
a python native value.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Nathan Kinder <nkinder@redhat.com>
Rob Crittenden [Thu, 7 May 2015 19:51:23 +0000 (15:51 -0400)]
Add db.conn.log option to suppress sql logs by default
The Store logging is quite verbose with a flurry of
init and destroy messages with each session. Setting
db.conn.log to False (default) will suppress these. If one
needs to do connection tracing it can be enabled.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Nathan Kinder [Thu, 7 May 2015 17:59:30 +0000 (10:59 -0700)]
Fix ownership of config and state directories
The recent RPM package restructing introduced some problems with
the ownership of /etc/ipsilon and /var/lib/ipsilon. These were
previously owned by the 'ipsilon' user, but the changes resulted
in the ownership being set as root since the 'ipsilon' user was
not yet created when the directories were installed.
While discussing this problem, it was determined that we should
have the ownership of these directories be root, but allow other
users to traverse through them so they can access subdirectories
that they have permissions on.
Signed-off-by: Nathan Kinder <nkinder@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Simo Sorce [Thu, 7 May 2015 16:33:40 +0000 (12:33 -0400)]
pylint 1.4.3 version fixes
Pylint 1.4.3 completely stopped recognizing the star-args condition.
In order to avoid pylint error with > 1.4.3 stop caring for star-args
and add cmdline option to ignore those errors completly so older pylint
versions are happy too.
Also fix type() vs isinstance() checks, isinstance is generally a more
correct approach to check for classes.
In some 'admin' files the type() -> isinstance() fix required to invert
the order in which ComplexList and MappingList are checked as the latter
is a subclass of ComplexList, so it needs to be checked first otherwise
the check for isinstance(option, ComplexList) matches for both and the
code stops functioning properly.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Tue, 5 May 2015 16:37:31 +0000 (12:37 -0400)]
Pull the GSSAPI principal out of the userattrs
This was originally getting the principal from the
user object itself which meant it was looking for
it in the database. Look in the attributes instead
which are stored in the user session.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Tue, 5 May 2015 15:27:14 +0000 (11:27 -0400)]
Enable Kerberos NameID testing in testnameid
Since there is now an easy way to stand up a KDC in the
tests go ahead and enable it so the Kerberos NameID can be
tested.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Tue, 28 Apr 2015 14:52:55 +0000 (10:52 -0400)]
Configure a KDC, add test for GSSAPI/Kerberos
Using nss_wrappers so we can control host names we can
setup a KDC and test GSSAPI, including fallback to
forms-based auth.
This also means that fetch_page() needs to handle 401
a bit better, so it can re-try a failed authentication or
fall back to forms-based auth.
Note for posterity: if gss_localname() fails this is likely
due to using the wrong krb5.conf in Apache, so pass in all
environment variables.
The KDC setup code was based heavily on the tests in the
gssproxy project.
https://fedorahosted.org/ipsilon/ticket/116
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Tue, 21 Apr 2015 22:19:17 +0000 (18:19 -0400)]
Use python logging in install / log cherrypy at right severity
This replaces the print statements in the installer code with
a python logger so we can log all output to the installer log
and a subset of it to stdout in one step without duplication.
The cherrypy.log.error() logs to the "error" log at a severity
of logging.INFO by default. Set an appropriate log level for
these as well.
https://fedorahosted.org/ipsilon/ticket/35
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Wed, 6 May 2015 15:35:50 +0000 (11:35 -0400)]
Remove unnecessary lines from infoldap plugin
These three lines were ostensibly storing various elements
of configuration but were in fact creating a new dict
each time, wiping out all previous elements.
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Simo Sorce [Wed, 6 May 2015 15:47:46 +0000 (11:47 -0400)]
SSSD info plugin is immutable if not preconfigured
The SSSD info plugin configures SSSD and modules in
Apache as root during installation. This cannot be
done in the UI so we must not allow users to modify
the state if it was not "preconfigured" during
install.
If it has been configured then users are allowed
to enable/disable the plugin.
This is controlled by a value stored in the
info_config table, preconfigured.
The plugin configuration is hidden from the UI by
overridding the get_config_object() method.
https://fedorahosted.org/ipsilon/ticket/111
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Wed, 29 Apr 2015 17:57:34 +0000 (13:57 -0400)]
Drop usage of self._debug and use self.debug instead
This method was deprecated but still used in a lot of places.
https://fedorahosted.org/ipsilon/ticket/120
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Rob Crittenden [Wed, 29 Apr 2015 18:13:25 +0000 (14:13 -0400)]
Fix lint issues with loginstack changes
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Simo Sorce [Tue, 31 Mar 2015 20:35:15 +0000 (16:35 -0400)]
Merge the login and info plugins configurations
Having separate login and info plugins configuration pages doesn't
really make a lot of sense. As a first step moving towards login stacks
put login and info plugin configuration into a common "Login Stack"
menu item.
https://fedorahosted.org/ipsilon/ticket/117
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Tue, 28 Apr 2015 19:16:54 +0000 (15:16 -0400)]
Change references to authkrb plugin to authgssapi
With the switch to mod_auth_gssapi we aren't limited to only
negotiated Kerberos so name the plugin to reflect this.
https://fedorahosted.org/ipsilon/ticket/114
Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Rob Crittenden [Tue, 28 Apr 2015 19:15:39 +0000 (15:15 -0400)]
Rename authkrb plugin to authgssapi
https://fedorahosted.org/ipsilon/ticket/114
Signed-off-by: Rob Crittenden <rcritten@redhat.com>