-
Notifications
You must be signed in to change notification settings - Fork 52
Fix how secureString
and secureObject
is propagated
#1127
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes how secureString
and secureObject
types are propagated throughout the DSC system. Instead of extracting secure values as plain strings/objects, the code now maintains them as wrapped secure types and properly redacts sensitive information in outputs.
- Restructured
SecureString
andSecureObject
to be proper wrapper objects instead of raw values - Added redaction functionality to replace secure values with
<secureValue>
placeholder text in outputs - Introduced
showSecrets
property to Echo resource for controlled disclosure of sensitive content
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
dscecho/src/main.rs | Added secure value redaction logic and showSecrets handling |
dscecho/src/echo.rs | Restructured secure types as wrapper objects and added showSecrets property |
dsc_lib/src/parser/expressions.rs | Enhanced expression parsing to handle secure types and convert values appropriately |
dsc_lib/src/functions/parameters.rs | Updated parameter function to create proper secure wrapper objects |
dsc_lib/src/dscresources/dscresource.rs | Added redaction function and secure value handling in test operations |
dsc_lib/src/dscresources/command_resource.rs | Integrated redaction in test invoke operations |
dsc_lib/src/configure/parameters.rs | Added SecureString/SecureObject structs and secure value detection |
dsc_lib/locales/en-us.toml | Added localization for secure function result messages |
dsc/tests/dsc_parameters.tests.ps1 | Updated tests to verify redaction behavior |
dsc/tests/dsc_extension_secret.tests.ps1 | Updated test to use showSecrets property |
dsc/examples/secure_parameters_shown.parameters.yaml | Added example with showSecrets enabled |
dsc/examples/secure_parameters.dsc.yaml | Added showSecrets parameter to configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Summary
In the original code, the intent was to keep
secureString
andsecureObject
as objects, but the code incorrectly extracted the contents and didn't keep it marked as secure.This change keeps the original
secureString
andsecureObject
types as objects. Resources may receive these objects and expected to handle them appropriately. When accessed in an expression forsecureObject
, the properties themselves will be rewrapped assecureString
for strings andsecureObject
for objects, but numbers and booleans aren't secured. Within an array, strings and objects will also be wrapped.In the case of a
secureString
orsecureObject
, the contents will be redacted as<secureValue>
. In the case of arrays, individual elements can be redacted. Objects are recursively redacted only affected nested objects that aresecureString
orsecureObject
.For a synthetic test, secure types are skipped for comparison.
If a resource emits a secure type, then use of
reference()
maintains the wrapper. Onlyparameters()
performs unwrapping while keeping it secure.The
Echo
resource now has an optionalshowSecrets
boolean property where iftrue
will emit the sensitive content as plaintext.PR Context
Fix #1123
Fix #1084