Skip to content

Commit 8ba8b40

Browse files
authored
Merge pull request MicrosoftDocs#2486 from MicrosoftDocs/master
Publish 06/04/2021, 3:30 PM
2 parents 0606778 + 5c36761 commit 8ba8b40

File tree

3 files changed

+143
-10
lines changed

3 files changed

+143
-10
lines changed

docset/winserver2022-ps/configci/New-CIPolicy.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Creates a Code Integrity policy as an .xml file.
1919
```
2020
New-CIPolicy [-FilePath] <String> [-DriverFiles <DriverFile[]>] -Level <RuleLevel> [-Fallback <RuleLevel[]>]
2121
[-Audit] [-ScanPath <String>] [-ScriptFileNames] [-UserPEs] [-NoScript] [-Deny] [-NoShadowCopy]
22-
[-OmitPaths <String[]>] [-PathToCatroot <String>] [<CommonParameters>]
22+
[-OmitPaths <String[]>] [-PathToCatroot <String>] [-MultiplePolicyFormat] [<CommonParameters>]
2323
```
2424

2525
### Rules
2626
```
2727
New-CIPolicy [-FilePath] <String> -Rules <Rule[]> [-Audit] [-ScanPath <String>] [-ScriptFileNames] [-UserPEs]
28-
[-NoScript] [-Deny] [-NoShadowCopy] [-OmitPaths <String[]>] [-PathToCatroot <String>] [<CommonParameters>]
28+
[-NoScript] [-Deny] [-NoShadowCopy] [-OmitPaths <String[]>] [-PathToCatroot <String>] [-MultiplePolicyFormat] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -43,18 +43,18 @@ If you specify the **Audit** parameter, this cmdlet scans the Code Integrity Aud
4343

4444
## EXAMPLES
4545

46-
### Example 1: Create a policy
46+
### Example 1: Create a policy in multiple policy format
4747
```
48-
The first command scans for user-mode executables (applications) along with kernel-mode binaries such as drivers and creates rules at the Publisher level. The command creates a policy and stores it in the file that is named Policy.xml. This command specifies the **OmitPaths** parameter to exclude files in the temp\ConfigCITestBinaries folder. The command specifies the **NoScript** parameter so that it gets information for only PE files.
49-
PS C:\> New-CIPolicy -ScanPath '.\temp\' -UserPEs -OmitPaths '.\temp\ConfigCITestBinaries' -NoScript -FilePath '.\Policy.xml' -Level Publisher
48+
PS C:\> New-CIPolicy -ScanPath '.\temp\' -UserPEs -OmitPaths '.\temp\ConfigCITestBinaries' -NoScript -FilePath '.\Policy.xml' -Level Publisher -MultiplePolicyFormat
5049
Scan completed successfully
5150
5251
The second command displays the contents of the policy.
5352
PS C:\> Get-Content -Path '.\policy.xml'
5453
<?xml version="1.0" encoding="utf-8"?>
55-
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy">
54+
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy" PolicyType="Base Policy">
5655
<VersionEx>10.0.0.0</VersionEx>
57-
<PolicyTypeID>{A244370E-44C9-4C06-B551-F6016E563076}</PolicyTypeID>
56+
<BasePolicyID>{BB9EC112-DD85-41AD-9778-22680D3D8A22}</BasePolicyID>
57+
<PolicyID>{BB9EC112-DD85-41AD-9778-22680D3D8A22}</PolicyID>
5858
<PlatformID>{2E07F7E4-194C-4D20-B7C9-6F44A6C5A234}</PlatformID>
5959
<Rules>
6060
<Rule>
@@ -210,6 +210,8 @@ Hash="DA737C142A51A73D82E6AD677474C8031486FDEF018A6FE9D178564F83AB284B" />
210210
</SiPolicy>
211211
```
212212

213+
The first command scans for user-mode executables (applications) along with kernel-mode binaries such as drivers and creates rules at the Publisher level. The command creates a policy in multiple policy format and stores it in the file that is named Policy.xml. This command specifies the **OmitPaths** parameter to exclude files in the temp\ConfigCITestBinaries folder. The command specifies the **NoScript** parameter so that it gets information for only portable executable files (PE files).
214+
213215
### Example 2: Scan unsigned files
214216
```
215217
PS C:\> New-CIPolicy -ScanPath '.\temp\' -UserPEs -FilePath ".\policy.xml" -Level Publisher -Fallback Hash
@@ -539,6 +541,22 @@ Accept pipeline input: False
539541
Accept wildcard characters: False
540542
```
541543
544+
### -MultiplePolicyFormat
545+
Indicates that this cmdlet should create a policy in multiple policy format as opposed to a single policy format.
546+
Refer to [Create WDAC policies in Multiple Policy Format](https://docs.microsoft.com/windows/security/threat-protection/windows-defender-application-control/deploy-multiple-windows-defender-application-control-policies#creating-wdac-policies-in-multiple-policy-format) for the difference between the policy formats.
547+
548+
```yaml
549+
Type: SwitchParameter
550+
Parameter Sets: (All)
551+
Aliases: None
552+
553+
Required: False
554+
Position: Named
555+
Default value: None
556+
Accept pipeline input: False
557+
Accept wildcard characters: False
558+
```
559+
542560
### CommonParameters
543561
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
544562

docset/winserver2022-ps/configci/New-CIPolicyRule.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ title: New-CIPolicyRule
1111
# New-CIPolicyRule
1212

1313
## SYNOPSIS
14-
Generates Code Integrity policy rules for drivers.
14+
Generates Code Integrity policy rules for user mode code and drivers.
1515

1616
## SYNTAX
1717

@@ -33,6 +33,11 @@ New-CIPolicyRule -FilePathRule <String> [-Deny]
3333
[-ScriptFileNames] [<CommonParameters>]
3434
```
3535

