Skip to content

Commit a9cf20c

Browse files
sdwheelerCopilot
andauthored
Freshness update - part 3 (#12568)
* Freshness update - part 3 * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 83c98ee commit a9cf20c

File tree

9 files changed

+149
-169
lines changed

9 files changed

+149
-169
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: This article explains the features of Application Control that can be used to secure your PowerShell environment.
3-
ms.date: 09/25/2025
3+
ms.date: 12/09/2025
44
title: Use App Control to secure PowerShell
55
---
66
# Use App Control to secure PowerShell
@@ -19,9 +19,9 @@ Control (WDAC), allows you to control which drivers and applications are allowed
1919
## Lockdown policy detection
2020

2121
PowerShell detects both AppLocker and App Control for Business system wide policies. AppLocker
22-
doesn't have way to query the policy enforcement status. To detect if a system wide application
23-
control policy is being enforced by AppLocker, PowerShell creates two temporary files and tests if
24-
they can be executed. The filenames use the following name format:
22+
doesn't have way to query the policy enforcement status. To detect that AppLocker is enforcing a
23+
policy, PowerShell creates two temporary files and tries to run them. The filenames use the
24+
following name format:
2525

2626
- `$Env:TEMP/__PSScriptPolicyTest_<random-8dot3-name>.ps1`
2727
- `$Env:TEMP/__PSScriptPolicyTest_<random-8dot3-name>.psm1`
@@ -35,8 +35,7 @@ security feature under the servicing criteria defined by the Microsoft Security
3535
> [!NOTE]
3636
> When [choosing between App Control or AppLocker][03], we recommend that you implement application
3737
> control using App Control for Business rather than AppLocker. Microsoft is no longer investing in
38-
> AppLocker. Although AppLocker may continue to receive security fixes, it won't receive feature
39-
> enhancements.
38+
> AppLocker. AppLocker will only receive security fixes.
4039
4140
## App Control policy enforcement
4241

@@ -59,7 +58,7 @@ policy were in **Enforce** mode.
5958
Windows PowerShell 5.1 was the first version of PowerShell to support App Control. The security
6059
features of App Control and AppLocker improve with each new release of PowerShell. The following
6160
sections describe how this support changed in each version of PowerShell. The changes are
62-
cumulative, so the features described in the later versions include those from earlier versions.
61+
cumulative, so the features described in the later versions include changes from earlier versions.
6362

6463
### Changes in PowerShell 7.4
6564

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: This article explains how App Control for Business works to secure PowerShell and the restrictions it imposes.
3-
ms.date: 09/19/2024
3+
ms.date: 12/09/2025
44
title: How App Control for Business works with PowerShell
55
---
66
# How App Control works with PowerShell
@@ -25,11 +25,11 @@ All versions of PowerShell (v5.1 - v7.x) support this App Control policy detecti
2525

2626
### Latest App Control policy enforcement detection
2727

28-
App Control introduced new APIs in recent versions of Windows. Beginning with version 7.3, PowerShell uses
29-
the new `WldpCanExecuteFile` API to decide how a file should be handled. Windows PowerShell 5.1
30-
doesn't support this new API. The new API takes precedence over the legacy API for individual files.
31-
However, PowerShell continues to use the legacy API to get the system wide policy configuration. If
32-
the new API isn't available, PowerShell falls back to the old API behavior.
28+
App Control introduced new APIs in recent versions of Windows. Beginning with version 7.3,
29+
PowerShell uses the new `WldpCanExecuteFile` API to decide how a file should be handled. Windows
30+
PowerShell 5.1 doesn't support this new API. The new API takes precedence over the legacy API for
31+
individual files. However, PowerShell continues to use the legacy API to get the system wide policy
32+
configuration. If the new API isn't available, PowerShell falls back to the old API behavior.
3333

3434
The new API provides the following information for each file:
3535

@@ -54,18 +54,18 @@ this mode, see the [PowerShell restrictions under lockdown policy][02] section o
5454

5555
### Noninteractive mode running under policy enforcement
5656

57-
When PowerShell runs a script or loads a module, it uses the App Control API to get the policy enforcement
58-
for the file.
57+
When PowerShell runs a script or loads a module, it uses the App Control API to get the policy
58+
enforcement for the file.
5959

60-
PowerShell version 7.3 or higher uses the `WldpCanExecuteFile` API if available. This API returns one
61-
of the following results:
60+
PowerShell version 7.3 or higher uses the `WldpCanExecuteFile` API if available. This API returns
61+
one of the following results:
6262

63-
- `WLDP_CAN_EXECUTE_ALLOWED`: The file is approved by policy and is used in `FullLanguage` mode with
64-
a few restrictions.
65-
- `WLDP_CAN_EXECUTE_BLOCKED`: The file isn't approved by policy. PowerShell throws an error when the
63+
- `WLDP_CAN_EXECUTE_ALLOWED`: The policy allows the file for use in `FullLanguage` mode with a few
64+
restrictions.
65+
- `WLDP_CAN_EXECUTE_BLOCKED`: The policy disallows the file. PowerShell throws an error when the
6666
file is run or loaded.
67-
- `WLDP_CAN_EXECUTE_REQUIRE_SANDBOX`: The file isn't approved by the policy but it can still be run
68-
or loaded in `ConstrainedLanguage` mode.
67+
- `WLDP_CAN_EXECUTE_REQUIRE_SANDBOX`: The policy doesn't approve the file, but it can be run or
68+
loaded in `ConstrainedLanguage` mode.
6969

7070
In Windows PowerShell 5.1 or if `WldpCanExecuteFile` API isn't available, PowerShell's per file
7171
behavior is:
@@ -77,7 +77,7 @@ behavior is:
7777

7878
## PowerShell restrictions under lockdown policy
7979

80-
When PowerShell detects the system is under a App Control lockdown policy, it applies restrictions even if
80+
When PowerShell detects the system is under an App Control lockdown policy, it applies restrictions even if
8181
the script is trusted and running in `FullLanguage` mode. These restrictions prevent known behaviors
8282
of PowerShell that could result in arbitrary code execution on a locked-down system. The lockdown
8383
policy enforces the following restrictions:
@@ -128,7 +128,7 @@ policy enforces the following restrictions:
128128

129129
## PowerShell restrictions under constrained language mode
130130

131-
Script or function that isn't approved by the App Control policy is untrusted. When you run an untrusted
131+
A script or function not approved by the App Control policy is untrusted. When you run an untrusted
132132
command, PowerShell either blocks the command from running (new behavior) or runs the command in
133133
`ConstrainedLanguage` mode. The following restrictions apply to `ConstrainedLanguage` mode:
134134

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: This article explains how to configure and use App Control to secure PowerShell.
3-
ms.date: 10/21/2024
3+
ms.date: 12/09/2025
44
title: How to use App Control to secure PowerShell
55
---
66
# How to use App Control to secure PowerShell
@@ -157,8 +157,8 @@ information helps you understand where you need to change your script so that it
157157
policy.
158158

159159
> [!IMPORTANT]
160-
> Once you have reviewed the audit events, you should disable the Analytic log. Analytic logs grow
161-
> quickly and consume large amounts of disk space.
160+
> After you review the audit events, you should disable the Analytic log. Analytic logs grow quickly
161+
> and consume large amounts of disk space.
162162
163163
### Viewing audit events in the PowerShell debugger
164164

reference/docs-conceptual/security/preventing-script-injection.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: This article explains how to prevent script injection attacks using single quote escaping.
3-
ms.date: 02/10/2023
3+
ms.date: 12/09/2025
44
title: Preventing script injection attacks
55
---
66
# Preventing script injection attacks
@@ -12,12 +12,12 @@ vulnerability. For example, a malicious user could abuse the vulnerable function
1212
code on a remote computer, possibly compromising that computer and gaining access to other machines
1313
on the network.
1414

15-
Once you are aware of the issue, there are several ways to protect against injection attacks.
15+
Once you're aware of the issue, there are several ways to protect against injection attacks.
1616

1717
## Example of vulnerable code
1818

1919
PowerShell code injection vulnerabilities involve user input that contains script code. The user
20-
input is added to vulnerable script where it's parsed and run by PowerShell.
20+
input is added to vulnerable script where PowerShell parses and runs it.
2121

2222
```powershell
2323
function Get-ProcessById
@@ -30,8 +30,8 @@ function Get-ProcessById
3030

3131
The `Get-ProcessById` function looks up a local process by its Id value. It takes a `$ProcId`
3232
parameter argument of any type. The `$ProcId` is then converted to a string and inserted into
33-
another script that's parsed and run using the `Invoke-Expression` cmdlet. This function works fine
34-
when a valid process Id integer is passed in.
33+
another script. `Invoke-Expression` cmdlet parses and runs the provided string. This function works
34+
fine when a valid process Id integer is passed in.
3535

3636
```powershell
3737
Get-ProcessById $PID
@@ -141,8 +141,8 @@ Get-Process: Cannot bind parameter 'Id'. Cannot convert value "8064; Write-Host
141141
"System.Int32". Error: "The input string '8064; Write-Host' was not in a correct format."
142142
```
143143

144-
However, this version of the function isn't yet completely safe from injection attacks. A malicious
145-
user can still use single quotes in their input to inject code.
144+
However, this version of the function isn't safe from injection attacks. A malicious user can still
145+
use single quotes in their input to inject code.
146146

147147
```powershell
148148
Get-ProcessById "$PID'; Write-Host 'pwnd!';'"
@@ -160,10 +160,11 @@ pwnd!
160160

161161
#### Use the `EscapeSingleQuotedStringContent()` method
162162

163-
To protect against the user inserting their own single quote characters to exploit the function you
164-
must use the `EscapeSingleQuotedStringContent()` API. This is a static public method of the PowerShell
165-
**System.Management.Automation.Language.CodeGeneration** class. This method makes the user input safe
166-
by escaping any single quotes included in the user input.
163+
To protect against the user inserting their own single quote characters to exploit the function, you
164+
must use the `EscapeSingleQuotedStringContent()` API. `EscapeSingleQuotedStringContent()` is a
165+
public static method of the PowerShell **System.Management.Automation.Language.CodeGeneration**
166+
class. This method makes the user-provided input safe by escaping any single quotes included in the
167+
user input.
167168

168169
```powershell
169170
function Get-ProcessById
@@ -198,8 +199,8 @@ Install-Module InjectionHunter
198199
Install-PSResource InjectionHunter
199200
```
200201

201-
You can use this to automate security analysis during builds, continuous integration processes,
202-
deployments, and other scenarios.
202+
You can use this module to automate security analysis during builds, continuous integration
203+
processes, deployments, and other scenarios.
203204

204205
```powershell
205206
$RulePath = (Get-Module -List InjectionHunter).Path
@@ -223,15 +224,13 @@ InjectionRisk.InvokeExpression Warning Invoke-Dan 3 Possible scrip
223224

224225
For more information, see [PSScriptAnalyzer][02].
225226

226-
<!-- TODO: Add instructions for VS Code once it gets fixed -->
227-
228227
## Related links
229228

230229
- [Lee Holmes' blog post about Injection Hunter][03]
231230
- [Injection Hunter][04]
232231

233232
<!-- link references -->
234-
[01]: /dotnet/api/system.management.automation.language.codegeneration.escapesinglequotedstringcontent
233+
[01]: xref:System.Management.Automation.Language.CodeGeneration.EscapeSingleQuotedStringContent%2A
235234
[02]: /powershell/utility-modules/psscriptanalyzer/overview
236235
[03]: https://devblogs.microsoft.com/powershell/powershell-injection-hunter-security-auditing-for-powershell-scripts/
237236
[04]: https://www.powershellgallery.com/packages/InjectionHunter

reference/docs-conceptual/security/remoting/PS-remoting-second-hop.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
description: This article explains the various methods for configuring second-hop authentication for PowerShell remoting, including the security implications and recommendations.
3-
ms.date: 10/23/2023
3+
ms.date: 12/09/2025
44
title: Making the second hop in PowerShell Remoting
55
---
66

77
# Making the second hop in PowerShell Remoting
88

9-
The "second hop problem" refers to a situation like the following:
9+
The following scenario outlines the _second hop problem_:
1010

11-
1. You are logged in to _ServerA_.
11+
1. You're logged in to _ServerA_.
1212
1. From _ServerA_, you start a remote PowerShell session to connect to _ServerB_.
1313
1. A command you run on _ServerB_ via your PowerShell Remoting session attempts to access a resource
1414
on _ServerC_.
@@ -86,9 +86,9 @@ transition.
8686
8787
## Resource-based Kerberos constrained delegation
8888

89-
Using resource-based Kerberos constrained delegation (introduced in Windows Server 2012), you
90-
configure credential delegation on the server object where resources reside. In the second hop
91-
scenario described above, you configure _ServerC_ to specify from where it accepts delegated
89+
Windows Server 2012 introduced resource-based Kerberos constrained delegation. You configure
90+
credential delegation on the server object where resources reside. In the second hop scenario
91+
described previously, you configure _ServerC_ to specify from where it accepts delegated
9292
credentials.
9393

9494
### Pros
@@ -113,8 +113,8 @@ credentials.
113113
### Example
114114

115115
Let's look at a PowerShell example that configures resource-based constrained delegation on
116-
_ServerC_ to allow delegated credentials from a _ServerB_. This example assumes that all servers are
117-
running supported versions of Windows Server, and that there is at least one Windows domain
116+
_ServerC_ that allow delegated credentials from a _ServerB_. This example assumes that all servers
117+
are running supported versions of Windows Server, and that there is at least one Windows domain
118118
controller for each trusted domain.
119119

120120
Before you can configure constrained delegation, you must add the `RSAT-AD-PowerShell` feature to
@@ -140,11 +140,11 @@ Cmdlet Set-ADUser ActiveDirectory
140140
```
141141

142142
The **PrincipalsAllowedToDelegateToAccount** parameter sets the Active Directory object attribute
143-
**msDS-AllowedToActOnBehalfOfOtherIdentity**, which contains an access control list (ACL) that
144-
specifies which accounts have permission to delegate credentials to the associated account (in our
145-
example, it will be the machine account for _ServerA_).
143+
**msDS-AllowedToActOnBehalfOfOtherIdentity**. This attribute contains an access control list (ACL)
144+
that specifies the accounts that have permission to delegate credentials to the associated account.
145+
For this example, it's the machine account for _ServerA_.
146146

147-
Now let's set up the variables we'll use to represent the servers:
147+
Now let's create the variables that represent the servers:
148148

149149
```powershell
150150
# Set up variables for reuse
@@ -182,8 +182,8 @@ Get-ADComputer -Identity $ServerC -Properties PrincipalsAllowedToDelegateToAccou
182182
```
183183

184184
The Kerberos [Key Distribution Center (KDC)][13] caches denied-access attempts (negative cache) for
185-
15 minutes. If _ServerB_ has previously attempted to access _ServerC_, you need to clear the
186-
cache on _ServerB_ by invoking the following command:
185+
15 minutes. If _ServerB_ previously attempted to access _ServerC_, you need to clear the cache on
186+
_ServerB_ by invoking the following command:
187187

188188
```powershell
189189
Invoke-Command -ComputerName $ServerB.Name -Credential $cred -ScriptBlock {
@@ -232,7 +232,7 @@ Set-ADComputer -Identity $ServerC -PrincipalsAllowedToDelegateToAccount $servers
232232
```
233233

234234
If you want to make the second hop across domains, use the **Server** parameter to specify
235-
fully-qualified domain name (FQDN) of the domain controller of the domain to which _ServerB_
235+
fully qualified domain name (FQDN) of the domain controller of the domain to which _ServerB_
236236
belongs:
237237

238238
```powershell

reference/docs-conceptual/security/remoting/Running-Remote-Commands.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Explains the methods for running commands on remote systems using PowerShell.
3-
ms.date: 07/03/2023
3+
ms.date: 12/09/2025
44
title: Running Remote Commands
55
---
66
# Running Remote Commands
@@ -48,15 +48,15 @@ Get-Command | Where-Object {
4848

4949
## Windows PowerShell remoting
5050

51-
Using the WS-Management protocol, Windows PowerShell remoting lets you run any Windows PowerShell
51+
By using the WS-Management protocol, Windows PowerShell remoting lets you run any Windows PowerShell
5252
command on one or more remote computers. You can establish persistent connections, start interactive
5353
sessions, and run scripts on remote computers.
5454

5555
To use Windows PowerShell remoting, the remote computer must be configured for remote management.
5656
For more information, including instructions, see [About Remote Requirements][04].
5757

58-
Once you have configured Windows PowerShell remoting, many remoting strategies are available to you.
59-
This article lists just a few of them. For more information, see [About Remote][02].
58+
Once you configure Windows PowerShell remoting, many remoting strategies are available to you. This
59+
article lists just a few of them. For more information, see [About Remote][02].
6060

6161
### Start an interactive session
6262

reference/docs-conceptual/security/remoting/WSMan-Remoting-in-PowerShell.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
description: Remoting in PowerShell using WSMan
3-
ms.date: 01/27/2025
3+
ms.date: 12/09/2025
44
title: Using WS-Management (WSMan) Remoting in PowerShell
55
---
66
# Using WS-Management (WSMan) Remoting in PowerShell
77

88
## Enabling PowerShell remoting
99

10-
To enable PowerShell remoting run the `Enable-PSRemoting` cmdlet in an elevated PowerShell session.
10+
To enable PowerShell remoting, run the `Enable-PSRemoting` cmdlet in an elevated PowerShell session.
1111
Running `Enable-PSRemoting` configures a remoting endpoint for the specific installation version
12-
that you are running the cmdlet in. For example, when you run `Enable-PSRemoting` while running
12+
that you're running the cmdlet in. For example, when you run `Enable-PSRemoting` while running
1313
PowerShell 7.4, PowerShell creates a remoting endpoint runs PowerShell 7.4. If you run
1414
`Enable-PSRemoting` while running PowerShell 7-preview, PowerShell creates a remoting endpoint that
1515
runs PowerShell 7-preview. You can create multiple remoting endpoints for different versions of that
@@ -41,22 +41,13 @@ of Windows.
4141
## WSMan remoting isn't supported on non-Windows platforms
4242

4343
Since the release of PowerShell 6, support for remoting over WS-Management (WSMan) on non-Windows
44-
platforms has only been available to a limited set of Linux distributions. All versions of those
45-
distributions that supported WSMan are no longer supported by the Linux vendors that created them.
44+
platforms is only available to a limited set of Linux distributions. On non-Windows, WSMan relied on
45+
the [Open Management Infrastructure (OMI)][02] project. The OMI WSMan client depends on **OpenSSL
46+
1.0**. All Linux distributions use **OpenSSL 2.0**, which isn't backward-compatible. There are no
47+
supported distributions that have the dependencies needed for the OMI WSMan client to work.
4648

47-
On non-Windows, WSMan relied on the [Open Management Infrastructure (OMI)][02] project, which no
48-
longer supports PowerShell remoting. The OMI WSMan client is dependent on **OpenSSL 1.0**. Most
49-
Linux distributions have moved to **OpenSSL 2.0**, which isn't backward-compatible. At this time,
50-
there is no supported distribution that has the dependencies needed for the OMI WSMan client to
51-
work.
52-
53-
The outdated libraries and supporting code have been removed for non-Windows platforms. WSMan-based
54-
remoting is still supported between Windows systems. Remoting over SSH is supported for all
55-
platforms. For more information, see [PowerShell remoting over SSH][05].
56-
57-
> [!NOTE]
58-
> Users may be able to get WSMan remoting to work using the [PSWSMan][04] module. This module isn't
59-
> supported or maintained by Microsoft.
49+
WSMan-based remoting is still supported between Windows systems. Remoting over SSH is supported for
50+
all platforms. For more information, see [PowerShell remoting over SSH][05].
6051

6152
## Further reading
6253

reference/docs-conceptual/security/remoting/WinRM-Security.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: This document covers security concerns, recommendations, and best practices when using PowerShell Remoting.
3-
ms.date: 03/24/2025
3+
ms.date: 12/09/2025
44
title: Security considerations for PowerShell Remoting using WinRM
55
---
66

@@ -113,8 +113,8 @@ authentication protocol.
113113

114114
- Basic authentication provides no encryption.
115115
- NTLM authentication uses an RC4 cipher with a 128-bit key.
116-
- The `etype` in the TGS ticket determines Kerberos authentication encryption. This is AES-256
117-
on modern systems.
116+
- The `etype` in the TGS ticket determines Kerberos authentication encryption. Modern systems use
117+
the AES-256 algorithm.
118118
- CredSSP encryption uses the TLS cipher suite negotiated in the handshake.
119119

120120
## Making the second hop

0 commit comments

Comments
 (0)