Skip to content

Commit 9c1a55a

Browse files
author
Donna-Marie Smith
committed
updated logging faqs to use a more secure script
1 parent b94ba64 commit 9c1a55a

9 files changed

Lines changed: 204 additions & 87 deletions

File tree

content/en/docs/2025.3/FAQs/change-logging-levels/change-all-logging.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,27 @@ To change logging levels for everything, the below PowerShell script can be used
1313
1. Copy the following script into the PowerShell window:
1414

1515
``` powershell
16-
$serverFQDN = "server.domain.com"
16+
$serverFQDN = "server.domain.com"
1717
$APIGatewayPort = 8722
18-
$loglevel = 4
19-
20-
$user = "UserName"
21-
$pass = Read-Host -Prompt "Enter Password for Basic Auth User"
22-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
18+
$loglevel = 4
19+
$user = "BasicAuthUser"
2320
21+
$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString
22+
23+
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
24+
try {
25+
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
26+
27+
$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
28+
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
29+
}
30+
finally {
31+
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
32+
33+
$plainPass = $null
34+
Remove-Variable -Name plainPass -Force
35+
}
36+
2437
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
2538
$headers.Add("Content-Type", "application/json")
2639
$headers.Add("Accept", "application/json")
@@ -30,8 +43,8 @@ To change logging levels for everything, the below PowerShell script can be used
3043
$loglevel
3144
"@
3245
33-
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method 'PUT' -Headers $headers -Body $body
34-
$response | ConvertTo-Json
46+
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
47+
$response
3548
```
3649
3750
1. Configure the following variables:
@@ -43,7 +56,7 @@ To change logging levels for everything, the below PowerShell script can be used
4356
1. Execute the script, entering the Basic Auth User's password when prompted.
4457
1. Confirm success response:
4558
46-
If the call was successful, the following response should be received
59+
If the call was successful, there should be no errors and the following response should be received
4760
4861
``` powershell
4962
LogLevel was successfully configured.

content/en/docs/2025.3/FAQs/change-logging-levels/change-block-logging.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,38 @@ To change logging levels for block logging so that every block is logged when ex
2929
1. Copy the following script into the PowerShell window:
3030

3131
``` powershell
32-
$serverFQDN = "server.domain.com"
32+
$serverFQDN = "server.domain.com"
3333
$APIGatewayPort = 8722
34-
$loglevel = 4
35-
36-
$user = "UserName"
37-
$pass = Read-Host -Prompt "Enter Password for Basic Auth User"
38-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
34+
$loglevel = 4
35+
$user = "BasicAuthUser"
3936
37+
$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString
38+
39+
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
40+
try {
41+
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
42+
43+
$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
44+
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
45+
}
46+
finally {
47+
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
48+
49+
$plainPass = $null
50+
Remove-Variable -Name plainPass -Force
51+
}
52+
4053
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
4154
$headers.Add("Content-Type", "application/json")
4255
$headers.Add("Accept", "application/json")
4356
$headers.Add("Authorization", "Basic $base64AuthInfo")
44-
$path = "applications/ execution/services/engine/blocks/packages/versions/executions/flows/workspaces/blocks/logging"
57+
$path = "applications/execution/services/engine/blocks/packages/versions/executions/flows/workspaces/blocks/logging"
4558
$body = @"
4659
$loglevel
4760
"@
4861
49-
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method 'PUT' -Headers $headers -Body $body
50-
$response | ConvertTo-Json
62+
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
63+
$response
5164
```
5265
5366
1. Configure the following variables:
@@ -59,7 +72,7 @@ To change logging levels for block logging so that every block is logged when ex
5972
1. Execute the script, entering the Basic Auth User's password when prompted.
6073
1. Confirm success response:
6174
62-
If the call was successful, the following response should be received
75+
If the call was successful, there should be no errors and the following response should be received
6376
6477
``` powershell
6578
LogLevel was successfully configured.

content/en/docs/2025.3/FAQs/change-logging-levels/change-flow-logging.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,38 @@ To change logging levels for Flow Logging, the below PowerShell script can be us
1313
1. Copy the following script into the PowerShell window:
1414

