# Audit streaming

Audit logs should be retained according to your organization's needs and protected from purging.

Source: https://maester.dev/docs/tests/AZDO.1010

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/sebastianclaesson" title="Sebastian Claesson · Original author"><img src="https://github.com/SebastianClaesson.png" alt="Sebastian Claesson" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/sebastianclaesson">Sebastian Claesson</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/maester">Maester</a> · Azure DevOps · Auditing · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AZDO.1010
```

## Overview

Audit logs **should be** retained according to your organization's needs and protected from purging.

Rationale: Send auditing data to other Security Incident and Event Management (SIEM) tools and open new possibilities, such as the ability to trigger alerts for specific events, create views on auditing data, and perform anomaly detection. Setting up a stream also allows you to store more than 90-days of auditing data, which is the maximum amount of data that Azure DevOps keeps for your organizations.

#### Remediation action

Create an audit stream, which sends data to other locations for further processing.

1. Sign in to your organization.
2. Choose Organization settings.
3. Select Auditing.

> If you don't see Auditing in Organization Settings, then auditing is not currently enabled for your organization. Someone in the organization owner or Project Collection Administrators (PCAs) group must enable Auditing in Organization Policies. You will then be able to see events on the Auditing page if you have the appropriate permissions.

1. Go to the Streams tab, and then select New stream.
2. Select the stream target that you want to configure, and then select from the following instructions to set up your stream target type.
   1. Splunk
   2. Event Grid
   3. Azure Monitor Log

**Results:**
Audit streams represent a pipeline that flows audit events from your Azure DevOps organization to a stream target. At least every half hour, new audit events are bundled and streamed to your targets.

#### Related links

* [Azure DevOps Security - Create audit streaming](https://learn.microsoft.com/azure/devops/organizations/audit/auditing-streaming?view=azure-devops)

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | AZDO.1010 |
| Severity | High |
| Suite | Maester |
| Product | Azure DevOps |
| Feature | Auditing |
| Area | Logging and detection |
| Resource type | Tenant |
| User impact | Low |
| Implementation cost | Medium |
| MITRE ATT&CK | T1685.002 Disable or Modify Cloud Log, T1070 Indicator Removal |
| Supports controls | nist-800-53-r5:AU-6, nist-800-53-r5:SI-4 |
| PowerShell test | [Test-AzdoAuditStream](https://github.com/maester365/maester/blob/main/tests/maester/azure-devops/Test.AZDO.1010.ps1) |
| Services | AzureDevOps |
| Learn more | [https://learn.microsoft.com/azure/devops/organizations/audit/auditing-streaming?view=azure-devops](https://learn.microsoft.com/azure/devops/organizations/audit/auditing-streaming?view=azure-devops) |

</details>

## Source

- Test: [`tests/maester/azure-devops/Test.AZDO.1010.ps1`](https://github.com/maester365/maester/blob/main/tests/maester/azure-devops/Test.AZDO.1010.ps1)
- Documentation: [`tests/maester/azure-devops/Test.AZDO.1010.md`](https://github.com/maester365/maester/blob/main/tests/maester/azure-devops/Test.AZDO.1010.md)
