Microsoft Office 365 Connector

SaaS Detection and Response (SaaSDR) enables you to understand the compliance posture of your SaaS applications. For Office 365, you can validate your environment against CIS controls using SaaSDR.  

The Center for Internet Security (CIS) has published CIS benchmarks for O365 that can be validated using SaaSDR. Several of these controls can only be validated using PowerShell commands executed in your Azure environment. To accomplish this, you also need to install the PowerShell Module (PM) in your Azure environment as mentioned in Step 4.


1) The instructions involve running a script that uses the Azure CLI. Please make sure you have the  Azure CLI v 2.32.0 installed.

    To download Azure CLI, click here.

2) For Windows, ensure you have a bash terminal installed, for example Cygwin. This is used to execute the script to complete the install. 

3) An active paid subscription of Microsoft Azure to create a serverless deployment containing following resources-

- Azure Function App

- Azure Storage Account

- Azure Key Vault

All these resources would be created in a separate Azure resource group for easy management.

4) Ensure LegacyAuthProtocolsEnabled is enabled (enabled by default from Microsoft) for Office 365 Sharepoint Online. It can be enabled through UI or using powershell command.

a. Steps for enabling legacy auth from UI are as follows:

1) Login to Microsoft 365 Admin Center as a Global Administrator.

2) Go to Admin Centers > SharePoint.

3) Expand the Policies and select Access Control.

4) Select the applications that do not use modern authentication.

5) Select the  Allow Access radio button and click Save.

Disabling Legacy Auth

b. Steps for enabling legacy auth using powershell command are as follows:

1) Connect to SPOService, example Connect-SPOService - Url <> -credential <>

Note: Data inside <...> for URL and the credential should be replaced as per the requirement.

2) Set SPOTenant as LegacyAuthProtocolsEnabled $True


Follow these steps to create a Office 365 Connector:

1) Create Azure Resources

2) Create Connector in SaaSDR with Office 365 as application

Create Azure Resources

1) Download the file by clicking here. This file contains the required code for the Azure functions that validate individual controls as well as the script to be executed (

2) Unzip the file that you downloaded in a temp folder.

3) Open Bash Terminal.

4) Execute the script as - sh

5) Enter O365 domain you wish to scan and the admin user credentials. Prerequisites for the user are:  

a. User must have the following permissions -

- Global Reader

- Compliance Admin

- Teams Administrator

- Privileged Role Administrator

b. Must have MFA disabled. This is required because not all powershell modules support alternate/modern way of authentication.

Note: To disable the MFA for the user go to Azure Active Directory > Users > "Per-user MFA" feature.

Per-use MFA

Ensure that for all the MFA policies in the organization, this user is excluded from enabling the MFA policy.

6) Select the Qualys Cloud Platform Number from the displayed list. You can find this number where Customer’s subscription has been enabled.

Cloud Platform Cloud

You will be redirected to a browser window where you can login to Microsoft Azure portal.

7) Login using an admin user with “Global Administrator” role to an active paid subscription of Microsoft Azure.

8) Once you are logged in, choose a required option from the list of the displayed subscriptions.

Subscriptions List

9) Choose the region in which the functions need to be installed.

Region Selection

10) After all the resources are created, uploading of the functions is initiated. This step will take about 10-15 minutes. Please do not stop this upload.

Uploading Functions

11) Once the functions are uploaded, the Application ID, Application Key, Function Name and Function Key are displayed at the console.

Application ID and Key, Function Name and Key

12) Once app deployment is successful, go to the Azure portal ( to grant consent for the required permissions.

i) Go to Azure Active Directory > App registrations

ii) Select the registered app

iii) Go to API permissions and click Grant admin consent for Qualys

Grant Access

Create Connector in SaaSDR with Office 365 as application

1) On the SaaSDR UI, go to Configuration > Connectors and click Create Connector.

2) On the Create Connector page, select Office 365 from the SaaS drop-down menu.

3) Provide the Application Id, Application Key, Function Name and Function Key received in the previous steps.

 Create Connector

4) Click Create Connector.

You will be redirected to the login page of the application where you need to login using your administrator credentials (This user must be a Global Administrator to be able to Grant Access to newly created application). Once your connector is created, it is listed in the Configurations > Connectors list. Here you can check the status and other details of the connector.

That's it!

Once the application is connected, a scan is initiated to pull metadata from the application. This step may take some time to complete based on the number of resources to be catalogued in your application.