> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/m/microsoft-sharepoint-policies.md).

# Microsoft Sharepoint Policies

This adapter reads one SharePoint list through Microsoft Graph and turns each row into a policy or firewall rule record.

## Use cases

* List the policy records that come from your SharePoint list.

```
Adapters = microsoft-sharepoint-policies
```

## Before you begin

### Network

| Source              | Destination               | Port | Protocol |
| ------------------- | ------------------------- | ---- | -------- |
| OctoXLabs connector | login.microsoftonline.com | 443  | HTTPS    |
| OctoXLabs connector | graph.microsoft.com       | 443  | HTTPS    |

### Required permissions

| Scope or role                                 | Permission | Needed for                                                      |
| --------------------------------------------- | ---------- | --------------------------------------------------------------- |
| Sites.Read.All (Microsoft Graph, application) | Read       | Reading the SharePoint site and list items                      |
| Files.Read.All (Microsoft Graph, application) | Read       | Listed in the frontend instructions for the SharePoint adapters |

The permission list comes from the frontend instructions of the SharePoint adapters.

## Create credentials in Microsoft Sharepoint Policies

{% stepper %}
{% step %}

### Register an application

Sign in to the Azure Portal as an administrator, open Azure Active Directory and select App registrations > New registration. Fill in the details and select Register. The Application (client) ID and Directory (tenant) ID are shown.
{% endstep %}

{% step %}

### Create a client secret

Select Certificates & Secrets > New client secret. Select Add and copy the generated secret value at once.
{% endstep %}

{% step %}

### Add API permissions

Select API Permissions > Add a permission > Microsoft Graph > Application permissions. Add Sites.Read.All and Files.Read.All.
{% endstep %}

{% step %}

### Grant admin consent

Select Grant admin consent.
{% endstep %}

{% step %}

### Find the list address

Your list URL has the form `https://SharepointDomain/FolderType/YourSite/Lists/ListName`. You need the domain, folder type, site address and list name from it.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
These SharePoint adapters read one SharePoint list. Each list row becomes one asset. You tell OctoXLabs which list column holds each field. Enter column names without spaces. Columns you do not map stay available as adapter specific data under their display names.
{% endhint %}

## Connection parameters

| Parameter                                               | Required | Type    | Default | Description                                                                                           |
| ------------------------------------------------------- | -------- | ------- | ------- | ----------------------------------------------------------------------------------------------------- |
| Tenant ID (`tenant_id`)                                 | Yes      | String  |         | Directory (tenant) ID.                                                                                |
| Client ID (`client_id`)                                 | Yes      | String  |         | Application (client) ID.                                                                              |
| Client Secret (`client_secret`)                         | Yes      | String  |         | Client secret value.                                                                                  |
| Sharepoint Domain (`sharepoint_domain`)                 | Yes      | String  |         | Host name of the site collection, for example `yourtenant.sharepoint.com`.                            |
| Folder Type (`folder_type`)                             | Yes      | String  |         | Folder type of the site collection, for example `personal` or `marketing`.                            |
| Site Address (`site_address`)                           | Yes      | String  |         | Server-relative path of the site, for example `your_site_com`.                                        |
| List Name (`list_name`)                                 | Yes      | String  |         | Name of the list. It is the last part of the list URL.                                                |
| SSL (`is_secure`)                                       | No       | Boolean | True    | Use HTTPS for the token request.                                                                      |
| Timeout (`timeout`)                                     | No       | Integer | 30      | Seconds to wait for API responses.                                                                    |
| Policy Type Field (`policy_type_field`)                 | Yes      | String  |         | List column that holds the policy type.                                                               |
| Policy ID Field (`policy_id_field`)                     | No       | String  | id      | List column that identifies each policy.                                                              |
| Rule Name Field (`rule_name_field`)                     | No       | String  |         | List column for the rule name.                                                                        |
| Source Address Field (`source_address_field`)           | No       | String  |         | List column for source addresses. Comma separated values are split. `any` or `all` means any address. |
| Destination Address Field (`destination_address_field`) | No       | String  |         | List column for destination addresses. Same rules as the source.                                      |
| Direction Field (`direction_field`)                     | No       | String  |         | List column for the direction.                                                                        |
| Action Field (`action_field`)                           | No       | String  |         | List column for the action.                                                                           |
| Status Field (`status_field`)                           | No       | String  |         | List column for the status.                                                                           |
| Description Field (`description_field`)                 | No       | String  |         | List column for the description.                                                                      |

## Troubleshooting

| Error message | Cause | Fix                                    |
| ------------- | ----- | -------------------------------------- |
| Not verified  |       | No adapter-specific error text in code |

## Change history

{% hint style="info" %}
Available starting from version 6.9.1.
{% endhint %}
