Providing website links via Casper Self Service policies
It’s often useful to provide a way for everyone in your shop to be able to look up commonly used websites. Methods I’ve seen of doing this include:
- Wiki pages
- Bookmarks deployed to browsers
- Browser extensions
Another method is to use Casper’s Self Service plug-ins feature.
This makes it easy to set up website bookmarks, which then appear in a sidebar of Self Service.
The main drawback to this method is you can’t scope these bookmarks to appear only to certain users or computers. These will appear on on all managed computers and to all users. If you need to have one set of bookmarks available to Group A in your organization, and a different set of bookmarks appearing to Group B, the Self Service plug-ins feature may not be the best solution.
Fortunately, you can solve this scoping issue using Casper policies and Self Service. For more details, see below the jump.
To help address this issue in my own shop, I wanted to be able to do the following:
- Provide a way to opening a website page from Self Service
- Open the website using the logged-in user’s default web browser
- Open the browser using the logged-in user’s privileges, even if the script itself is being run as root.
To accomplish this, I wrote a script which uses launchctl to open the browser using the logged-in user’s privileges, and uses the best launchctl method for the customer’s version of OS X or macOS. It also is designed to use Casper’s Parameter 4 ($4) value for the website address, which allows the script to be used by multiple policies to open the policy’s desired website.
The script is available below, and is also available from my GitHub repo:
From there, I uploaded the script to Casper:
As part of adding the script to Casper, I set the script’s parameter label for Parameter 4 to the following:
Once the script has been added to Casper, you can set up a Self Service policy in Casper to use the script and provide the appropriate website address:
Once the policies are built, the policy should be available in Self Service for your customers to access.