Skip to content

Commit 89f5083

Browse files
authored
Fixes #11419 - Fix statement about logic of ConfirmImpact (#11421)
* Reorg security docs and add more WDAC content * fix broken links * Fix statement about logic of ConfirmImpact * Fix merge conflict * Reflow
1 parent bf63c8b commit 89f5083

File tree

5 files changed

+50
-49
lines changed

5 files changed

+50
-49
lines changed

reference/docs-conceptual/developer/cmdlet/users-requesting-confirmation.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Users Requesting Confirmation
3-
ms.date: 09/30/2021
3+
ms.date: 09/24/2024
44
ms.topic: reference
55
title: Users Requesting Confirmation
66
---
@@ -9,23 +9,22 @@ title: Users Requesting Confirmation
99
When you specify a value of `true` for the `SupportsShouldProcess` parameter of the Cmdlet attribute
1010
declaration, the **Confirm** parameter is added to the parameters of the cmdlet.
1111

12-
In the default environment, users can specify the **Confirm** parameter or `"-Confirm:$true` so that
13-
confirmation is requested when the `ShouldProcess()` method is called. This forces confirmation
14-
regardless of the impact level setting.
12+
In the default environment, users can specify the **Confirm** parameter so that confirmation is
13+
requested when the `ShouldProcess()` method is called. This forces confirmation regardless of the
14+
impact level setting.
1515

1616
If **Confirm** parameter is not used, the `ShouldProcess()` call requests confirmation if the
17-
`$ConfirmPreference` preference variable is equal to or greater than the `ConfirmImpact` setting of
18-
the cmdlet or provider. The default setting of `$ConfirmPreference` is **High**. Therefore, in the
19-
default environment, only cmdlets and providers that specify a high-impact action request
20-
confirmation.
17+
`ConfirmImpact` setting is equal to or greater than the `$ConfirmPreference` preference variable.
18+
The default setting of `$ConfirmPreference` is **High**. Therefore, in the default environment, only
19+
cmdlets and providers that specify a high-impact action request confirmation.
2120

2221
If **Confirm** is explicitly set to false (`-Confirm:$false`), the cmdlet runs without prompting for
2322
confirmation and the `$ConfirmPreference` shell variable is ignored.
2423

2524
## Remarks
2625

2726
- For cmdlets and providers that specify `SupportsShouldProcess`, but not `ConfirmImpact`, those
28-
actions are handled as "medium impact" actions, and they will not prompt by default. Their impact
27+
actions are handled as `Medium` impact actions, and they will not prompt by default. Their impact
2928
level is less than the default setting of the `$ConfirmPreference` preference variable.
3029

3130
- If the user specifies the `Verbose` parameter, they will be notified of the operation even if they

