Windows secret store - no secret #1510
Open
mimachniak wants to merge 3 commits intoPowerShell:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new DSC v3 PowerShell-script-based resource to manage the Microsoft.PowerShell.SecretStore vault configuration on Windows, with a bundled manifest and Pester coverage to exercise dsc config get/set/test scenarios.
Changes:
- Introduces
Microsoft.PowerShell/WindowsSecretStoreresource script implementing Get/Set/Test for SecretStore configuration. - Adds a v3 resource manifest defining execution and an embedded JSON schema for resource properties.
- Adds Windows-only Pester tests that apply and validate none-auth and password-auth configurations via
dsc config.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| resources/windows_secretstore/windows_secretstore.ps1 | Implements the resource logic (Get/Set/Test) and error/trace handling, including a Reset-SecretStore fallback path. |
| resources/windows_secretstore/windows_secretstore.dsc.resource.json | Registers the resource entrypoint and defines the embedded schema for supported properties/outputs. |
| resources/windows_secretstore/test/windows_secretstore.config.tests.ps1 | Adds end-to-end Pester tests using dsc config commands for none-auth and password-auth cases. |
| resources/windows_secretstore/.project.data.json | Adds build packaging metadata to copy the script and manifest for Windows builds. |
Comment on lines
+18
to
+22
| if (-not (Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyContinue)) { | ||
| Install-PackageProvider -Name NuGet -MinimumVersion '2.8.5.201' -Force -Scope CurrentUser | Out-Null | ||
| } | ||
|
|
||
| Install-Module -Name $Name -Repository PSGallery -Scope CurrentUser -Force -AllowClobber -Confirm:$false -ErrorAction Stop |
| "CurrentUser", | ||
| "AllUsers" | ||
| ] | ||
| }, |
Comment on lines
+67
to
+76
| "authentication": { | ||
| "title": "Authentication", | ||
| "description": "Specifies whether the SecretStore vault requires a password for access. This DSC resource runs non-interactively and only supports 'None' for unattended automation.", | ||
| "type": "string", | ||
| "enum": [ | ||
| "None", | ||
| "Prompt", | ||
| "Password" | ||
| ] | ||
| }, |
| ], | ||
| "default": null | ||
| } | ||
| } |
Comment on lines
+309
to
+310
| Write-DscTrace -Level Warn -Message ( | ||
| "$reason Attempting Reset-SecretStore with desired settings to enable unattended DSC execution." |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduces windows_secretstore.ps1, a DSC v3 resource script that manages the configuration of the Microsoft.PowerShell.SecretStore vault using the standard Get/Set/Test pattern.
What's Changed
Get – Retrieves the current SecretStore configuration (authentication, passwordTimeout, interaction, scope) and optionally unlocks the store with a provided password.
Set – Applies the desired configuration via Set-SecretStoreConfiguration. Falls back to Reset-SecretStore when running in a non-interactive session or when transitioning from None to Password authentication mode.
Test – Compares the current configuration against the desired state and returns _inDesiredState in the output JSON.