Skip to content

Commit 7c97bf9

Browse files
committed
Simplify CSP cmdlets by removing references to directive, add flag to opt-in to enforcement
1 parent bebac4b commit 7c97bf9

File tree

4 files changed

+36
-38
lines changed

4 files changed

+36
-38
lines changed

sharepoint/sharepoint-ps/sharepoint-online/Add-SPOContentSecurityPolicy.md

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,27 @@ ms.reviewer:
1515

1616
## SYNOPSIS
1717

18-
Adds an entry to the **Content Security Policy** configuration.
18+
Adds a source to the **Content Security Policy** configuration.
1919

2020
## SYNTAX
2121

2222
### Default
2323

2424
```powershell
25-
Add-SPOContentSecurityPolicy [-Url] <String> [-Directive] <String>
25+
Add-SPOContentSecurityPolicy [-Source] <String>
2626
```
2727

2828
## DESCRIPTION
2929

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.
30+
Adds a source to the **Content Security Policy** configuration.
31+
The source will be added to the `script-src` directive during construction of the `Content-Security-Policy` header.
32+
In multi-geo environments, **Content Security Policy** configuration is unique to each geo.
3433

3534
## PARAMETERS
3635

37-
### -Url
36+
### -Source
3837

39-
Url to allow as part of this **Content Security Policy** entry.
38+
Source to be added to the **Content Security Policy** configuration.
4039

4140
```yaml
4241
Type: String
@@ -45,25 +44,7 @@ Aliases:
4544
Applicable: SharePoint Online
4645

4746
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
47+
Position: 0
6748
Default value: None
6849
Accept pipeline input: False
6950
Accept wildcard characters: False

sharepoint/sharepoint-ps/sharepoint-online/Get-SPOContentSecurityPolicy.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.reviewer:
1515

1616
## SYNOPSIS
1717

18-
Returns all entries in the current **Content Security Policy** configuration.
18+
Returns all sources in the current **Content Security Policy** configuration.
1919

2020
## SYNTAX
2121

@@ -27,8 +27,8 @@ Get-SPOContentSecurityPolicy
2727

2828
## DESCRIPTION
2929

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.
30+
Returns all sources in the current **Content Security Policy** configuration.
31+
Each source will be added to the `script-src` directive during construction of the `Content-Security-Policy` header.
3232

3333
## RELATED LINKS
3434

sharepoint/sharepoint-ps/sharepoint-online/Remove-SPOContentSecurityPolicy.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@ ms.reviewer:
1515

1616
## SYNOPSIS
1717

18-
Removes entries from the **Content Security Policy** configuration.
18+
Removes a source from the **Content Security Policy** configuration.
1919

2020
## SYNTAX
2121

2222
### Default
2323

2424
```powershell
25-
Remove-SPOContentSecurityPolicy [-Url] <String>
25+
Remove-SPOContentSecurityPolicy [-Source] <String>
2626
```
2727

2828
## DESCRIPTION
2929

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.
30+
Removes the given source from the **Content Security Policy** configuration.
31+
In multi-geo environments, **Content Security Policy** configuration is unique to each geo.
3232

3333
## PARAMETERS
3434

35-
### -Url
35+
### -Source
3636

37-
Url of the **Content Security Policy** entries to be removed.
37+
Source to be removed from the **Content Security Policy** configuration.
3838

3939
```yaml
4040
Type: String

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ Set-SPOTenant
156156
[-CoreDefaultLinkToExistingAccess <Boolean>]
157157
[-SelfServiceSiteCreationDisabled <Boolean>]
158158
[-SyncAadB2BManagementPolicy <Boolean>]
159-
[-ContentSecurityPolicyConfigSynced <Boolean>]
159+
[-ResyncContentSecurityPolicyConfigurationEntries <Boolean>]
160+
[-EnforceContentSecurityPolicy <Boolean>]
160161
[-DocumentUnderstandingModelScope <SyntexFeatureScopeValue>]
161162
[-DocumentUnderstandingModelSelectedSitesList [String[]]]
162163
[-DocumentUnderstandingModelSelectedSitesListOperation <SelectedSitesListOperations>]
@@ -3013,7 +3014,23 @@ Accept wildcard characters: False
30133014
When set to `True`, forces a sync of **Content Security Policy** entries for SharePoint framework component in the tenant application catalog.
30143015
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.
30153016
The sync may take up to 24 hours to complete.
3016-
In multi-geo environments, **Content Security Policy** entries are unique to each geo.
3017+
In multi-geo environments, **Content Security Policy** configuration is unique to each geo.
3018+
3019+
```yaml
3020+
Type: Boolean
3021+
Parameter Sets: (All)
3022+
Applicable: SharePoint Online
3023+
Required: False
3024+
Position: Named
3025+
Default value: False
3026+
Accept pipeline input: False
3027+
Accept wildcard characters: False
3028+
```
3029+
3030+
### -EnforceContentSecurityPolicyConfiguration
3031+
3032+
When set to `True`, opts-in to enforcement of the current **Content Security Policy** configuration.
3033+
In multi-geo environments, **Content Security Policy** configuration is unique to each geo.
30173034

30183035
```yaml
30193036
Type: Boolean

0 commit comments

Comments
 (0)