From e69e92a6d5d033d1a699a82c22559e6c5e4b976f Mon Sep 17 00:00:00 2001 From: John Gasper Date: Mon, 2 Jul 2018 16:32:42 -0700 Subject: [PATCH] Adding sample SP app that dumps SP attributes. --- README.md | 4 +- base/Dockerfile | 6 +- .../httpd/grouper-testapp.conf | 11 ++ base/container_files/httpd/grouper-www.conf | 1 - .../shibboleth-idp/conf/attribute-filter.xml | 34 ++++- .../conf/attribute-resolver.xml | 28 ++-- .../shibboleth-sp/attribute-map.xml | 141 ++++++++++++++++++ .../container_files/var-www-html/app/index.py | 18 +++ 8 files changed, 223 insertions(+), 20 deletions(-) create mode 100644 base/container_files/httpd/grouper-testapp.conf create mode 100644 base/container_files/shibboleth-sp/attribute-map.xml create mode 100644 base/container_files/var-www-html/app/index.py diff --git a/README.md b/README.md index 25ad6b1..0f68184 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ docker run -d -p 80:80 -p 389:389 -p 443:443 -p 3306:3306 -p 4443:4443 \ --name grouper tier/grouper_training_ex###:latest ``` -Browse to `https://localhost/grouper` +Browse to `https://localhost/grouper` for Grouper. There is also an app that dumps the SP user attributes at `https://localhost/app`. # Users - `banderson`/`password`: Grouper Administrator - `jsmith`/`password`: standard user -- additional users can be found in \ No newline at end of file +- additional users can be found in diff --git a/base/Dockerfile b/base/Dockerfile index 4984daf..7d4f9e3 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -68,7 +68,7 @@ RUN (/usr/sbin/slapd -h "ldap:/// ldaps:/// ldapi:///" -u ldap &) \ COPY --from=idp /opt/shibboleth-idp/ /opt/shibboleth-idp/ COPY container_files/conf/ /opt/grouper/conf/ -COPY container_files/httpd/grouper-www.conf /etc/httpd/conf.d/ +COPY container_files/httpd/* /etc/httpd/conf.d/ COPY container_files/shibboleth-idp/ /opt/shibboleth-idp/ COPY container_files/shibboleth-sp/* /etc/shibboleth/ COPY container_files/tomcat/ /opt/tomcat/ @@ -77,10 +77,12 @@ COPY container_files/tls/host-key.pem /etc/pki/tls/private/ COPY container_files/tls/* /etc/pki/tls/certs/ COPY container_files/ui/* /opt/grouper/grouper.ui/WEB-INF/ COPY container_files/usr-local-bin/* /usr/local/bin/ +COPY container_files/var-www-html/ /var/www/html/ RUN cp /opt/tier-support/grouper.xml /opt/tier-support/grouper-ws.xml /opt/tomcat/conf/Catalina/localhost/ \ && chown -R tomcat /opt/shibboleth-idp/ \ - && chmod -R 700 /opt/shibboleth-idp/ + && chmod -R 700 /opt/shibboleth-idp/ \ + && chmod +rx /var/www/html/app/index.py EXPOSE 389 3306 4443 diff --git a/base/container_files/httpd/grouper-testapp.conf b/base/container_files/httpd/grouper-testapp.conf new file mode 100644 index 0000000..ccec3ab --- /dev/null +++ b/base/container_files/httpd/grouper-testapp.conf @@ -0,0 +1,11 @@ + + AuthType shibboleth + ShibRequestSetting requireSession 1 + ShibRequireSession on + require shibboleth + + Options +ExecCGI + AddHandler cgi-script .py + + DirectoryIndex index.py + \ No newline at end of file diff --git a/base/container_files/httpd/grouper-www.conf b/base/container_files/httpd/grouper-www.conf index 65dd77c..3d30d2e 100644 --- a/base/container_files/httpd/grouper-www.conf +++ b/base/container_files/httpd/grouper-www.conf @@ -10,6 +10,5 @@ ProxyPass /idp ajp://localhost:8009/idp timeout=2400 AuthType shibboleth ShibRequestSetting requireSession 1 ShibRequireSession on - ShibUseHeaders On require shibboleth \ No newline at end of file diff --git a/base/container_files/shibboleth-idp/conf/attribute-filter.xml b/base/container_files/shibboleth-idp/conf/attribute-filter.xml index 62000f1..8e0e88f 100644 --- a/base/container_files/shibboleth-idp/conf/attribute-filter.xml +++ b/base/container_files/shibboleth-idp/conf/attribute-filter.xml @@ -21,11 +21,35 @@ + + + + + + + + + + + + + + + + - + + + + + + + + + @@ -33,5 +57,13 @@ + + + + + + + + diff --git a/base/container_files/shibboleth-idp/conf/attribute-resolver.xml b/base/container_files/shibboleth-idp/conf/attribute-resolver.xml index a907b19..33607fc 100644 --- a/base/container_files/shibboleth-idp/conf/attribute-resolver.xml +++ b/base/container_files/shibboleth-idp/conf/attribute-resolver.xml @@ -41,7 +41,7 @@ - + - + - + - + - + - - + + - + diff --git a/base/container_files/shibboleth-sp/attribute-map.xml b/base/container_files/shibboleth-sp/attribute-map.xml new file mode 100644 index 0000000..067221b --- /dev/null +++ b/base/container_files/shibboleth-sp/attribute-map.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/container_files/var-www-html/app/index.py b/base/container_files/var-www-html/app/index.py new file mode 100644 index 0000000..acd092f --- /dev/null +++ b/base/container_files/var-www-html/app/index.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*-# enable debugging +import cgitb +import os + +cgitb.enable() + +print("Content-Type: text/html;charset=utf-8") +print("\n") +print("User Attributes") +print("

SP Logout

") + +for k, v in sorted(os.environ.items()): + if k == "REMOTE_USER" or k.startswith('Shib') or not k[0].isupper(): + print "%s = %s
" % (k, v) + +print("

* This list is a filtered list of environment variables containing the Shibboleth SP attributes.

") +print("") \ No newline at end of file