36+
### PackagedAppRule
37+
```
38+
New-CIPolicyRule -Package <String> [-Deny] [<CommonParameters>]
39+
```
40+
3641
## DESCRIPTION
3742
The **New-CIPolicyRule** cmdlet generates Code Integrity policy rules for drivers.
3843
Specify a rule level and an array of **DriverFile** objects or the path of a driver.
@@ -192,6 +197,49 @@ attributes : {[AppIDs, ], [MinimumFileVersion, 0.0.0.0], [FilePath, .\temp\C
192197

193198
This command generates a filepath rule for the specific path verbatim string. This will allow anything in the parent folder.
194199

200+
### Example 5: Create a policy rule for a packaged application and its dependencies
201+
```
202+
PS C:\> $package = Get-AppxPackage -Name *Microsoft.Whiteboard*
203+
PS C:\> $package_dependencies = $package.Dependencies
204+
205+
PS C:\> $package_rule = New-CIPolicyRule -Package $package
206+
PS C:\> $package_rule += New-CIPolicyRule -Package $dependency[0] # repeat for all dependencies in array
207+
```
208+
```output
209+
PS C:\> $package_rule
210+
211+
212+
Name : Microsoft.Whiteboard_8wekyb3d8bbwe FileRule
213+
Id : ID_ALLOW_A_D
214+
TypeId : Allow
215+
Root :
216+
FileVersionRef :
217+
AppIDRef :
218+
Wellknown : False
219+
Ekus :
220+
Exceptions :
221+
FileAttributes :
222+
FileException : False
223+
UserMode : True
224+
attributes : {[AppIDs, ], [MinimumFileVersion, 0.0.0.0], [PackageFamilyName, Microsoft.Whiteboard_8wekyb3d8bbwe], [PackageVersion, 21.10503.5662.0]}
225+
226+
Name : Microsoft.NET.Native.Runtime.2.2_8wekyb3d8bbwe FileRule
227+
Id : ID_ALLOW_A_E
228+
TypeId : Allow
229+
Root :
230+
FileVersionRef :
231+
AppIDRef :
232+
Wellknown : False
233+
Ekus :
234+
Exceptions :
235+
FileAttributes :
236+
FileException : False
237+
UserMode : True
238+
attributes : {[AppIDs, ], [MinimumFileVersion, 0.0.0.0], [PackageFamilyName, Microsoft.NET.Native.Runtime.2.2_8wekyb3d8bbwe], [PackageVersion, 2.2.28604.0]}
239+
```
240+
241+
This set of commands finds a packaged application matching the specified name and generates an allow rule for the packaged application and its dependencies.
242+
195243

196244
## PARAMETERS
197245

@@ -293,6 +341,21 @@ Accept pipeline input: False
293341
Accept wildcard characters: False
294342
```
295343
344+
### -Package
345+
Specifies the packaged app (MSIX/Appx) to base the rule.
346+
347+
```yaml
348+
Type: AppxPackage
349+
Parameter Sets: (All)
350+
Aliases: None
351+
352+
Required: False
353+
Position: Named
354+
Default value: None
355+
Accept pipeline input: False
356+
Accept wildcard characters: False
357+
```
358+
296359
### -ScriptFileNames
297360
298361
```yaml

docset/winserver2022-ps/configci/Set-CIPolicyIdInfo.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Modifies the name and ID of a Code Integrity policy.
1616
## SYNTAX
1717

1818
```
19-
Set-CIPolicyIdInfo [-FilePath] <String> [-PolicyName <String>] [-PolicyId <String>] [<CommonParameters>]
19+
Set-CIPolicyIdInfo [-FilePath] <String> [-PolicyName <String>] [-PolicyId <String>] [-BasePolicyToSupplementPath <string>] [-SupplementsBasePolicyID <Guid>] [-ResetPolicyID] [<CommonParameters>]
2020
```
2121

2222
## DESCRIPTION
@@ -40,6 +40,13 @@ PS C:\> Set-CIPolicyIdInfo -FilePath ".\Policy03.xml" -PolicyName "CIPolicy77"
4040

4141
This command modifies only the policy name for the policy stored in the Policy03.xml file.
4242

43+
### Example 3: Specify the base policy ID of a supplemental policy
44+
```
45+
PS C:\> Set-CIPolicyIdInfo -FilePath ".\Supplemental_Policy.xml" -BasePolicyToSupplementPath ".\Base_Policy.xml"
46+
```
47+
48+
This command will extract the PolicyID field from the Base_Policy.xml file and modify the BasePolicyID field in the Supplemental_Policy.xml file.
49+
4350
## PARAMETERS
4451

4552
### -FilePath
@@ -88,6 +95,52 @@ Accept pipeline input: False
8895
Accept wildcard characters: False
8996
```
9097
98+
### -BasePolicyToSupplementPath
99+
Specifies the path to a base policy to get the value for the **BasePolicyID** property for a supplemental policy.
100+
101+
```yaml
102+
Type: String
103+
Parameter Sets: (All)
104+
Aliases: None
105+
106+
Required: False
107+
Position: Named
108+
Default value: None
109+
Accept pipeline input: False
110+
Accept wildcard characters: False
111+
```
112+
113+
### -SupplementsBasePolicyID
114+
Specifies the value for the **BasePolicyID** property for a supplemental policy.
115+
116+
```yaml
117+
Type: Guid
118+
Parameter Sets: (All)
119+
Aliases: None
120+
121+
Required: False
122+
Position: Named
123+
Default value: None
124+
Accept pipeline input: False
125+
Accept wildcard characters: False
126+
```
127+
128+
### -ResetPolicyID
129+
Resets both the PolicyID and BasePolicyID values. This parameter will convert a single-policy format policy to multi-policy format.
130+
131+
```yaml
132+
Type: SwitchParameter
133+
Parameter Sets: (All)
134+
Aliases: None
135+
136+
Required: False
137+
Position: Named
138+
Default value: None
139+
Accept pipeline input: False
140+
Accept wildcard characters: False
141+
```
142+
143+
91144
### CommonParameters
92145
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
93146
@@ -100,4 +153,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
100153
## RELATED LINKS
101154
102155
[Get-CIPolicyIdInfo](./Get-CIPolicyIdInfo.md)
103-

0 commit comments

Comments
 (0)