You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/docs-conceptual/security/app-control/application-control.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,8 @@ For more information about AppLocker and WDAC, see [Application Controls for Win
31
31
32
32
## WDAC policy enforcement
33
33
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
36
36
`FullLanguage` mode. All other scripts and script blocks are untrusted and run in
37
37
`ConstrainedLanguage` mode. PowerShell throws errors when the untrusted scripts attempt to perform
38
38
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.
41
41
## WDAC policy auditing
42
42
43
43
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.
47
47
48
48
## History of changes
49
49
@@ -54,9 +54,10 @@ described in the later versions include those from earlier versions.
54
54
55
55
### Changes in PowerShell 7.4
56
56
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
60
61
untrusted scripts attempt to perform disallowed actions. It's difficult to know why a script fails
61
62
to run correctly in `ConstrainedLanguage` mode.
62
63
@@ -67,7 +68,8 @@ throwing errors. The log messages describe what restrictions would apply if the
67
68
68
69
### Changes in PowerShell 7.3
69
70
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
Copy file name to clipboardExpand all lines: reference/docs-conceptual/security/app-control/how-wdac-works.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,8 +12,7 @@ and PowerShell you're using.
12
12
## How PowerShell detects a system lockdown policy
13
13
14
14
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.
17
16
18
17
### Legacy WDAC policy enforcement detection
19
18
@@ -44,8 +43,8 @@ PowerShell can run in both interactive and non-interactive modes.
44
43
45
44
- In interactive mode, PowerShell is a command-line application that takes users command-line input
46
45
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.
49
48
50
49
### Interactive mode running under policy enforcement
51
50
@@ -61,8 +60,8 @@ for the file.
61
60
PowerShell version 7.3 or higher uses the `WldpCanExecuteFile` API if available. This API returns one
62
61
of the following results:
63
62
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.
66
65
-`WLDP_CAN_EXECUTE_BLOCKED`: The file isn't approved by policy. PowerShell throws an error when the
67
66
file is run or loaded.
68
67
-`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:
78
77
79
78
## PowerShell restrictions under lockdown policy
80
79
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:
85
84
86
85
- Module dot-sourcing with wildcard function export restriction
87
86
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.
91
91
92
92
**Security recommendation:** Never use script dot-sourcing in a module and always export module
93
93
functions with explicit names (no wildcard characters).
94
94
95
95
- Nested module with wildcard function export restriction
96
96
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.
101
101
102
102
**Security recommendation:** Always export module functions with explicit names (no wildcard
103
103
characters).
@@ -223,8 +223,8 @@ command, PowerShell either blocks the command from running (new behavior) or run
223
223
224
224
- Type method invocation not allowed
225
225
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
0 commit comments