AWS Security ChangesHomeSearch

AWS code-library documentation change

Service: code-library · 2025-06-28 · Documentation low

File: code-library/latest/ug/ssm_example_ssm_StartSession_section.md

Summary

Added multiple PowerShell V5 examples for Start-SSMSession including port forwarding, interactive sessions, and session creation without plugin invocation

Security assessment

The examples demonstrate Session Manager functionality but do not explicitly address security vulnerabilities or document new security features. The -DisablePluginInvocation parameter is operational rather than security-focused.

Diff

diff --git a/code-library/latest/ug/ssm_example_ssm_StartSession_section.md b/code-library/latest/ug/ssm_example_ssm_StartSession_section.md
index b7b7ad207..b00f6cb2f 100644
--- a//code-library/latest/ug/ssm_example_ssm_StartSession_section.md
+++ b//code-library/latest/ug/ssm_example_ssm_StartSession_section.md
@@ -73,0 +74,55 @@ PowerShell
+**Tools for PowerShell V5**
+    
+
+**Example 1: This example initiates a connection to a target for a Session Manager session, enabling port forwarding. Note: You need to add Region parameter if not already set using AWSCredentials.**
+    
+    
+    Start-SSMSession -Target 'i-064578e5e7454488f' -DocumentName 'AWS-StartPortForwardingSession' -Parameter @{ localPortNumber = '8080'; portNumber = '80' } -Region 'us-west-1'
+    
+
+**Output:**
+    
+    
+    Starting session with SessionId: testUser-xi4glew849asyeryde34u4dfsdfy
+    Port 8080 opened for sessionId testUser-xi4glew849asyeryde34u4dfsdfy.
+    Waiting for connections...
+
+**Example 2: This example creates an interactive session with a specified instance for a Session Manager session.**
+    
+    
+    Start-SSMSession -Target 'i-1234567890abcdef0' -Region 'us-west-1'
+    
+
+**Output:**
+    
+    
+    Starting session with SessionId : testUser-xi4glew849asyeryde34u4dfsdfy
+    Windows PowerShell
+    Copyright (C) Microsoft Corporation. All rights reserved.
+                                                                                                                                                                                                    
+    Install the latest PowerShell for new features and improvements!
+                                                                                                                                                          
+    PS C:\Windows\system32> whoami
+    ec2amaz-fnsdrwv\ec2-test-user
+    PS C:\Windows\system32>
+
+**Example 3: This example creates a session without connecting to it and returns the SessionId, StreamUrl, and TokenValue properties required to connect to the session.**
+    
+    
+    Start-SSMSession -Target 'i-1234567890abcdef0' -Region 'us-west-1' -DisablePluginInvocation
+    
+
+**Output:**
+    
+    
+    SessionId        : testUser-xi4glew849asyeryde34u4dfsdfy
+    StreamUrl        : {StreamUrl value redacted}
+    TokenValue       : {Token value redacted}
+    ContentLength    : 1207
+    HttpStatusCode   : OK
+
+  * For API details, see [StartSession](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. 
+
+
+
+