Difference between revisions of "Papercut"

From Studentnet Wiki
Jump to navigation Jump to search
Line 56: Line 56:
 
</InProcess></code>
 
</InProcess></code>
  
'''NOTE:''' If you are running Shibboleth V3 then an additional entry needs to be put into the code above. V3 requires the command useHeaders="true". Therefore, if you are implementing a Shibboleth V3 configuration, please use  
+
'''NOTE:''' If you are running Shibboleth V3 then an additional entry needs to be put into the code above. V3 requires the command useHeaders="true". Therefore, if you are implementing a Shibboleth V3 configuration, please use the code below instead, which has the useHeaders=“true” command added.
 +
 
 +
<code>
 +
<InProcess logger="native.logger">
 +
 
 +
<ISAPI normalizeRequest="true" safeHeaderNames="true">
 +
 
 +
<Site id="1" name="iis.domain.vm" scheme="https" port="443" useHeaders="true" />
 +
 
 +
</ISAPI> </InProcess>
 +
 
 +
</code>
 +
 
 +
 
 +
=== Update RequestMapper ===
 +
 
 +
The RequestMapper tells IIS which Paths for a certain host need to use Shibboleth for authentication. We are going to use “user” for ours so any user going to host/user will need to be logged in if not they will be taken to the login page. If you wanted to add /admin to this, you can just copy and paste the user line and replace user with admin.
 +
 
 +
<code>
 +
<RequestMapper type="Native">
 +
 
 +
<RequestMap>
 +
 
 +
<Host name="iis.domain.vm">
 +
 
 +
<Path name="secure"authType="shibboleth"requireSession="true">
 +
 
 +
<Path name="user"authType="shibboleth"requireSession="true"/>
 +
 
 +
</Host> </RequestMap> </RequestMapper>
 +
 
 +
</code>
 +
 
 +
=== Update ApplicationDefaults ===
 +
 
 +
The ApplicationDefaults will set the remote_user variable which will contain the headers we want to set we will want to make sure we include ppcuser here as that is what we will use in the PaperCut MF configuration for Web Auth.
 +
 
 +
<code>
 +
<ApplicationDefaults entityID="https://iis.domain.vm/shibboleth"
 +
REMOTE_USER="eppn persistent-id targeted-id ppcuser"   
 +
cipherSuites="ECDHE+AESGCM:ECDHE:!aNULL:!eNULL:!LOW:!EXPORT:!RC4:!SHA:!SSLv2">
 +
</code>
 +
 
 +
=== Update SSO ===
 +
 
 +
The SSO section contains the location of our Identity Provider which will be your Federation Service Name followed by /adfs/services/trust.
 +
 
 +
<code>
 +
<SSO entityID="http://fs.domain.vm/adfs/services/trust"
 +
discoveryProtocol="SAMLDS" discoveryURL="https://ds.example.org/DS/WAYF">
 +
SAML2 SAML1
 +
</SSO>
 +
</code>
 +
 
 +
=== Add automatic metadata fetching ===
 +
 
 +
There are 2 ways you can load the metadata for your identity provider the first is from a local file which you would need to manually update if you ever make changes to it and the other is by using a URL which will automatically grab the metadata as needed and will make life easier later. This URL is going to be your Federation Service Name followed by /federationmetadata/2007–06/federationmetadata.xml
 +
 
 +
<code>
 +
<MetadataProvider type="XML" url="https://fs.domain.vm/federationmetadata/2007-06/federationmetadata.xml"/>
 +
</code>
 +
 
 +
=== Open attribute-map.xml ===
 +
 
 +
Now we need to tell Shibboleth where it can find the value we want to set to ppcuser, We used the Windows Account Name option in the claims issuance so that is what we will set here.
 +
 
 +
<code>
 +
<Attribute name="http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname" id="ppcuser"/>
 +
</code>
 +
 
 +
=== Restart Shibboleth ===
 +
 
 +
You have 2 ways to do this, either load up Services Manager (services.msc) and find Shibboleth 2 Daemon and click restart or open a command prompt window and run:
 +
 
 +
