-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/hide secrets deploy msi #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andrei-salanovich-ext-sefe
merged 11 commits into
main
from
feature/hide-secrets-DeployMSI
Oct 27, 2025
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1450ecc
Update DOrcDeployModule.psm1
dmitryrext 2ab6b70
Merge branch 'main' into feature/hide-secrets-DeployMSI
e0e7935
implement better masking secrets from output, including masking prop …
b6e66bb
fix masking function do it masks all real examples, move unit tests t…
6dfc835
fix function, and make tests load module with -force flag
25ae03f
Update DOrcDeployModule.psm1
andrei-salanovich-ext-sefe fabfcc6
Update DOrcDeployModule.psm1
andrei-salanovich-ext-sefe bacada9
return initial version of psm1
bf65d1e
Merge branch 'feature/hide-secrets-DeployMSI' of https://github.com/s…
052d5dc
implement only required fixes from initial code to avoid redundant ch…
eab28a3
return back changes for DOrcDeployModule.tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| $here = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| Import-Module "$here\DOrcDeployModule.psm1" -Force -ErrorAction Stop | ||
andrei-salanovich-ext-sefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Describe "Enhanced Parameter Security Tests" { | ||
| Context "Basic functionality" { | ||
| It "Hides sensitive parameter names" { | ||
| Format-ParameterForLogging "PASSWORD=secret123" | Should -Be "PASSWORD=***HIDDEN***" | ||
| } | ||
|
|
||
| It "Preserves non-sensitive parameters" { | ||
| Format-ParameterForLogging "SERVER=localhost" | Should -Be "SERVER=localhost" | ||
| } | ||
|
|
||
| It "Is case insensitive" { | ||
| Format-ParameterForLogging "my-Secret=test" | Should -Be "my-Secret=***HIDDEN***" | ||
| } | ||
| } | ||
|
|
||
| Context "Real secure property examples" { | ||
| It "Masks AccessKey in Azure SignalR connection string" { | ||
| $testInput = "SIGNALR_CONN=Endpoint=https://app.service.signalr.net;AccessKey=secret123;Version=1.0" | ||
| $result = Format-ParameterForLogging $testInput | ||
| $result | Should -Match "AccessKey=\*\*\*HIDDEN\*\*\*" | ||
| $result | Should -Match "Endpoint=https://app.service.signalr.net" | ||
| } | ||
|
|
||
| It "Masks Password in SQL connection string" { | ||
| $testInput = "DB_CONN=Server=srv;Database=db;Password=secret123;Timeout=30" | ||
| $result = Format-ParameterForLogging $testInput | ||
| $result | Should -Match "Password=\*\*\*HIDDEN\*\*\*" | ||
| $result | Should -Match "Server=srv" | ||
| } | ||
|
|
||
| It "Handles multiple secrets in one connection string" { | ||
| $testInput = "CONN=Server=test;Password=secret;AccessKey=key123;Database=mydb" | ||
| $result = Format-ParameterForLogging $testInput | ||
| $result | Should -Match "Password=\*\*\*HIDDEN\*\*\*" | ||
| $result | Should -Match "AccessKey=\*\*\*HIDDEN\*\*\*" | ||
andrei-salanovich-ext-sefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| $result | Should -Match "Server=test" | ||
| } | ||
|
|
||
| It "Masks all examples of secret values" { | ||
| $examples = @( | ||
| "APPUSERPASSWORD", "ProdDeployPassword", "ApiAccessPassword", "SERVICE_SVCPASSWORD", | ||
| "ClientSecret", "OAUTH_CLIENT_SECRET", "OAUTH2_CLIENTAPPID_SECRET", "CLIENT_PS_SECRET", "SqsSecretKey", | ||
| "OPENAI_API_KEY", "SqsAccessKey", "ApiKey", "API_APIKEY", "PrivateKeyPassphrase", "_API_KEY_", | ||
| "API_TOKEN", "VaultToken", "AccessTokenClientSecret", "EexToken", | ||
| "BasicAuthHeader" | ||
| ) | ||
| foreach ($example in $examples) { | ||
| Format-ParameterForLogging "$example=somesecret" | Should -Match "$example=\*\*\*HIDDEN\*\*\*" | ||
| } | ||
| } | ||
|
|
||
| } | ||
andrei-salanovich-ext-sefe marked this conversation as resolved.
Show resolved
Hide resolved
andrei-salanovich-ext-sefe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.