|
| 1 | +--- |
| 2 | +title: Manage custom content with repository connections |
| 3 | +titleSuffix: Microsoft Sentinel |
| 4 | +description: This article explains custom Sentinel content like GitHub or Azure DevOps repositories that can utilize source control features. |
| 5 | +author: austinmccollum |
| 6 | +ms.author: austinmc |
| 7 | +ms.service: microsoft-sentinel |
| 8 | +ms.topic: conceptual |
| 9 | +ms.date: 8/24/2022 |
| 10 | +ms.custom: template-concept |
| 11 | +#Customer intent: As a SOC collaborator or MSSP analyst, I want to manage dynamic Sentinel workspace content based on source control repositories for continuous integration and continuous delivery (CI/CD). Specifically as an MSSP content manager, I want to deploy one solution to many customer workspaces and still be able to tailor custom content for their environments. |
| 12 | +--- |
| 13 | + |
| 14 | +# Manage custom content with Microsoft Sentinel repositories (public preview) |
| 15 | + |
| 16 | +The Microsoft Sentinel repositories feature provides a central experience for the deployment and management of Sentinel content as code. Repositories allow connections to an external source control for continuous integration / continuous delivery (CI/CD). This automation removes the burden of manual processes to update and deploy your custom content across workspaces. For more information on Sentinel content, see [About Microsoft Sentinel content and solutions](sentinel-solutions.md). |
| 17 | + |
| 18 | +> [!IMPORTANT] |
| 19 | +> The Microsoft Sentinel **Repositories** feature is currently in **PREVIEW**. See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for additional legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability. |
| 20 | +> |
| 21 | +
|
| 22 | +## Plan your repository connection |
| 23 | + |
| 24 | +Microsoft Sentinel repositories require careful planning to ensure you have the proper permissions from your workspace to the repository (repo) you want connected. Only connections to GitHub and Azure DevOps repositories with contributor access are currently supported. The Microsoft Sentinel application will need authorization to your repo and have Actions enabled for GitHub and Pipelines enabled for Azure DevOps. |
| 25 | + |
| 26 | +Repositories require an **Owner** role in the resource group that contains your Microsoft Sentinel workspace. This role is required to create the connection between Microsoft Sentinel and your source control repository. If you're' unable to use the Owner role in your environment, you can instead use the combination of **User Access Administrator** and **Sentinel Contributor** roles to create the connection. |
| 27 | + |
| 28 | +If you find content in a public repository where you *aren't* a contributor, you'll need to get that content into your repo first. You can do that with an import, fork, or clone of the content to a repo where you're a contributor. Then you can connect your repo to your Sentinel workspace. For more information, see [Deploy custom content from your repository](ci-cd.md). |
| 29 | + |
| 30 | + |
| 31 | +### Validate your content |
| 32 | + |
| 33 | +The following Microsoft Sentinel content types can be deployed through a repository connection: |
| 34 | +- Analytics rules |
| 35 | +- Automation rules |
| 36 | +- Hunting queries |
| 37 | +- Parsers |
| 38 | +- Playbooks |
| 39 | +- Workbooks |
| 40 | + |
| 41 | +> [!TIP] |
| 42 | +> This article does *not* describe how to create these types of content from scratch. For more information, see the relevant [Microsoft Sentinel GitHub wiki](https://github.com/Azure/Azure-Sentinel/wiki#get-started) for each content type. |
| 43 | +> |
| 44 | +
|
| 45 | + Repositories content needs to be stored as [ARM templates](/azure/azure-resource-manager/templates/overview). The repositories deployment pipeline doesn't validate the content except to confirm it's in the correct JSON format. |
| 46 | + |
| 47 | +The first step to validate your content is to test it within Microsoft Sentinel. You can also apply the [Microsoft Sentinel GitHub validation process](https://github.com/Azure/Azure-Sentinel/wiki#test-your-contribution) and tools to complement your validation process. |
| 48 | + |
| 49 | +A sample repository is available with ARM templates for each of the content types listed above. The repo also demonstrates how to use advanced features of repository connections. For more information, see [Sentinel CICD repositories sample](https://github.com/SentinelCICD/RepositoriesSampleContent). |
| 50 | + |
| 51 | + |
| 52 | +:::image type="content" source="media/ci-cd-custom-content/repositories-connection-success.png" alt-text="Screenshot of a successful repository connection. The RepositoriesSampleContent is shown. This screenshot is after the sample was imported from the SentinelCICD repo to a private GitHub repo in the FourthCoffee organization." lightbox="media/ci-cd-custom-content/repositories-connection-success.png"::: |
| 53 | + |
| 54 | + |
| 55 | +### Maximum connections and deployments |
| 56 | + |
| 57 | +- Each Microsoft Sentinel workspace is currently limited to **five repository connections**. |
| 58 | + |
| 59 | +- Each Azure resource group is limited to **800 deployments** in its deployment history. If you have a high volume of ARM template deployments in your resource group(s), you may see the `Deployment QuotaExceeded` error. For more information, see [DeploymentQuotaExceeded](/azure/azure-resource-manager/templates/deployment-quota-exceeded) in the Azure Resource Manager templates documentation. |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +## Improve performance with smart deployments |
| 64 | + |
| 65 | +The **smart deployments** feature is a back-end capability that improves performance by actively tracking modifications made to the content files of a connected repository. It uses a CSV file within the '.sentinel' folder in your repository to audit each commit. The workflow avoids redeploying content that hasn't been modified since the last deployment. This process improves your deployment performance and prevents tampering with unchanged content in your workspace, such as resetting dynamic schedules of your analytics rules. |
| 66 | + |
| 67 | +Smart deployments are enabled by default on newly created connections. If you prefer all source control content to be deployed every time a deployment is triggered, regardless of whether that content was modified or not, you can modify your workflow to disable smart deployments. For more information, see [Customize the deployment workflow](ci-cd.md#customize-the-deployment-workflow). |
| 68 | + |
| 69 | + > [!NOTE] |
| 70 | + > This capability was launched in public preview on April 20th, 2022. Connections created prior to launch would need to be updated or recreated for smart deployments to be turned on. |
| 71 | + > |
| 72 | +
|
| 73 | + |
| 74 | +## Consider deployment customization options |
| 75 | + |
| 76 | +Even with smart deployments enabled, the default behavior is to push all the updated content from the connected repository branch. If the default configuration for your content deployment from GitHub or Azure DevOps doesn't meet all your requirements, you can modify the experience to fit your needs. |
| 77 | + |
| 78 | +For example, you may want to: |
| 79 | +- turn off smart deployments |
| 80 | +- configure different deployment triggers |
| 81 | +- deploy content only from a specific root folder for a given workspace |
| 82 | +- schedule the workflow to run periodically |
| 83 | +- combine different workflow events together |
| 84 | +- prioritize content to be evaluated before the entire repo is enumerated for valid ARM templates |
| 85 | + |
| 86 | +For more details on how to implement these customizations, see [Customize the deployment workflow](ci-cd.md#customize-the-deployment-workflow). |
| 87 | + |
| 88 | + |
| 89 | +## Next steps |
| 90 | + |
| 91 | +Get more examples and step by step instructions on deploying Microsoft Sentinel repositories. |
| 92 | + |
| 93 | +- [Sentinel CICD sample repository](https://github.com/SentinelCICD/RepositoriesSampleContent) |
| 94 | +- [Deploy custom content from your repository](ci-cd.md) |
| 95 | +- [Automate Sentinel integration with DevOps](/azure/architecture/example-scenario/devops/automate-sentinel-integration#microsoft-sentinel-repositories) |
0 commit comments