Skip to content

Commit e4260fb

Browse files
authored
Merge pull request #672 from jaobrie/csp-cmdlets
Initial Content Security Policy cmdlet documentation
2 parents 384448f + bc8ff88 commit e4260fb

File tree

4 files changed

+189
-0
lines changed

4 files changed

+189
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
external help file:
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/add-spocontentsecuritypolicy
5+
applicable: SharePoint Online
6+
title: Add-SPOContentSecurityPolicy
7+
schema: 2.0.0
8+
author: jaobrie
9+
ms.author: jaobrie
10+
manager: ryannak
11+
ms.reviewer:
12+
---
13+
14+
# Add-SPOContentSecurityPolicy
15+
16+
## SYNOPSIS
17+
18+
Adds an entry to the **Content Security Policy** configuration.
19+
20+
## SYNTAX
21+
22+
### Default
23+
24+
```powershell
25+
Add-SPOContentSecurityPolicy [-Url] <String> [-Directive] <String>
26+
```
27+
28+
## DESCRIPTION
29+
30+
Adds an entry to the **Content Security Policy** configuration.
31+
The url in each entry will be added to the corresponding directive during construction of the Content-Security-Policy header.
32+
In multi-geo environments **Content Security Policy** entries are unique to each geo.
33+
Entries with a "*" directive will be applied to all directives.
34+
35+
## PARAMETERS
36+
37+
### -Url
38+
39+
Url to allow as part of this **Content Security Policy** entry.
40+
41+
```yaml
42+
Type: String
43+
Parameter Sets: (All)
44+
Aliases:
45+
Applicable: SharePoint Online
46+
47+
Required: True
48+
Position: Named
49+
Default value: None
50+
Accept pipeline input: False
51+
Accept wildcard characters: False
52+
```
53+
54+
### -Directive
55+
56+
Directive to allow as part of this **Content Security Policy** entry.
57+
Currently allowed values are "*", "script-src" and "worker-src".
58+
59+
```yaml
60+
Type: String
61+
Parameter Sets: (All)
62+
Aliases:
63+
Applicable: SharePoint Online
64+
65+
Required: True
66+
Position: Named
67+
Default value: None
68+
Accept pipeline input: False
69+
Accept wildcard characters: False
70+
```
71+
72+
## RELATED LINKS
73+
74+
[Get-SPOContentSecurityPolicy](Get-SPOContentSecurityPolicy.md)
75+
76+
[Remove-SPOContentSecurityPolicy](Remove-SPOContentSecurityPolicy.md)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
external help file:
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/get-spocontentsecuritypolicy
5+
applicable: SharePoint Online
6+
title: Get-SPOContentSecurityPolicy
7+
schema: 2.0.0
8+
author: jaobrie
9+
ms.author: jaobrie
10+
manager: ryannak
11+
ms.reviewer:
12+
---
13+
14+
# Get-SPOContentSecurityPolicy
15+
16+
## SYNOPSIS
17+
18+
Returns all entries in the current **Content Security Policy** configuration.
19+
20+
## SYNTAX
21+
22+
### Default
23+
24+
```powershell
25+
Get-SPOContentSecurityPolicy
26+
```
27+
28+
## DESCRIPTION
29+
30+
Returns all entries in the current **Content Security Policy** configuration.
31+
The url in each entry will be added to the corresponding directive during construction of the `Content-Security-Policy` header.
32+
33+
## RELATED LINKS
34+
35+
[Add-SPOContentSecurityPolicy](Add-SPOContentSecurityPolicy.md)
36+
37+
[Remove-SPOContentSecurityPolicy](Remove-SPOContentSecurityPolicy.md)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
external help file:
3+
Module Name: Microsoft.Online.SharePoint.PowerShell
4+
online version: https://learn.microsoft.com/powershell/module/sharepoint-online/remove-spocontentsecuritypolicy
5+
applicable: SharePoint Online
6+
title: Remove-SPOContentSecurityPolicy
7+
schema: 2.0.0
8+
author: jaobrie
9+
ms.author: jaobrie
10+
manager: ryannak
11+
ms.reviewer:
12+
---
13+
14+
# Remove-SPOContentSecurityPolicy
15+
16+
## SYNOPSIS
17+
18+
Removes entries from the **Content Security Policy** configuration.
19+
20+
## SYNTAX
21+
22+
### Default
23+
24+
```powershell
25+
Remove-SPOContentSecurityPolicy [-Url] <String>
26+
```
27+
28+
## DESCRIPTION
29+
30+
Removes all entries associated with the given url from the **Content Security Policy** configuration.
31+
In multi-geo environments, **Content Security Policy** entries are unique to each geo.
32+
33+
## PARAMETERS
34+
35+
### -Url
36+
37+
Url of the **Content Security Policy** entries to be removed.
38+
39+
```yaml
40+
Type: String
41+
Parameter Sets: (All)
42+
Aliases:
43+
Applicable: SharePoint Online
44+
45+
Required: True
46+
Position: 0
47+
Default value: None
48+
Accept pipeline input: False
49+
Accept wildcard characters: False
50+
```
51+
52+
## RELATED LINKS
53+
54+
[Get-SPOContentSecurityPolicy](Get-SPOContentSecurityPolicy.md)
55+
56+
[Add-SPOContentSecurityPolicy](Add-SPOContentSecurityPolicy.md)

sharepoint/sharepoint-ps/sharepoint-online/Set-SPOTenant.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Set-SPOTenant
156156
[-CoreDefaultLinkToExistingAccess <Boolean>]
157157
[-SelfServiceSiteCreationDisabled <Boolean>]
158158
[-SyncAadB2BManagementPolicy <Boolean>]
159+
[-ContentSecurityPolicyConfigSynced <Boolean>]
159160
[<CommonParameters>]
160161
```
161162

@@ -2976,6 +2977,25 @@ Accept wildcard characters: False
29762977

29772978
This feature allows SharePoint Online to synchronize several Entra B2B collaboration settings [Guest user access restriction and collaboration restriction](https://learn.microsoft.com/en-us/entra/external-id/external-collaboration-settings-configure#configure-settings-in-the-portal), and store them on SharePoint Online tenant store. On sharing, SharePoint checks whether those synchronized settings are blocking sharing before sending invitation requests to Entra B2B invitation manager. The sync might take up to 24 hours to complete if you change those Entra B2B collaboration settings. To make the change effective on SharePoint Online immediately, run 'Set-SPOTenant -SyncAadB2BManagementPolicy $true' and it forces a sync from Microsoft Entra.
29782979

2980+
```yaml
2981+
Type: Boolean
2982+
Parameter Sets: (All)
2983+
Applicable: SharePoint Online
2984+
Required: False
2985+
Position: Named
2986+
Default value: False
2987+
Accept pipeline input: False
2988+
Accept wildcard characters: False
2989+
```
2990+
2991+
### -ResyncContentSecurityPolicyConfigurationEntries
2992+
2993+
When set to `True`, forces a sync of **Content Security Policy** entries for SharePoint framework component in the tenant application catalog.
2994+
New entries will be added to the configuration, if not already present, based on the `cdnBasedPath` property under a solution's `.config/write-manifests.json` if present.
2995+
The sync may take up to 24 hours to complete.
2996+
In multi-geo environments, **Content Security Policy** entries are unique to each geo.
2997+
2998+
29792999
```yaml
29803000
Type: Boolean
29813001
Parameter Sets: (All)

0 commit comments

Comments
 (0)