|
1 | 1 | # Zero Trust Proxy Configurtion |
2 | 2 |
|
3 | | -The first change is in `/etc/shibboleth/shibboleth2.xml` |
| 3 | +To get an overview of what we will be working with later we start in `/etc/shibboleth/shibboleth2.xml` (no changes needed here) |
| 4 | + |
| 5 | +- Here in the `ApplicationDefaults` section we have configured the policy that determines what our `REMOTE_USER` value will be as it flows through the proxy. The current set up is to check for eppn, then persistent-id, then finally targeted-id and then assign it to `REMOTE_USER`. |
4 | 6 |
|
5 | 7 |  |
6 | 8 |
|
7 | | -- Here in the `ApplicationDefaults` section we configure the policy that determines what our `REMOTE_USER` value will be as it flows through the proxy. The current set up is to check for eppn, then persistent-id, then finally targeted-id and then assign it to `REMOTE_USER`. |
8 | 9 |
|
9 | | -Our next change is in to `/etc/shibboleth/attribute-map.xml` |
10 | | - |
| 10 | + |
| 11 | +Next we will look at `/etc/shibboleth/attribute-map.xml` |
11 | 12 |
|
12 | 13 | - In this file we can configure how the eppn value is decoded. In the current configuration we have left it as scoped but its possible to transform it into a simple string value as well |
13 | 14 |
|
| 15 | + |
| 16 | + |
| 17 | + |
14 | 18 | Here in `/etc/shibboleth/attribute-policy.xml` there are a few more change points |
15 | | - |
16 | 19 |
|
17 | 20 | - First is the highlighted section showing the eppn. We currently have the `PermitValueRule` set to `basic:ANY` to allow the value to flow through simply as it is. Previously we were using the `PermitValueRuleReference ScopingRules` which can be seen towards the top of the screenshot, this policy defines what an acceptable value is for the rules that reference it. |
18 | 21 |
|
| 22 | +```diff |
| 23 | +<afp:AttributeRule attributeID="eppn"> |
| 24 | ++ <afp:PermitValueRule xsi:type="basic:ANY" /> |
| 25 | +</afp:AtttributeRule> |
| 26 | + |
| 27 | + <afp:AttributeRule attributeID="eppn"> |
| 28 | +- <afp:PermitValueRuleReference ref="ScopingRules" /> |
| 29 | + </afp:AtttributeRule> |
| 30 | +``` |
| 31 | + |
| 32 | + |
19 | 33 | In `/etc/httpd/conf.d/front-end.conf` we have a completely new entry |
20 | | - |
21 | 34 |
|
22 | 35 | - From the top we set a wide-open location match that will allow the application behind the proxy to be able to easily check back in with the proxy for each request (applying a zero trust-esque flow). In the auth section below we set up this location to require shibboleth and currently let the application handle what to do with an unauthorized user. |
23 | 36 |
|
24 | 37 | - In the next block we preform one of two different regex matches depending on if a user has a BlazerID or if they are a XIAS user. Then we update REMOTE_USER and send it back down to the application |
| 38 | + |
| 39 | +```diff |
| 40 | ++<LocationMatch "/.*"> |
| 41 | ++ AuthType shibboleth |
| 42 | ++ ShibRequestSetting requireSession false |
| 43 | ++ Require shibboleth |
| 44 | ++ ShibUseHeaders On |
| 45 | + |
| 46 | ++ #these lines match know EPPNs |
| 47 | ++ #Matches a standard BlazerId |
| 48 | ++ RewriteCond %{LA-U:REMOTE_USER} ^([a-zA-Z1-0_.+-]+@uab.edu)$ [OR] |
| 49 | ++ #Matches a xias account with the @uab domain at the end |
| 50 | ++ RewriteCond %{LA-U:REMOTE_USER} ^(.*@[^@]*?)@uab.edu$ |
| 51 | ++ RewriteRule . - [E=REMOTE_USER%1] |
| 52 | + |
| 53 | ++ #this section applies the changes we have made above to the REMOTE_USER value that we send downstream |
| 54 | ++ RequestHeader set REMOTE_USER "expr=%{ENV:REMOTE_USER}" |
| 55 | ++ RequestHeader set X-Forwarded-Scheme http |
| 56 | ++ |
| 57 | ++ #these are placeholder values, for an actual application we would simply insert the ip/dns entry for the application itself |
| 58 | ++ ProxyPass http://login001/ |
| 59 | ++ ProxyPassReverse http://login001/ |
| 60 | ++</LocationMatch> |
| 61 | +</VirtualHost> |
| 62 | +``` |
0 commit comments