

# Evidence import with sample connectors in AWS Assurance

For AWS Assurance, AWS provides sample connectors that automate compliance evidence import from third-party tools. With sample connectors, you can import evidence from tools that your team already uses. You can link a Jira issue for an access review or a Confluence page with a security policy to a control.

When you add a link to a document in a comment on a control, the connector fetches the document. The connector adds the document to the control as evidence, and then starts an assessment of that control. Each import or refresh starts an assessment of the linked controls, which counts toward your usage. For more information, see [Pricing](what-is-service.md#what-is-pricing).

**Note**  
Sample connectors are example code that you deploy and run in your own AWS account. You’re responsible for running, securing, and updating them. For GitHub and SharePoint, consider the built-in connections first.

**Topics**
+ [Prerequisites](#evidence-import-connectors-prereqs)
+ [Available connectors](#evidence-import-connectors-list)
+ [Deploying the sample connectors](#evidence-import-connectors-deploy)
+ [How the sample connectors keep evidence current](#evidence-import-connectors-how)
+ [Refreshing evidence on request](#evidence-import-connectors-refresh)
+ [Credentials for each connector](#evidence-import-connectors-credentials)
+ [Adding a connector for another tool](#evidence-import-connectors-custom)
+ [For more information](#evidence-import-connectors-more)

## Prerequisites
<a name="evidence-import-connectors-prereqs"></a>

To use the sample connectors, you need the following:
+ An AWS account with AWS Identity and Access Management (IAM) permissions to deploy an AWS CloudFormation stack or a Terraform configuration
+ A credential with read access for each tool that you connect

## Available connectors
<a name="evidence-import-connectors-list"></a>

The following table lists the sample connectors and the evidence that each one imports.


| Connector | Links that you can add | Evidence that AWS Assurance receives | 
| --- | --- | --- | 
| Confluence | Pages, including up to 25 child pages for each link | A PDF of each page, with its attachments | 
| GitHub | Repositories and organizations | Branch protection rules, Dependabot alerts, the `CODEOWNERS` file, and the organization’s two-factor authentication setting | 
| Google Drive | Docs, Sheets, Slides, Drawings, files, and the files in a folder | Exported or downloaded files | 
| HCP Terraform and Terraform Enterprise | Workspaces and organizations | Workspace settings, policy results, run history, and policy sets | 
| Jira | Issues | A PDF of each issue, with its attachments | 
| SharePoint | Documents and folders in SharePoint Online libraries | Downloaded files | 

The GitHub and SharePoint sample connectors work differently from the GitHub and SharePoint connections that you create in AWS Assurance. For built-in connections, see [Connecting GitHub and SharePoint in AWS Assurance](third-party-connections.md).

## Deploying the sample connectors
<a name="evidence-import-connectors-deploy"></a>

You deploy the sample connectors in your own AWS account as an AWS Lambda (Lambda) function. To deploy the function, complete the following steps.

1. Choose the AWS CloudFormation template or the Terraform template that the sample code provides.

1. Deploy the template in your AWS account.

1. Add a credential to the secret for each connector that you turn on. For details, see [Credentials for each connector](#evidence-import-connectors-credentials).

The function starts importing evidence from the links in your control comments. You can also run the connectors as a command on a server or in a scheduled job.

## How the sample connectors keep evidence current
<a name="evidence-import-connectors-how"></a>

The deployed function runs in the following cases:
+  **A new comment** – AWS CloudTrail (CloudTrail) records each comment that you add or update on a control. The function reads the links in the comment within a few minutes.
+  **A scheduled check** – Once a day by default, the function checks each linked document. It uploads a new version only when the document changed, and then assesses each control that the document is linked to.
+  **A request that you send** – To refresh evidence immediately, send an event to the default event bus in Amazon EventBridge (EventBridge). EventBridge is a serverless event bus service. For steps, see [Refreshing evidence on request](#evidence-import-connectors-refresh).

Each document keeps one evidence item for as long as you use it. If you rename the document, AWS Assurance updates only the title.

## Refreshing evidence on request
<a name="evidence-import-connectors-refresh"></a>

To refresh evidence immediately, complete the following steps.

1. Open the EventBridge console at https://console.aws.amazon.com/events/. Choose the AWS Region where you deployed the function.

1. Choose **Event buses**, choose the **default** event bus, and then choose **Send events**.

1. For **Event source**, enter `assurance.evidence-import`.

1. For **Detail type**, enter `EvidenceImportRequest`.

1. For **Event detail**, enter `{"mode": "full-refresh", "controls": "all"}`. To refresh specific controls, replace `"all"` with a list of control IDs.

1. Choose **Send**.

The function refreshes the evidence for the controls that you listed, and then assesses those controls.

## Credentials for each connector
<a name="evidence-import-connectors-credentials"></a>

Each connector reads its source with a credential that you store in AWS Secrets Manager (Secrets Manager). The template creates an empty secret for each connector that you turn on, and you add the credential to it. Each credential needs read access only.


| Connector | Credential | Additional setup | 
| --- | --- | --- | 
| Confluence and Jira | An Atlassian API token for an account that can view each linked page and issue | None | 
| GitHub | A fine-grained token with read access to the linked repositories | None | 
| Google Drive | A JavaScript Object Notation (JSON) key for a Google Cloud service account | Share the folders that contain evidence with the service account, with view access | 
| HCP Terraform | A team token for a team with the Read role on the linked workspaces | None | 
| SharePoint | A Microsoft Entra ID app registration with the `Sites.Selected` permission | A SharePoint administrator grants the app read access to each site that contains evidence | 

## Adding a connector for another tool
<a name="evidence-import-connectors-custom"></a>

The sample connectors are written in Python. To import evidence from a tool that isn’t listed, write a connector in your own Python package. Then register the connector as an `assurance.connectors` entry point. Your connector can’t replace a connector that the sample code provides.

## For more information
<a name="evidence-import-connectors-more"></a>
+  [Managing evidence in AWS Assurance](evidence-management.md) 
+  [Connecting GitHub and SharePoint in AWS Assurance](third-party-connections.md) 