# Expiration days for Anyone links SHALL be set to 30 days or less

Expiration days for Anyone links SHALL be set to 30 days or less. A Maester check for SharePoint, Sharing links.

Source: https://maester.dev/docs/tests/CISA.MS.SHAREPOINT.3.1

<!-- 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/mynster9361" title="-Mynster · Original author"><img src="https://github.com/Mynster9361.png" alt="-Mynster" 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/mynster9361">-Mynster</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/cisa">CISA</a> · SharePoint · Sharing links · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId CISA.MS.SHAREPOINT.3.1
```

## Overview

Expiration days for Anyone links SHALL be set to 30 days or less.

Rationale: Anyone links that do not expire or have excessively long expiration periods pose a persistent risk of unauthorized access. Setting an expiration of 30 days or less ensures that shared content access is time-limited.

#### Remediation action:

1. Sign in to the [SharePoint admin center](https://go.microsoft.com/fwlink/?linkid=2185219).
2. Select Policies > Sharing.
3. Under Advanced settings for Anyone links, check **These links must expire within this many days** and set to **30** days or less.
4. Select Save.

#### Related links

* [CISA 3 Anyone Link Expiration - MS.SHAREPOINT.3.1v1](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/baselines/sharepoint.md#mssharepoint31v1)
* [CISA ScubaGear Rego Reference](https://github.com/cisagov/ScubaGear/blob/main/PowerShell/ScubaGear/Rego/SharepointConfig.rego)

## Details

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

| Field | Value |
| --- | --- |
| Test ID | CISA.MS.SHAREPOINT.3.1 |
| Severity | Medium |
| Suite | CISA |
| Product | SharePoint |
| Feature | Sharing links |
| Area | External access and sharing |
| Resource type | Tenant |
| User impact | Low |
| Implementation cost | Low |
| MITRE ATT&CK | T1048 Exfiltration Over Alternative Protocol, T1213.002 Sharepoint, T1530 Data from Cloud Storage |
| Supports benchmark | CISA SCuBA Secure Configuration Baselines for Microsoft 365 (version ScubaGear main, 2026-10-11), requirement MS.SHAREPOINT.3.1 |
| Criticality | SHALL |
| Upstream requirement | MS.SHAREPOINT.3.1v1 |
| Supports controls | cisa-scuba:MS.SHAREPOINT.3.1, nist-800-53-r5:AC-3, nist-800-53-r5:AC-21b |
| PowerShell test | [Test-MtCisaSpoAnyoneLinkExpiration](https://github.com/maester365/maester/blob/main/tests/cisa/sharepoint/Test.CISA.MS.SHAREPOINT.3.1.ps1) |
| Services | SharePointOnline |

</details>

## Source

- Test: [`tests/cisa/sharepoint/Test.CISA.MS.SHAREPOINT.3.1.ps1`](https://github.com/maester365/maester/blob/main/tests/cisa/sharepoint/Test.CISA.MS.SHAREPOINT.3.1.ps1)
- Documentation: [`tests/cisa/sharepoint/Test.CISA.MS.SHAREPOINT.3.1.md`](https://github.com/maester365/maester/blob/main/tests/cisa/sharepoint/Test.CISA.MS.SHAREPOINT.3.1.md)