1515
``` powershell
16-
$serverFQDN = "server.domain.com"
16+
$serverFQDN = "server.domain.com"
1717
$APIGatewayPort = 8722
18-
$loglevel = 4
19-
20-
$user = "UserName"
21-
$pass = Read-Host -Prompt "Enter Password for Basic Auth User"
22-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
18+
$loglevel = 4
19+
$user = "BasicAuthUser"
2320
21+
$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString
22+
23+
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
24+
try {
25+
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
26+
27+
$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
28+
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
29+
}
30+
finally {
31+
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
32+
33+
$plainPass = $null
34+
Remove-Variable -Name plainPass -Force
35+
}
36+
2437
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
2538
$headers.Add("Content-Type", "application/json")
2639
$headers.Add("Accept", "application/json")
2740
$headers.Add("Authorization", "Basic $base64AuthInfo")
28-
$path = "applications/ execution/services/engine/blocks/packages/versions/executions/flows/logging"
41+
$path = "applications/execution/services/engine/blocks/packages/versions/executions/flows/logging"
2942
$body = @"
3043
$loglevel
3144
"@
3245
33-
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method 'PUT' -Headers $headers -Body $body
34-
$response | ConvertTo-Json
46+
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
47+
$response
3548
```
3649
3750
1. Configure the following variables:
@@ -43,7 +56,7 @@ To change logging levels for Flow Logging, the below PowerShell script can be us
4356
1. Execute the script, entering the Basic Auth User's password when prompted.
4457
1. Confirm success response:
4558
46-
If the call was successful, the following response should be received
59+
If the call was successful, there should be no errors and the following response should be received
4760
4861
``` powershell
4962
LogLevel was successfully configured.

content/en/docs/2025.9/FAQs/change-logging-levels/change-all-logging.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,27 @@ To change logging levels for everything, the below PowerShell script can be used
1313
1. Copy the following script into the PowerShell window:
1414

1515
``` powershell
16-
$serverFQDN = "server.domain.com"
16+
$serverFQDN = "server.domain.com"
1717
$APIGatewayPort = 8722
18-
$loglevel = 4
19-
20-
$user = "UserName"
21-
$pass = Read-Host -Prompt "Enter Password for Basic Auth User"
22-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
18+
$loglevel = 4
19+
$user = "BasicAuthUser"
2320
21+
$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString
22+
23+
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
24+
try {
25+
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
26+
27+
$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
28+
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
29+
}
30+
finally {
31+
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
32+
33+
$plainPass = $null
34+
Remove-Variable -Name plainPass -Force
35+
}
36+
2437
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
2538
$headers.Add("Content-Type", "application/json")
2639
$headers.Add("Accept", "application/json")
@@ -30,8 +43,8 @@ To change logging levels for everything, the below PowerShell script can be used
3043
$loglevel
3144
"@
3245
33-
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method 'PUT' -Headers $headers -Body $body
34-
$response | ConvertTo-Json
46+
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
47+
$response
3548
```
3649
3750
1. Configure the following variables:
@@ -43,7 +56,7 @@ To change logging levels for everything, the below PowerShell script can be used
4356
1. Execute the script, entering the Basic Auth User's password when prompted.
4457
1. Confirm success response:
4558
46-
If the call was successful, the following response should be received
59+
If the call was successful, there should be no errors and the following response should be received
4760
4861
``` powershell
4962
LogLevel was successfully configured.

content/en/docs/2025.9/FAQs/change-logging-levels/change-block-logging.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,38 @@ To change logging levels for block logging so that every block is logged when ex
2929
1. Copy the following script into the PowerShell window:
3030

