

# Connecting GitHub and SharePoint in AWS Assurance

With AWS Assurance evidence connections, you can connect GitHub repositories and SharePoint sites to an environment and use their documents as evidence. You might use a security policy in a GitHub repository or an access review record in a SharePoint site. AWS Assurance evaluates the version of each document that you link. To use a newer version, add the document again.

You give AWS Assurance read-only access through the connection. When you remove a connection, you keep the evidence that you added through it.

In an organization environment, you add and remove connections from the management account or the delegated administrator account.

You can also connect an Amazon S3 bucket that you own in the same **Connections** section, and then reference objects in it as evidence. For more information, see [Connecting an Amazon S3 bucket as an evidence source](evidence-management.md#evidence-management-s3-sources).

**Topics**
+ [Granting AWS Assurance access to your GitHub repositories](#third-party-connections-github)
+ [Connecting SharePoint to AWS Assurance](#third-party-connections-sharepoint)
+ [Connecting GitHub or SharePoint to AWS Assurance programmatically](#third-party-connections-api)
+ [Using a GitHub or SharePoint document as evidence](#third-party-connections-evidence)
+ [Removing a GitHub or SharePoint connection](#third-party-connections-remove)
+ [Resolving errors with GitHub and SharePoint evidence connections](#third-party-connections-troubleshooting)

## Granting AWS Assurance access to your GitHub repositories
<a name="third-party-connections-github"></a>

Connect GitHub so that AWS Assurance can read documents such as security policies as evidence. To let AWS Assurance read your repositories, install the AWS Assurance app on a GitHub account, and then choose the repositories:

1. Open the [AWS Assurance console](https://console.aws.amazon.com/assurance/), and then choose **Environments**.

1. Choose your environment, and then in the **Connections** section, choose **Add connection**.

1. Choose **GitHub**.

1. (Optional) For **GitHub organization or user account**, enter the account name. You must enter it if another environment already connected that account.

1. Choose **Connect**, and then install the app in GitHub.

GitHub returns you to the **Connections** section. If the status shows **Installation pending**, choose **Install GitHub App**.

## Connecting SharePoint to AWS Assurance
<a name="third-party-connections-sharepoint"></a>

To connect SharePoint, sign in as a Microsoft Entra administrator. A SharePoint administrator must also grant AWS Assurance read access to each site.

1. Open the [AWS Assurance console](https://console.aws.amazon.com/assurance/), and then choose **Environments**.

1. Choose your environment, and then in the **Connections** section, choose **Add connection**.

1. Choose **SharePoint**.

1. For **SharePoint sites**, enter the URL of each site, up to 50. Enter the same sites that your SharePoint administrator grants.

1. (Optional) For **Microsoft Entra tenant ID**, enter your directory ID or a verified domain. If you enter it, you approve access in one visit to Microsoft.

1. Choose **Connect**, and then approve access in Microsoft.

Microsoft returns you to the **Connections** section.

## Connecting GitHub or SharePoint to AWS Assurance programmatically
<a name="third-party-connections-api"></a>

To connect your environment with the AWS Assurance application programming interface (API), call `CreateEnvironmentConnection` with a `github` or `sharepoint` value in `providerConfig`. For SharePoint, include the site URLs in `sites`.

The response contains an `authorizationUrl`. Open it in a browser to approve access. The service returns this URL only once. If you lose it, call `CreateEnvironmentConnection` again.

## Using a GitHub or SharePoint document as evidence
<a name="third-party-connections-evidence"></a>

Call `PutEvidence`, and set `reference` to the URL of the document. For GitHub, use the URL of the file. For SharePoint, you can use any link to the document, including a sharing link. If you omit `title`, AWS Assurance uses the name of the document.

If the environment has more than one connection to the same provider, also set `connectionId`. You can find the ID in the response of `ListEnvironmentConnections`.

To browse a connection for a document, call `ListConnectionItems` with the `connectionId`. Each `FILE` item has a `url` that you can use as the `reference`.

If a document changes at its source, add it again to record the new version. It works the same way as for a document in an Amazon S3 source. For more information, see [Updating a document in an S3 source](evidence-management.md#evidence-management-s3-object-updates).

**Continuous mode updates**  
When a framework uses Continuous mode, updating a document in GitHub or SharePoint doesn’t refresh the linked evidence or start an assessment. Add the document again.

## Removing a GitHub or SharePoint connection
<a name="third-party-connections-remove"></a>

In the **Connections** section, choose the connection, and then choose **Remove**. You can also call `DeleteEnvironmentConnection` with the `connectionId`.

## Resolving errors with GitHub and SharePoint evidence connections
<a name="third-party-connections-troubleshooting"></a>

Use this section to resolve errors that you get when you use a GitHub or SharePoint connection. Most errors come from the access that you granted at GitHub or Microsoft. The following table describes each issue, its cause, and its resolution.


| Issue | Cause | Resolution | 
| --- | --- | --- | 
|  `AccessDeniedException` when you read a document | The access that you granted at the provider expired, or someone revoked it. | Remove the connection, and then connect again. | 
|  `ValidationException` that lists connections | You created more than one connection that has access to the document. | Set `connectionId` to one of the listed connections. | 
|  `ListConnectionItems` doesn’t return a document | The connection can’t read the repository or site. | For GitHub, add the repository to the app installation. For SharePoint, ask your administrator to grant the site. | 

To avoid these issues, review the app installation in GitHub and the site grants in SharePoint when your access changes. Use one connection for each provider unless you need more.

For more information about evidence management, see [Managing evidence in AWS Assurance](evidence-management.md).