<code>
 +
net stop shibd_default
 +
net start shibd_default
 +
</code>
 +
 
 +
=== IIS Configuration (Proxy) ===
 +
 
 +
The only thing left to do now is to setup IIS to act as a proxy to do this we will the IIS ARR (Application Request Routing) module which can be found here: https://www.iis.net/downloads/microsoft/application-request-routing
 +
 
 +
Once installed we will need to enable the Proxy option, Open IIS Manager and select the local server from the tree on the left then find '''Application Request Routing Cache.'''
 +
*On the right select '''Server Proxy Settings'''
 +
*Check the Enable Proxy checkbox and click Apply on the right
 +
*Select your site on the left and click on '''URL Rewrite'''.
 +
*Click '''Add Rules''' on the right and pick '''Blank Rule''' from under '''Inbound rules.'''
 +
*The first rule to create is one to ignore any requests that come in to [FQDN]/Shibboleth.sso/ as we don’t want to block any of the Shibboleth functions.
 +
*#Give your rule a name and set the '''Requested URL''' to '''Matches the Pattern''' and set '''Using''' to '''Regular Expression'''.
 +
*#Set the Pattern to '''Shibboleth.sso/.*'''
 +
*#Check the '''Ignore case”''' checkbox
 +
*#Set the '''Action type''' at the bottom to '''None'''
 +
*#Check '''Stop Processing''' of subsequent rules.
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
  
 
[[Category:Single Sign On Services]]
 
[[Category:Single Sign On Services]]

Revision as of 00:20, 15 August 2019

PaperCut is a print and copy output management software

Setup

Background

There are a number of places where PaperCut authenticates users, which occurs before the document is printed, at the time of printing and after printing. Before printing:

  • Administrate PaperCut or view reports through the admin web interface
  • End users visit the user web interface to submit web print jobs, view statistics and top up their account for example.
  • Identify the owner of a print job, whether they print from a managed, shared or self managed BYOD device

At the time of printing:

  • Authenticate the user at the release station, through methods like username and password, card swipe, two factor authentication with card and pin or even biometric options.

Add accountability to the document forever:

Optionally apply a watermark / digital signature to all pages, which adds an encrypted HMAC signature to the page which can be traced back to the user who printed the document. When authenticating users, PaperCut interfaces directly with directory services like Active Directory or LDAP. Additionally, you can also configure single sign-on on the admin web interface and user web interface, where PaperCut will rely on an external SAML service for authentication.

IIS Configuration (Shibboleth)

If you have not already done so install IIS onto either the PaperCut Application Server or a different server. If you install IIS onto the PaperCut Application Server make sure you have not configured PaperCut MF to use port 80 or 443 and make sure you don’t tell IIS to use any of the standard PaperCut ports (9191, 9192, 9193).

You will need to make sure that you have ISAPI Extensions and ISAPI Filters installed on IIS which can both be found under Add Server Roles > Web Server (IIS) > Web Server > App Development

Cloudwork Configuration

Download the metadata from here enter the FQDN for your IIS Server followed by /Shibboleth.sso/Metadata (For iis.domain.vm the URL would be iis.domain.vm/Shibboleth.sso/Metadata) and then upload the XML file

Edit Claim Issuance Policy

Right click the Party Trust and select Edit Claim Insurance Policy and choose the best suiting rule template.

Select the AD attribute to send back and what type of outgoing claim type to set this to. Give the claim a name and select Active Directory from the Attribute store. Under LDAP Attribute select SAM-Account-Name and set the Outgoing type to Windows Account Name.

Finish

Shibboleth Installation & Configuration

Download the latest version of Shibboleth from: https://shibboleth.net/downloads/service-provider/latest/ and install it using the default options. All files will be found under [C:\opt\shibboleth-sp\etc\shibboleth]

Open shibboleth2.xml with a text editor

Edit InProcess so we use the correct IIS site

We need to change the site name. This will be the Fully Qualified Domain Name (FQDN) that your users connect to.

<InProcess logger="native.logger">

