I have been trying the past days to have Splunk SSO working with SimpleSAMLPHP as IdP without success.
I confirm the header X-Remote-User is well set in http://splunk_example_url.com:8000/splunk/en-US/debu/sso when I don't use SAML (so SP mellon and the IdP SimpleSAMLPHP).
Then, if I enable mellon, I am first well routed to my SimpleSAMLPHP auth IdP where I log in.
But then, it is doing a loop on the redirect to http://my_apache_splunk_proxy_example_url/splunk/, rerouting to my IdP and so on and so forth.
Did you already experience this kind of problems?
Maybe I should not even try because I haven't seen any others tutorial than for Okta, OpenAM and LDAP as SAML2 IdP.
Here is my configuration:
I have:
- Splunk 6.2.1 (CentOS): 192.168.111.10
- Apache2 2.22 and mod-auth-mellon 0.9 (Debian): 192.168.111.14 => simplesamlsample.com
- IdP: 192.168.111.2
On splunk side:
/opt/splunk/etc/system/local/server.conf
[general]
trustedIP = 192.168.111.14
/opt/splunk/etc/system/local/web.conf
[settings]
remoteUser = X-Remote-User
SSOMode = strict
tools.proxy.on = true (=> to true, even if it seems it is not necessary anymore with apache2)
trustedIP = 127.0.0.1, 192.168.111.14, 192.168.111.10
allowSsoWithoutChangingServerConf = 1
root_endpoint = /splunk
Test of Apache/Splunk connection OK
On Apache server:
/etc/apache2/available-sites/default
ServerName simplesamlsample.com
DocumentRoot /var/www/simplesamlsample.com
Require all granted
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined
RequestHeader set X-REMOTE-USER admin
Order deny,allow
Allow from all
ProxyRequests Off
ProxyPreserveHost On
ProxyPassInterpolateEnv On
ProxyPass /splunk/ http://192.168.111.10:8000/splunk/
ProxyPassReverse /splunk/ http://192.168.111.10:8000/splunk/
ProxyPassReverseCookiePath / /
I restarted and I tested this configuration without SAML2 authentication.
That means I connect to http://192.168.111.14/splunk/ and I get routed to Splunk with right X-Remote-User set (confirmed by using http://simplesamlsample.com/splunk/debug/sso url). It works like a charm.
Test with mod-auth-mellon SP and SimpleSAMLSample IdP
On Apache server:
I installed and enabled mod-auth-mellon.
Thanks to the mellon script, I have generated the certs and metadata for my SP. My metadata:
./mellon_create_metadata.sh urn:splunkweb:simplesamlsample.com http://simplesamlsample.com/secret/endpoint
I modified the endpoint to have the splunk endpoint:
http://simplesamlsample.com/splunk/
// instead of http://simplesamlsample.com/secret/endpoint/
<EntityDescriptor entityID="urn:splunkweb:simplesamlsample.com" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<KeyDescriptor use="signing">…</KeyDescriptor>
<SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://simplesamlsample.com/splunk/"/>
<AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://simplesamlsample.com/splunk/" index="0"/>
</SPSSODescriptor>
</EntityDescriptor>
and then, I’ve submitted the SP metadata to the IdP and I copied these files in the dir I’ve created /etc/apache2/mellon/ with right access ok. In addition to that, I copied my SimpleSAMLPHP IdP's metadata in the same directory as idp-metadata.xml.
I added the mellon configuration to apache2:
/etc/apache2/available-sites/default
<VirtualHost simplesamlsample.com:80>
ServerName simplesamlsample.com
DocumentRoot /var/www/simplesamlsample.com
<Directory /var/www/simplesamlsample.com>
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined
RequestHeader set X-REMOTE-USER admin
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPreserveHost On
ProxyPassInterpolateEnv On
ProxyPass /splunk/ http://192.168.111.10:8000/splunk/
ProxyPassReverse /splunk/ http://192.168.111.10:8000/splunk/
ProxyPassReverseCookiePath / /
MellonCacheSize 100
MellonLockFile "/var/lock/mod_auth_mellon/lock"
<Location />
# Add information from the auth_mellon session to the request.
MellonEnable "auth"
Require valid-user
AuthType "Mellon"
MellonVariable "mellon-cookie"
MellonSamlResponseDump On
# Configure the SP metadata
# This should be the files which were created when creating SP metadata.
MellonSPPrivateKeyFile /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.key
MellonSPCertFile /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.cert
MellonSPMetadataFile /etc/apache2/mellon/urn_splunkweb_simplesamlsample.com.xml
# IdP metadata. This should be the metadata file you downloaded from the IdP.
MellonIdPMetadataFile /etc/apache2/mellon/idp-metadata.xml
#MellonUser "email"
# this is the property coming on the SAML assertion set as REMOTE_USER
# MellonUser "username"
# The location all endpoints should be located under.
# It is the URL to this location that is used as the second parameter to the metadata generation script.
# This path is relative to the root of the web server.
MellonEndpointPath /mellon
# Options +FollowSymLinks
RequestHeader set X-REMOTE-USER admin #=> Trying this way first
</Location>
</VirtualHost>
Then, I restarted the apache server. I am well routed to the IdP when I open http://simplesamlsample.com. I do the authentication on it and then I am routed to the address http://simplesamlsample.com/splunk/. For now, I don’t care the attributes I get. That’s why I set X-Remote-User with a supposed to be working hardcoded value.
Unfortunately, after logging on the IdP, I get rerouted to the IdP authentication already done so then the security warning (because still no https). I have an infinite loop on the warning screen.
Would you have an idea?
Thanks.
... View more