source: TI12-security/trunk/python/ndg_security_test/ndg/security/test/integration/authz_lite/securityservices.ini @ 6067

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg_security_test/ndg/security/test/integration/authz_lite/securityservices.ini@6067
Revision 6067, 20.1 KB checked in by pjkersha, 11 years ago (diff)

Re-issue 1.3.3 release:

  • uses SQLAlchemy test user database for authz_lite integration tests
  • important fix for ndg.security.common.saml_utils.bindings.AttributeQuerySOAPBinding: set 'nameFormat' attribute not 'format' for attributes in AttributeQuery?.
Line 
1#
2# NERC DataGrid Security
3#
4# Paste configuration for combined Attribute Authority, OpenID Relying Party
5# and Provider services
6#
7# The %(here)s variable will be replaced with the parent directory of this file
8#
9# Author: P J Kershaw
10# date: 01/07/09
11# Copyright: (C) 2009 Science and Technology Facilities Council
12# license: BSD - see LICENSE file in top-level directory
13# Contact: Philip.Kershaw@stfc.ac.uk
14# Revision: $Id:$
15
16[DEFAULT]
17portNum = 7443
18hostname = localhost
19scheme = https
20baseURI = %(scheme)s://%(hostname)s:%(portNum)s
21openIDProviderIDBase = /openid
22openIDProviderIDSelectURI = %(baseURI)s%(openIDProviderIDBase)s
23testConfigDir = %(here)s/../../config
24beakerSessionKeyName = beaker.session.ndg.security.services
25
26# Global Attribute Authority Settings
27attributeAuthorityEnvironKeyName = ndg.security.server.attributeauthority.AttributeAuthority
28attributeQueryInterfaceEnvironKeyName = ndg.security.server.attributeauthority.attributeQueryInterface
29
30dbConnectionString = sqlite:///%(testConfigDir)s/user.db
31
32[server:main]
33use = egg:Paste#http
34host = 0.0.0.0
35port = %(portNum)s
36
37[filter-app:OpenIDProviderFilterApp]
38use = egg:Paste#httpexceptions
39next = cascade
40
41# Composite for OpenID Provider to enable settings for picking up static
42# content
43[composit:cascade]
44use = egg:Paste#cascade
45app1 = OpenIDProviderStaticContent
46app2 = OpenIDProviderApp
47catch = 404
48
49[app:OpenIDProviderStaticContent]
50use = egg:Paste#static
51document_root = %(here)s/openidprovider
52
53# Ordering of filters and app is critical
54[pipeline:main]
55pipeline = wsseSignatureVerificationFilter
56                   AttributeAuthorityFilter
57                   AttributeAuthorityWsdlSoapBindingFilter
58           wsseSignatureFilter
59           AttributeAuthoritySamlSoapBindingFilter
60                   SessionMiddlewareFilter
61                   SSLCientAuthKitFilter
62                   SSLClientAuthenticationFilter
63                   SSLCientAuthnRedirectResponseFilter
64                   OpenIDRelyingPartyFilter
65                   OpenIDProviderApp
66
67#______________________________________________________________________________
68# Beaker Session Middleware (used by OpenID Provider Filter)
69[filter:SessionMiddlewareFilter]
70paste.filter_app_factory=beaker.middleware:SessionMiddleware
71beaker.session.key = openid
72beaker.session.secret = qKEdQdCr33NE087dRUWX3qUv5r7AsuQU
73
74# If you'd like to fine-tune the individual locations of the cache data dirs
75# for the Cache data, or the Session saves, un-comment the desired settings
76# here:
77beaker.cache.data_dir = %(here)s/openidprovider/beaker/cache
78beaker.session.data_dir = %(here)s/openidprovider/beaker/sessions
79beaker.session.cookie_expires = True
80
81# Key name for keying into environ dictionary
82environ_key = %(beakerSessionKeyName)s
83
84[filter:SSLCientAuthKitFilter]
85paste.filter_app_factory = authkit.authenticate:middleware
86
87# AuthKit Set-up
88setup.method=cookie
89
90# This cookie name and secret MUST agree with the name used by the
91# Authentication Filter used to secure a given app
92cookie.name=ndg.security.auth
93
94cookie.secret=9wvZObs9anUEhSIAnJNoY2iJq59FfYZr
95cookie.signoutpath = /logout
96
97# Disable inclusion of client IP address from cookie signature due to
98# suspected problem with AuthKit setting it when a HTTP Proxy is in place
99cookie.includeip = False
100
101# SSL Client Certificate based authentication is invoked if the client passed
102# a certificate with request.  This bypasses OpenID based authn.
103[filter:SSLClientAuthenticationFilter]
104paste.filter_app_factory = ndg.security.server.wsgi.ssl:AuthKitSSLAuthnMiddleware
105prefix = ssl.
106ssl.caCertFilePathList = %(testConfigDir)s/ca/ndg-test-ca.crt
107#ssl.clientCertDNMatchList = /O=NDG/OU=BADC/CN=mytest /O=gabriel/OU=BADC/CN=test /O=NDG/OU=BADC/CN=test
108
109# 'HTTP_' prefix is set when passed through a proxy
110ssl.sslKeyName = HTTP_HTTPS
111ssl.sslClientCertKeyName = HTTP_SSL_CLIENT_CERT
112
113# Set the URI pattern match here to interrupt a redirect to the OpenID Relying
114# Party from the service running over HTTP and see if a client certificate has
115# been set
116ssl.rePathMatchList = ^/verify.*
117
118[filter:OpenIDRelyingPartyFilter]
119paste.filter_app_factory = 
120        ndg.security.server.wsgi.openid.relyingparty:OpenIDRelyingPartyMiddleware.filter_app_factory
121
122openid.relyingparty.baseURL = %(authkit.openid.baseurl)s
123openid.relyingparty.certFilePath = %(testConfigDir)s/pki/localhost.crt
124openid.relyingparty.priKeyFilePath = %(testConfigDir)s/pki/localhost.key
125openid.relyingparty.priKeyPwd = 
126openid.relyingparty.caCertDirPath = %(testConfigDir)s/ca
127openid.relyingparty.providerWhitelistFilePath =
128openid.relyingparty.signinInterfaceMiddlewareClass = ndg.security.server.wsgi.openid.relyingparty.signin_interface.genshi.GenshiSigninTemplate
129openid.relyingparty.signinInterface.staticContentRootDir = %(here)s/openidrelyingparty/public
130openid.relyingparty.signinInterface.baseURL = %(openid.relyingparty.baseURL)s
131openid.relyingparty.signinInterface.initialOpenID = %(openIDProviderIDSelectURI)s
132openid.relyingparty.signinInterface.leftLogo = %(openid.relyingparty.signinInterface.baseURL)s/layout/NERC_Logo.gif
133openid.relyingparty.signinInterface.leftAlt = Natural Environment Research Council
134openid.relyingparty.signinInterface.ndgLink = http://ndg.nerc.ac.uk/
135openid.relyingparty.signinInterface.ndgImage = %(openid.relyingparty.signinInterface.baseURL)s/layout/ndg_logo_circle.gif
136openid.relyingparty.signinInterface.disclaimer = This site is for test purposes only and is under active development.
137openid.relyingparty.signinInterface.stfcLink = http://www.stfc.ac.uk/
138openid.relyingparty.signinInterface.stfcImage = %(openid.relyingparty.signinInterface.baseURL)s/layout/stfc-circle-sm.gif
139openid.relyingparty.signinInterface.helpIcon = %(openid.relyingparty.signinInterface.baseURL)s/layout/icons/help.png
140
141cache_dir = %(here)s/data
142
143# AuthKit Set-up
144authkit.setup.method=openid, cookie
145
146# This cookie name and secret MUST agree with the name used by the
147# Authentication Filter used to secure a given app
148authkit.cookie.name=ndg.security.auth
149
150authkit.cookie.secret=9wvZObs9anUEhSIAnJNoY2iJq59FfYZr
151authkit.cookie.signoutpath = /logout
152
153# Disable inclusion of client IP address from cookie signature due to
154# suspected problem with AuthKit setting it when a HTTP Proxy is in place
155authkit.cookie.includeip = False
156
157authkit.openid.path.signedin=/
158authkit.openid.store.type=file
159authkit.openid.store.config=%(here)s/openidrelyingparty/store
160authkit.openid.session.key = authkit_openid
161authkit.openid.session.secret = random string
162
163# Key name for dereferencing beaker.session object held in environ
164authkit.openid.session.middleware = %(beakerSessionKeyName)s
165
166authkit.openid.baseurl = %(baseURI)s
167
168# Template for signin
169#authkit.openid.template.obj =
170
171# Handler for parsing OpenID and creating a session from it
172#authkit.openid.urltouser =
173
174# Attribute Exchange - all are optional unless the relevant ax.required.<name>
175# is set to True.  The alias defers to the parameter name given unless explicity
176# specified - see commented out entry for firstName below.  The number of
177# attributes for each attribute name defaults to 1 unless otherwise set
178authkit.openid.ax.typeuri.firstName=http://openid.net/schema/namePerson/first
179#authkit.openid.ax.alias.firstName=first_name
180#authkit.openid.ax.count.firstName=1
181authkit.openid.ax.typeuri.lastName=http://openid.net/schema/namePerson/last
182authkit.openid.ax.typeuri.emailAddress=http://openid.net/schema/contact/internet/email
183#authkit.openid.ax.required.emailAddress=True
184
185
186[filter:SSLCientAuthnRedirectResponseFilter]
187# Redirect to original requested URI following SSL Client Authentication.  This
188# filter must be placed AFTER the AuthKit cookie setting middleware.  In this
189# case its configured in the OpenIDRelyingPartyMiddleware filter.  If the
190# OpenID Relying Party filter is removed, a separate AuthKit middleware entry
191# would need to be made so that this redirect filter can still function
192paste.filter_app_factory = ndg.security.server.wsgi.authn:AuthKitRedirectResponseMiddleware
193prefix = ssl.
194ssl.sessionKey = %(beakerSessionKeyName)s
195
196#______________________________________________________________________________
197# OpenID Provider WSGI Settings
198[app:OpenIDProviderApp]
199paste.app_factory=ndg.security.server.wsgi.openid.provider:OpenIDProviderMiddleware.app_factory
200
201openid.provider.path.openidserver=/OpenID/Provider/server
202openid.provider.path.login=/OpenID/Provider/login
203openid.provider.path.loginsubmit=/OpenID/Provider/loginsubmit
204
205# Yadis based discovery only - the 'id' path is configured may be set to page
206# with <link rel="openid.server" href="..."> and Yadis
207# <meta http-equiv="x-xrds-location" content="..."> links if required but in
208# this implementation it set to return 404 not found - see
209# ndg.security.server.wsgi.openid.provider.renderinginterface.buffet.BuffetRendering
210# class
211openid.provider.path.id=/OpenID/Provider/id/${userIdentifier}
212openid.provider.path.yadis=%(openIDProviderIDBase)s/${userIdentifier}
213
214# Yadis based discovery for idselect mode - this is where the user has entered
215# a URI at the Relying Party which identifies their Provider only and not their
216# full ID URI.  e.g. https://badc.nerc.ac.uk instead of
217# https://badc.nerc.ac.uk/John
218openid.provider.path.serveryadis=%(openIDProviderIDBase)s
219openid.provider.path.allow=/OpenID/Provider/allow
220openid.provider.path.decide=/OpenID/Provider/decide
221openid.provider.path.mainpage=/OpenID/Provider/home
222
223openid.provider.session_middleware=%(beakerSessionKeyName)s
224openid.provider.base_url=%(baseURI)s
225
226# Enable login to construct an identity URI if IDSelect mode was chosen and
227# no identity URI was passed from the Relying Party.  This value should
228# match openid.provider.path.id and/or openid.provider.path.yadis - see above
229identityUriTemplate=%(baseURI)s%(openIDProviderIDBase)s/${userIdentifier}
230
231openid.provider.trace=False
232openid.provider.consumer_store_dirpath=%(here)s/openidprovider
233openid.provider.renderingClass=ndg.security.server.wsgi.openid.provider.renderinginterface.genshi.GenshiRendering
234#openid.provider.renderingClass=ndg.security.server.wsgi.openid.provider.DemoRenderingInterface
235
236# Layout
237openid.provider.rendering.baseURL = %(openid.provider.base_url)s
238openid.provider.rendering.leftLogo = %(openid.provider.rendering.baseURL)s/layout/NERC_Logo.gif
239openid.provider.rendering.leftAlt = Natural Environment Research Council
240openid.provider.rendering.ndgLink = http://ndg.nerc.ac.uk/
241openid.provider.rendering.ndgImage = %(openid.provider.rendering.baseURL)s/layout/ndg_logo_circle.gif
242openid.provider.rendering.disclaimer = This site is for test purposes only and is under active development.
243openid.provider.rendering.stfcLink = http://www.stfc.ac.uk/
244openid.provider.rendering.stfcImage = %(openid.provider.rendering.baseURL)s/layout/stfc-circle-sm.gif
245openid.provider.rendering.helpIcon = %(openid.provider.rendering.baseURL)s/layout/icons/help.png
246
247# Basic Authentication interface to demonstrate capabilities
248#openid.provider.authNInterface=ndg.security.server.wsgi.openid.provider.authninterface.basic.BasicAuthNInterface
249openid.provider.authNInterface=ndg.security.server.wsgi.openid.provider.authninterface.sqlalchemy_authn.SQLAlchemyAuthnInterface
250openid.provider.authN.connectionString=%(dbConnectionString)s
251openid.provider.authN.logonSqlQuery=select count(*) from users where username = '${username}' and md5password = '${password}'
252openid.provider.authN.username2UserIdentifierSqlQuery=select openid_identifier from users where username = '${username}'
253openid.provider.authN.isMD5EncodedPwd=True
254
255# user login details format is:
256# <username>:<password>:<OpenID name>, ... <OpenID name N> <username>:... etc
257# Each user entry is delimited by a space. username, password and OpenID name
258# list are delimited by a colon.  The list of OpenID names are delimited by
259# commas.  The OpenID name represents the unique part of the OpenID URL for the
260# individual user.  Each username may have more than one OpenID alias but only
261# alias at a time may be registered with a given Attribute Authority
262openid.provider.authN.userCreds=pjk:testpassword:PhilipKershaw,P.J.Kershaw another:testpassword:A.N.Other
263
264# Basic authentication for testing/admin - comma delimited list of
265# <username>:<password> pairs
266#openid.provider.usercreds=pjk:test
267
268# Attribute Exchange interface
269#openid.provider.axResponse.class=ndg.security.server.wsgi.openid.provider.axinterface.csv.CSVFileAXInterface
270#openid.provider.axResponse.csvFilePath=%(here)s/openidprovider/attributeexchange.csv
271openid.provider.axResponse.class=ndg.security.server.wsgi.openid.provider.axinterface.sqlalchemy_ax.SQLAlchemyAXInterface
272openid.provider.axResponse.connectionString=%(dbConnectionString)s
273openid.provider.axResponse.sqlQuery = select firstname, lastname, emailaddress from users where username = '${username}'
274openid.provider.axResponse.attributeNames=http://openid.net/schema/namePerson/first
275    http://openid.net/schema/namePerson/last
276    http://openid.net/schema/contact/internet/email
277
278#______________________________________________________________________________
279# Attribute Authority WSGI settings
280#
281[filter:AttributeAuthorityFilter]
282# This filter publishes an Attribute Authority instance as a key in environ
283# to enable other middleware to access it
284paste.filter_app_factory = ndg.security.server.wsgi.attributeauthority:AttributeAuthorityMiddleware.filter_app_factory
285prefix = attributeAuthority.
286
287# Key name by which the WSDL SOAP based interface may reference this
288# service
289attributeAuthority.environKeyName = %(attributeAuthorityEnvironKeyName)s
290
291# Key name for the SAML SOAP binding based interface to reference this
292# service's attribute query method
293attributeAuthority.environKeyNameAttributeQueryInterface: %(attributeQueryInterfaceEnvironKeyName)s
294
295# Attribute Authority settings
296# 'name' setting MUST agree with map config file 'thisHost' name attribute
297attributeAuthority.name: Site A
298
299# Lifetime is measured in seconds
300attributeAuthority.attCertLifetime: 28800 
301
302# Allow an offset for clock skew between servers running
303# security services. NB, measured in seconds - use a minus sign for time in the
304# past
305attributeAuthority.attCertNotBeforeOff: 0
306
307# All Attribute Certificates issued are recorded in this dir
308attributeAuthority.attCertDir: %(testConfigDir)s/attributeauthority/sitea/attributeCertificateLog
309
310# Files in attCertDir are stored using a rotating file handler
311# attCertFileLogCnt sets the max number of files created before the first is
312# overwritten
313attributeAuthority.attCertFileName: ac.xml
314attributeAuthority.attCertFileLogCnt: 16
315attributeAuthority.dnSeparator:/
316
317# Location of role mapping file
318attributeAuthority.mapConfigFilePath: %(testConfigDir)s/attributeauthority/sitea/siteAMapConfig.xml
319
320# Settings for custom AttributeInterface derived class to get user roles for given
321# user ID
322#attributeAuthority.attributeInterface.modFilePath: %(testConfigDir)s/attributeauthority/sitea
323#attributeAuthority.attributeInterface.modName: siteAUserRoles
324#attributeAuthority.attributeInterface.className: TestUserRoles
325
326# SQLAlchemy Attribute Interface
327attributeAuthority.attributeInterface.connectionString: %(dbConnectionString)s
328attributeAuthority.attributeInterface.modName: ndg.security.server.attributeauthority
329attributeAuthority.attributeInterface.className: SQLAlchemyAttributeInterface
330attributeAuthority.attributeInterface.issuerName = /O=Site A/CN=Attribute Authority
331attributeAuthority.attributeInterface.samlSubjectSqlQuery = select count(*) from users where openid = '${userId}'
332attributeAuthority.attributeInterface.samlAttribute2SqlQuery.1 = "urn:esg:first:name" "select firstname from users where openid = '${userId}'"
333attributeAuthority.attributeInterface.samlAttribute2SqlQuery.lastName = "urn:esg:last:name" "select lastname from users where openid = '${userId}'"
334attributeAuthority.attributeInterface.samlAttribute2SqlQuery.emailAddress = "urn:esg:email:address" "select emailaddress from users where openid = '${userId}'"
335attributeAuthority.attributeInterface.samlAttribute2SqlQuery.4 = "urn:siteA:security:authz:1.0:attr" "select attributename from attributes where openid = '${userId}'"
336attributeAuthority.attributeInterface.samlValidRequestorDNs = /O=Site A/CN=Authorisation Service,/O=Site A/CN=Attribute Authority,
337                                                           /O=Site B/CN=Authorisation Service,
338                                                           /CN=test/O=NDG/OU=BADC
339
340# Config for XML signature of Attribute Certificate
341attributeAuthority.signingPriKeyFilePath: %(testConfigDir)s/attributeauthority/sitea/siteA-aa.key
342attributeAuthority.signingCertFilePath: %(testConfigDir)s/attributeauthority/sitea/siteA-aa.crt
343attributeAuthority.caCertFilePathList: %(testConfigDir)s/ca/ndg-test-ca.crt
344
345
346# SOAP WSDL Based Binding to the Attribute Authority
347[filter:AttributeAuthorityWsdlSoapBindingFilter]
348paste.filter_app_factory = ndg.security.server.wsgi.attributeauthority:AttributeAuthoritySOAPBindingMiddleware.filter_app_factory
349prefix = service.soap.binding.
350attributeAuthoritySOAPBindingPrefix = attributeauthority.service.soap.binding.
351
352service.soap.binding.referencedFilters = filter:wsseSignatureVerificationFilter
353service.soap.binding.path = /AttributeAuthority
354service.soap.binding.enableWSDLQuery = True
355service.soap.binding.charset = utf-8
356service.soap.binding.serviceSOAPBindingEnvironKeyName = ndg.security.server.wsgi.attributeauthority.AttributeAuthoritySOAPBindingMiddleware
357
358attributeauthority.service.soap.binding.attributeAuthorityEnvironKeyName = %(attributeAuthorityEnvironKeyName)s
359attributeauthority.service.soap.binding.wsseSignatureVerificationFilterID = filter:wsseSignatureVerificationFilter
360
361
362# SAML SOAP Binding to the Attribute Authority
363[filter:AttributeAuthoritySamlSoapBindingFilter]
364paste.filter_app_factory = ndg.security.server.wsgi.saml:SOAPAttributeInterfaceMiddleware.filter_app_factory
365prefix = saml.soapbinding.
366
367saml.soapbinding.pathMatchList = /AttributeAuthority/saml
368saml.soapbinding.queryInterfaceKeyName = %(attributeQueryInterfaceEnvironKeyName)s
369
370
371#______________________________________________________________________________
372# WS-Security Signature Verification
373[filter:wsseSignatureVerificationFilter]
374paste.filter_app_factory = ndg.security.server.wsgi.wssecurity:SignatureVerificationFilter.filter_app_factory
375filterID = %(__name__)s
376
377# Settings for WS-Security SignatureHandler class used by this filter
378wsseCfgFilePrefix = wssecurity
379
380# Verify against known CAs - Provide a space separated list of file paths
381wssecurity.caCertFilePathList=%(testConfigDir)s/ca/ndg-test-ca.crt
382
383
384#______________________________________________________________________________
385# Apply WS-Security Signature
386[filter:wsseSignatureFilter]
387paste.filter_app_factory = ndg.security.server.wsgi.wssecurity:ApplySignatureFilter.filter_app_factory
388
389# Reference the verification filter in order to be able to apply signature
390# confirmation
391referencedFilters = filter:wsseSignatureVerificationFilter
392wsseSignatureVerificationFilterID = filter:wsseSignatureVerificationFilter
393
394# Last filter in chain of SOAP handlers writes the response
395writeResponse = True
396
397# Settings for WS-Security SignatureHandler class used by this filter
398wsseCfgFilePrefix = wssecurity
399
400# Certificate associated with private key used to sign a message.  The sign
401# method will add this to the BinarySecurityToken element of the WSSE header. 
402wssecurity.signingCertFilePath=%(testConfigDir)s/pki/wsse-server.crt
403
404# PEM encoded private key file
405wssecurity.signingPriKeyFilePath=%(testConfigDir)s/pki/wsse-server.key
406
407# Set the ValueType for the BinarySecurityToken added to the WSSE header for a
408# signed message.  See __setReqBinSecTokValType method and binSecTokValType
409# class variable for options - it may be one of X509, X509v3, X509PKIPathv1 or
410# give full namespace to alternative - see
411# ZSI.wstools.Namespaces.OASIS.X509TOKEN
412#
413# binSecTokValType determines whether signingCert or signingCertChain
414# attributes will be used.
415wssecurity.reqBinSecTokValType=X509v3
416
417# Add a timestamp element to an outbound message
418wssecurity.addTimestamp=True
419
420# For WSSE 1.1 - service returns signature confirmation containing signature
421# value sent by client
422wssecurity.applySignatureConfirmation=True
423
424# Logging configuration
425[loggers]
426keys = root, ndg
427
428[handlers]
429keys = console
430
431[formatters]
432keys = generic
433
434[logger_root]
435level = INFO
436handlers = console
437
438[logger_ndg]
439level = DEBUG
440handlers =
441qualname = ndg
442
443[handler_console]
444class = StreamHandler
445args = (sys.stderr,)
446level = NOTSET
447formatter = generic
448
449[formatter_generic]
450format = %(asctime)s,%(msecs)03d %(levelname)-5.5s [%(name)s] %(message)s
451datefmt = %H:%M:%S
452
Note: See TracBrowser for help on using the repository browser.