<ISAPI normalizeRequest="true" safeHeaderNames="true">

<Site id="1" name="iis.domain.vm" scheme="https" port="443"/>

</ISAPI> </InProcess>

NOTE: If you are running Shibboleth V3 then an additional entry needs to be put into the code above. V3 requires the command useHeaders="true". Therefore, if you are implementing a Shibboleth V3 configuration, please use the code below instead, which has the useHeaders=“true” command added.

<InProcess logger="native.logger">

<ISAPI normalizeRequest="true" safeHeaderNames="true">

<Site id="1" name="iis.domain.vm" scheme="https" port="443" useHeaders="true" />

</ISAPI> </InProcess>


Update RequestMapper

The RequestMapper tells IIS which Paths for a certain host need to use Shibboleth for authentication. We are going to use “user” for ours so any user going to host/user will need to be logged in if not they will be taken to the login page. If you wanted to add /admin to this, you can just copy and paste the user line and replace user with admin.

<RequestMapper type="Native">

<RequestMap>

<Host name="iis.domain.vm">

<Path name="secure"authType="shibboleth"requireSession="true">

<Path name="user"authType="shibboleth"requireSession="true"/>

</Host> </RequestMap> </RequestMapper>

Update ApplicationDefaults

The ApplicationDefaults will set the remote_user variable which will contain the headers we want to set we will want to make sure we include ppcuser here as that is what we will use in the PaperCut MF configuration for Web Auth.

<ApplicationDefaults entityID="https://iis.domain.vm/shibboleth" REMOTE_USER="eppn persistent-id targeted-id ppcuser" cipherSuites="ECDHE+AESGCM:ECDHE:!aNULL:!eNULL:!LOW:!EXPORT:!RC4:!SHA:!SSLv2">

Update SSO

The SSO section contains the location of our Identity Provider which will be your Federation Service Name followed by /adfs/services/trust.

<SSO entityID="http://fs.domain.vm/adfs/services/trust" discoveryProtocol="SAMLDS" discoveryURL="https://ds.example.org/DS/WAYF"> SAML2 SAML1 </SSO>

Add automatic metadata fetching

There are 2 ways you can load the metadata for your identity provider the first is from a local file which you would need to manually update if you ever make changes to it and the other is by using a URL which will automatically grab the metadata as needed and will make life easier later. This URL is going to be your Federation Service Name followed by /federationmetadata/2007–06/federationmetadata.xml

<MetadataProvider type="XML" url="https://fs.domain.vm/federationmetadata/2007-06/federationmetadata.xml"/>

Open attribute-map.xml

Now we need to tell Shibboleth where it can find the value we want to set to ppcuser, We used the Windows Account Name option in the claims issuance so that is what we will set here.

<Attribute name="http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname" id="ppcuser"/>

Restart Shibboleth

You have 2 ways to do this, either load up Services Manager (services.msc) and find Shibboleth 2 Daemon and click restart or open a command prompt window and run:

net stop shibd_default net start shibd_default

IIS Configuration (Proxy)

The only thing left to do now is to setup IIS to act as a proxy to do this we will the IIS ARR (Application Request Routing) module which can be found here: https://www.iis.net/downloads/microsoft/application-request-routing

Once installed we will need to enable the Proxy option, Open IIS Manager and select the local server from the tree on the left then find Application Request Routing Cache.

  • On the right select Server Proxy Settings
  • Check the Enable Proxy checkbox and click Apply on the right
  • Select your site on the left and click on URL Rewrite.
  • Click Add Rules on the right and pick Blank Rule from under Inbound rules.
  • The first rule to create is one to ignore any requests that come in to [FQDN]/Shibboleth.sso/ as we don’t want to block any of the Shibboleth functions.
    1. Give your rule a name and set the Requested URL to Matches the Pattern and set Using to Regular Expression.
    2. Set the Pattern to Shibboleth.sso/.*
    3. Check the Ignore case” checkbox
    4. Set the Action type at the bottom to None
    5. Check Stop Processing of subsequent rules.