reference/docs-conceptual/security/app-control/application-control.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ For more information about AppLocker and WDAC, see [Application Controls for Win
3131
3232
## WDAC policy enforcement
3333

34-
When PowerShell runs under a WDAC policy, its behavior changes based on the defined security
35-
policy. Under a WDAC policy, PowerShell runs trusted scripts and modules allowed by the policy in
34+
When PowerShell runs under a WDAC policy, its behavior changes based on the defined security policy.
35+
Under a WDAC policy, PowerShell runs trusted scripts and modules allowed by the policy in
3636
`FullLanguage` mode. All other scripts and script blocks are untrusted and run in
3737
`ConstrainedLanguage` mode. PowerShell throws errors when the untrusted scripts attempt to perform
3838
actions that aren't allowed in `ConstrainedLanguage` mode. It can be difficult to know why a script
@@ -41,9 +41,9 @@ failed to run correctly in `ConstrainedLanguage` mode.
4141
## WDAC policy auditing
4242

4343
PowerShell 7.4 added a new feature to support WDAC policies in **Audit** mode. In audit mode,
44-
PowerShell runs the untrusted scripts in `ConstrainedLanguage` mode without errors, but logs messages
45-
to the event log instead. The log messages describe what restrictions would apply if the policy were
46-
in **Enforce** mode.
44+
PowerShell runs the untrusted scripts in `ConstrainedLanguage` mode without errors, but logs
45+
messages to the event log instead. The log messages describe what restrictions would apply if the
46+
policy were in **Enforce** mode.
4747

4848
## History of changes
4949

@@ -54,9 +54,10 @@ described in the later versions include those from earlier versions.
5454

5555
### Changes in PowerShell 7.4
5656

57-
On Windows, when PowerShell runs under a Windows Defender Application Control (WDAC) policy, its behavior changes based on the defined security policy. Under a WDAC policy, PowerShell runs
58-
trusted scripts and modules allowed by the policy in `FullLanguage` mode. All other scripts and
59-
script blocks are untrusted and run in `ConstrainedLanguage` mode. PowerShell throws errors when the
57+
On Windows, when PowerShell runs under a Windows Defender Application Control (WDAC) policy, its
58+
behavior changes based on the defined security policy. Under a WDAC policy, PowerShell runs trusted
59+
scripts and modules allowed by the policy in `FullLanguage` mode. All other scripts and script
60+
blocks are untrusted and run in `ConstrainedLanguage` mode. PowerShell throws errors when the
6061
untrusted scripts attempt to perform disallowed actions. It's difficult to know why a script fails
6162
to run correctly in `ConstrainedLanguage` mode.
6263

@@ -67,7 +68,8 @@ throwing errors. The log messages describe what restrictions would apply if the
6768

6869
### Changes in PowerShell 7.3
6970

70-
- PowerShell 7.3 now supports the ability to block or allow PowerShell script files via the WDAC API.
71+
- PowerShell 7.3 now supports the ability to block or allow PowerShell script files via the WDAC
72+
API.
7173

7274
### Changes in PowerShell 7.2
7375

reference/docs-conceptual/security/app-control/how-to-use-wdac.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ can configure the policy to enforce or audit the policy's rule. In audit mode, P
1010
doesn't change but it logs Event ID 16387 messages to the `PowerShellCore/Analytic` event log. In
1111
enforcement mode, PowerShell applies the policy's restrictions.
1212

13-
This article assumes you're using a test machine so that you can test PowerShell behavior
14-
under a machine wide WDAC policy before you deploy the policy in your environment.
13+
This article assumes you're using a test machine so that you can test PowerShell behavior under a
14+
machine wide WDAC policy before you deploy the policy in your environment.
1515

1616
## Create a WDAC policy
1717

@@ -21,8 +21,8 @@ approved files are allowed to load and run. PowerShell either blocks unapproved
2121
running or runs them in `ConstrainedLanguage` mode, depending on policy options.
2222

2323
You create and manipulate WDAC policy using the **ConfigCI** module, which is available on all
24-
supported Windows versions. This Windows PowerShell module can be used in Windows PowerShell 5.1
25-
or in PowerShell 7 through the **Windows Compatibility** layer. It's easier to use this module in
24+
supported Windows versions. This Windows PowerShell module can be used in Windows PowerShell 5.1 or
25+
in PowerShell 7 through the **Windows Compatibility** layer. It's easier to use this module in
2626
Windows PowerShell. The policy you create can be applied to any version of PowerShell.
2727

2828
## Steps to create a WDAC policy
@@ -44,8 +44,8 @@ For testing, you just need to create a default policy and a self signed code sig
4444
1. Disable Audit Mode in default policy
4545

4646
A new policy is always created in `Audit` mode. To test policy enforcement, you need to disable
47-
Audit mode when you apply the policy. Edit the `SystemCIPolicy.xml` file using a text editor
48-
like `notepad.exe` or Visual Studio Code (VS Code). Comment out the `Audit mode` option.
47+
Audit mode when you apply the policy. Edit the `SystemCIPolicy.xml` file using a text editor like
48+
`notepad.exe` or Visual Studio Code (VS Code). Comment out the `Audit mode` option.
4949

5050
```XML
5151
<!--

reference/docs-conceptual/security/app-control/how-wdac-works.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ and PowerShell you're using.
1212
## How PowerShell detects a system lockdown policy
1313

1414
PowerShell detects both **AppLocker** and **Windows Defender Application Control** (WDAC) system
15-
wide polices. AppLocker is deprecated. WDAC is the preferred application control system for
16-
Windows.
15+
wide polices. AppLocker is deprecated. WDAC is the preferred application control system for Windows.
1716

1817
### Legacy WDAC policy enforcement detection
1918

@@ -44,8 +43,8 @@ PowerShell can run in both interactive and non-interactive modes.
4443

4544
- In interactive mode, PowerShell is a command-line application that takes users command-line input
4645
as commands or scripts to run. Results are displayed back to the user.
47-
- In non-interactive mode, PowerShell loads modules and runs script files without user
48-
input. Result data streams are either ignored or redirected to a file.
46+
- In non-interactive mode, PowerShell loads modules and runs script files without user input. Result
47+
data streams are either ignored or redirected to a file.
4948

5049
### Interactive mode running under policy enforcement
5150

@@ -61,8 +60,8 @@ for the file.
6160
PowerShell version 7.3 or higher uses the `WldpCanExecuteFile` API if available. This API returns one
6261
of the following results:
6362

64-
- `WLDP_CAN_EXECUTE_ALLOWED`: The file is approved by policy and is used in `FullLanguage` mode
65-
with a few restrictions.
63+
- `WLDP_CAN_EXECUTE_ALLOWED`: The file is approved by policy and is used in `FullLanguage` mode with
64+
a few restrictions.
6665
- `WLDP_CAN_EXECUTE_BLOCKED`: The file isn't approved by policy. PowerShell throws an error when the
6766
file is run or loaded.
6867
- `WLDP_CAN_EXECUTE_REQUIRE_SANDBOX`: The file isn't approved by the policy but it can still be run
@@ -78,26 +77,27 @@ behavior is:
7877

7978
## PowerShell restrictions under lockdown policy
8079

81-
When PowerShell detects the system is under a WDAC lockdown policy, it applies restrictions
82-
even if the script is trusted and running in `FullLanguage` mode. These restrictions prevent known
83-
behaviors of PowerShell that could result in arbitrary code execution on a locked-down system. The
84-
lockdown policy enforces the following restrictions:
80+
When PowerShell detects the system is under a WDAC lockdown policy, it applies restrictions even if
81+
the script is trusted and running in `FullLanguage` mode. These restrictions prevent known behaviors
82+
of PowerShell that could result in arbitrary code execution on a locked-down system. The lockdown
83+
policy enforces the following restrictions:
8584

8685
- Module dot-sourcing with wildcard function export restriction
8786

88-
Any module that uses script dot-sourcing and exports functions using wildcard names results
89-
in an error. Blocking wildcard exports prevents script injection from a malicious user who can
90-
plant an untrusted script that gets dot-sourced into a trusted module. The malicious script could then gain access to the trusted module's private functions.
87+
Any module that uses script dot-sourcing and exports functions using wildcard names results in an
88+
error. Blocking wildcard exports prevents script injection from a malicious user who can plant an
89+
untrusted script that gets dot-sourced into a trusted module. The malicious script could then gain
90+
access to the trusted module's private functions.
9191

9292
**Security recommendation:** Never use script dot-sourcing in a module and always export module
9393
functions with explicit names (no wildcard characters).
9494

9595
- Nested module with wildcard function export restriction
9696

97-
If a parent module exports functions using function name wildcard characters, PowerShell
98-
removes any function name in a nested module from the function export list. Blocking wildcard exports
99-
from nested modules prevents accidental exporting of dangerous nested functions through wildcard
100-
name matching.
97+
If a parent module exports functions using function name wildcard characters, PowerShell removes
98+
any function name in a nested module from the function export list. Blocking wildcard exports from
99+
nested modules prevents accidental exporting of dangerous nested functions through wildcard name
100+
matching.
101101

102102
**Security recommendation:** Always export module functions with explicit names (no wildcard
103103
characters).
@@ -223,8 +223,8 @@ command, PowerShell either blocks the command from running (new behavior) or run
223223

224224
- Type method invocation not allowed
225225

226-
`ConstrainedLanguage` mode doesn't allow method invocation on unapproved types. Blocking methods on
227-
unapproved types prevents invocation of .NET type methods that might be dangerous or allow code
226+
`ConstrainedLanguage` mode doesn't allow method invocation on unapproved types. Blocking methods
227+
on unapproved types prevents invocation of .NET type methods that might be dangerous or allow code
228228
injection.
229229

230230
- Type property setters not allowed

reference/docs-conceptual/security/security-features.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ For more information, see the following articles:
4949
## AMSI Support
5050

5151
The Windows Antimalware Scan Interface (AMSI) is an API that allows applications to pass actions to
52-
an antimalware scanner, such as Windows Defender, to scan for malicious payloads. Beginning
53-
with PowerShell 5.1, PowerShell running on Windows 10 (and higher) passes all script blocks to AMSI.
52+
an antimalware scanner, such as Windows Defender, to scan for malicious payloads. Beginning with
53+
PowerShell 5.1, PowerShell running on Windows 10 (and higher) passes all script blocks to AMSI.
5454

5555
PowerShell 7.3 extends the data that's sent to AMSI for inspection. It now includes all invocations
5656
of .NET method members.
@@ -59,8 +59,8 @@ For more information about AMSI, see [How AMSI helps][09].
5959

6060
## Constrained language mode
6161

62-
**ConstrainedLanguage** mode protects your system by limiting the cmdlets and .NET types
63-
allowed in a PowerShell session. For a full description, see [about_Language_Modes][04].
62+
**ConstrainedLanguage** mode protects your system by limiting the cmdlets and .NET types allowed in
63+
a PowerShell session. For a full description, see [about_Language_Modes][04].
6464

6565
## Application Control
6666

@@ -88,8 +88,8 @@ You can find SBOM files in the following locations:
8888
- For modules, find the SBOM in the module's folder under `_manifest/spdx_2.2/manifest.spdx.json`.
8989

9090
The creation and publishing of the SBOM is the first step to modernize Federal Government
91-
cybersecurity and enhance software supply chain security. For more information about this initiative,
92-
see the blog post [Generating Software Bills of Materials (SBOMs) with SPDX at Microsoft][11].
91+
cybersecurity and enhance software supply chain security. For more information about this
92+
initiative, see the blog post [Generating SBOMs with SPDX at Microsoft][11].
9393

9494
## Security Servicing Criteria
9595

0 commit comments

Comments
 (0)