How to set up the SharePoint integration
The SharePoint document management system integration enables linking files from SharePoint as policy documents or evidence in Trustero.
To enable SharePoint Document Management System Integration:
- Create an App registration. Follow the App Registration Setup Guide, setting up permissions needed for Sharepoint.
- Add Platform Configuration to the App Registration to enable the Microsoft File Picker (Optional - Only applicable for File Picker Functionality)
- Grant permissions to specific files and folders using PowerShell
- Set up SharePoint Document Management System Integration within Trustero
- Link policy documents and evidence
1. Create App Registration & Select Permissions
Follow the Trustero App Registration Setup Guide, setting up permissions needed for SharePoint.
During the app registration process where in the API permissions are being granted, the following permissions needs to be added:
Permission Name |
Type |
Description |
Usage |
Sites.Read.All |
Delegated |
Read items in all site collection |
Enables the file picker to select files that the user has access to. (Optional - Only applicable for File Picker Functionality) |
Sites.Selected |
Application |
Access selected site collection |
Grants the application access to specific sites, as permitted by administrator |
Files.SelectedOperations.Selected |
Application |
Access selected files |
Grants the application access to specific files/folders as permitted by administrator |
2. Add Platform Configuration to Microsoft File Picker
Microsoft File Picker can be used to access the files within SharePoint. This procedure enables Microsoft's File Picker to gain access from a 3rd party location (Trustero).
If you do not intend to use the File Picker to select files from SharePoint within Trustero, you may skip this section.
- In the App Registration that was created for Sharepoint, go to the Authentication Page
- Click the +Add a Platform button, select Single-page application
- In the Configure single-page application widget on the right...
- Set “https://app.trustero.com” as the redirect URI
- Check Access tokens (used for implicit flows)
- Check ID tokens (used for implicit and hybrid flows)
- Click Configure button
- Click Save button
3. Granting permissions to specific files and folders using PowerShell
With the Files.SelectedOperations.Selected permissions, the application does not access files and folders within the SharePoint Site. Azure administrator needs to manually grant permissions to selected files and folders using a PowerShell script.
To assign permissions using the PowerShell script execute the following steps:
- Obtain the PowerShell script from the following repository
- https://github.com/trustero/sharepoint
- Open the terminal in your local machine
- Execute the PowerShell script with the following parameters
./sharepoint-permission.ps1 -SiteUrl <SiteUrl> -AppId <AppId> -folderPaths <FolderPaths>
SiteUrl |
Enter the SharePoint site URL (e.g., https://yourtenant.sharepoint.com/sites/yoursite) |
AppId |
Enter the Application ID (e.g., 70d96320-e711-4e0e-94cf-53e43b557b0a) from the Azure AD App registration |
FolderPaths |
Enter list of folder paths to give permission separated by comma |
Examples:
- Single Folder
./sharepoint-permission.ps1 -SiteUrl https://yourtenant.sharepoint.com/sites/yoursite -AppId 70d96320-e711-4e0e-94cf-53e43b557b0a -folderPaths '/Folder1/SubFolder1'
- Multiple Folders
./sharepoint-permission.ps1 -SiteUrl https://yourtenant.sharepoint.com/sites/yoursite -AppId 70d96320-e711-4e0e-94cf-53e43b557b0a -folderPaths '/Folder1/SubFolder1,/Folder1/SubFolder2'
- Folders with spaces in its name
./sharepoint-permission.ps1 -SiteUrl https://yourtenant.sharepoint.com/sites/yoursite -AppId 70d96320-e711-4e0e-94cf-53e43b557b0a -folderPaths '/Folder1/Sub Folder1'
4. Sharepoint Document Management System Integration Setup in Trustero
Within Trustero, activate the Sharepoint Document Management System Integration under Integrations > Document Management
- Toggle the On / Off button for Sharepoint
- Configure it using credentials obtained from the App Registration, and click Activate
- Done! The SharePoint button should now be enabled in the Add Policy Document and Add Evidence Modals similar to the following:
5. Link Policy Documents and Evidence
Enabling the integration allows you to link policy documents and evidence from SharePoint
- Within Trustero, select the policy you would like to link to the policy document.
- Click the Add Documentation Button
- Select SharePoint as source
- Enter the selected Sharepoint file
- File Picker view:
- Paste Link view:
- File Picker view:
- After linking the file within Trustero, the document should appear under documentation
- To view the linked file, click on it. You will be redirected to SharePoint to see the files' contents.
- To modify selection of accessible files, update permissions using the script in Step 3.