3131
``` powershell
32-
$serverFQDN = "server.domain.com"
32+
$serverFQDN = "server.domain.com"
3333
$APIGatewayPort = 8722
34-
$loglevel = 4
35-
36-
$user = "UserName"
37-
$pass = Read-Host -Prompt "Enter Password for Basic Auth User"
38-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
34+
$loglevel = 4
35+
$user = "BasicAuthUser"
3936
37+
$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString
38+
39+
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
40+
try {
41+
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
42+
43+
$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
44+
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
45+
}
46+
finally {
47+
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
48+
49+
$plainPass = $null
50+
Remove-Variable -Name plainPass -Force
51+
}
52+
4053
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
4154
$headers.Add("Content-Type", "application/json")
4255
$headers.Add("Accept", "application/json")
4356
$headers.Add("Authorization", "Basic $base64AuthInfo")
44-
$path = "applications/ execution/services/engine/blocks/packages/versions/executions/flows/workspaces/blocks/logging"
57+
$path = "applications/execution/services/engine/blocks/packages/versions/executions/flows/workspaces/blocks/logging"
4558
$body = @"
4659
$loglevel
4760
"@
4861
49-
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method 'PUT' -Headers $headers -Body $body
50-
$response | ConvertTo-Json
62+
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
63+
$response
5164
```
5265
5366
1. Configure the following variables:
@@ -59,7 +72,7 @@ To change logging levels for block logging so that every block is logged when ex
5972
1. Execute the script, entering the Basic Auth User's password when prompted.
6073
1. Confirm success response:
6174
62-
If the call was successful, the following response should be received
75+
If the call was successful, there should be no errors and the following response should be received
6376
6477
``` powershell
6578
LogLevel was successfully configured.

content/en/docs/2025.9/FAQs/change-logging-levels/change-flow-logging.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,38 @@ To change logging levels for Flow Logging, the below PowerShell script can be us
1313
1. Copy the following script into the PowerShell window:
1414

1515
``` powershell
16-
$serverFQDN = "server.domain.com"
16+
$serverFQDN = "server.domain.com"
1717
$APIGatewayPort = 8722
18-
$loglevel = 4
19-
20-
$user = "UserName"
21-
$pass = Read-Host -Prompt "Enter Password for Basic Auth User"
22-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
18+
$loglevel = 4
19+
$user = "BasicAuthUser"
2320
21+
$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString
22+
23+
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
24+
try {
25+
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
26+
27+
$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
28+
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
29+
}
30+
finally {
31+
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
32+
33+
$plainPass = $null
34+
Remove-Variable -Name plainPass -Force
35+
}
36+
2437
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
2538
$headers.Add("Content-Type", "application/json")
2639
$headers.Add("Accept", "application/json")
2740
$headers.Add("Authorization", "Basic $base64AuthInfo")
28-
$path = "applications/ execution/services/engine/blocks/packages/versions/executions/flows/logging"
41+
$path = "applications/execution/services/engine/blocks/packages/versions/executions/flows/logging"
2942
$body = @"
3043
$loglevel
3144
"@
3245
33-
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method 'PUT' -Headers $headers -Body $body
34-
$response | ConvertTo-Json
46+
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
47+
$response
3548
```
3649
3750
1. Configure the following variables:
@@ -43,7 +56,7 @@ To change logging levels for Flow Logging, the below PowerShell script can be us
4356
1. Execute the script, entering the Basic Auth User's password when prompted.
4457
1. Confirm success response:
4558
46-
If the call was successful, the following response should be received
59+
If the call was successful, there should be no errors and the following response should be received
4760
4861
``` powershell
4962
LogLevel was successfully configured.

content/en/docs/2026.3/FAQs/change-logging-levels/change-all-logging.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,27 @@ To change logging levels for everything, the below PowerShell script can be used
1313
1. Copy the following script into the PowerShell window:
1414

1515
``` powershell
16-
$serverFQDN = "server.domain.com"
16+
$serverFQDN = "server.domain.com"
1717
$APIGatewayPort = 8722
18-
$loglevel = 4
19-
20-
$user = "UserName"
21-
$pass = Read-Host -Prompt "Enter Password for Basic Auth User"
22-
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user,$pass)))
18+
$loglevel = 4
19+
$user = "BasicAuthUser"
2320
21+
$securePass = Read-Host -Prompt "Enter password for $user" -AsSecureString
22+
23+
$ptr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($securePass)
24+
try {
25+
$plainPass = [Runtime.InteropServices.Marshal]::PtrToStringBSTR($ptr)
26+
27+
$authBytes = [System.Text.Encoding]::ASCII.GetBytes("$user`:$plainPass")
28+
$base64AuthInfo = [Convert]::ToBase64String($authBytes)
29+
}
30+
finally {
31+
[Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ptr)
32+
33+
$plainPass = $null
34+
Remove-Variable -Name plainPass -Force
35+
}
36+
2437
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
2538
$headers.Add("Content-Type", "application/json")
2639
$headers.Add("Accept", "application/json")
@@ -30,8 +43,8 @@ To change logging levels for everything, the below PowerShell script can be used
3043
$loglevel
3144
"@
3245
33-
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method 'PUT' -Headers $headers -Body $body
34-
$response | ConvertTo-Json
46+
$response = Invoke-RestMethod "https://${serverFQDN}:$APIGatewayPort/api/v1/default/default/$path" -Method PUT -Headers $headers -Body $body
47+
$response
3548
```
3649
3750
1. Configure the following variables:
@@ -43,7 +56,7 @@ To change logging levels for everything, the below PowerShell script can be used
4356
1. Execute the script, entering the Basic Auth User's password when prompted.
4457
1. Confirm success response:
4558
46-
If the call was successful, the following response should be received
59+
If the call was successful, there should be no errors and the following response should be received
4760
4861
``` powershell
4962
LogLevel was successfully configured.

0 commit comments

Comments
 (0)