Skip to content

Update Microsoft.Security.Utilities.Core from v1.17.0 to v1.18.0 #5224

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
merged 4 commits into from
Jun 9, 2025

Conversation

nguerrera
Copy link
Contributor

@nguerrera nguerrera commented May 22, 2025

Context

Update Microsoft.Security.Utilities.Core to latest to get secret masking improvements.


Description

Update Microsoft.Security.Utilities.Core from v1.17.0 to v1.18.0

Release Notes: https://github.com/microsoft/security-utilities/blob/release/v1.18.0/docs/ReleaseHistory.md

This release includes many new granular secret masking rules and significant performance enhancements. Benchmarks show a net speedup.

It also improves the case where a literal secret value is added to the masker that also matches a rule. In this case, redaction will use *** instead of the rule-based SECNNN/NNN:ID. A new agent test is also added in this change to verify this behavior.

The update required some refactoring to absorb the removal of SecretMasker.Clone. The agent secret masker no longer implements the server ISecretMasker interface that has a Clone method. There was only one place where the agent masker was passed to server ISecretMasker interface, but this was deemed to be unnecessary as we also pass an ITrace that handles secret masking. We therefore now pass null in this case with a detailed comment explaining why this is correct. A new test is added to verify that masking is still performed in this code path.

There is also some minor refactoring in tests to provide a shared TestHostContext.GetTraceContent method. A handful of tests with duplicated code are refactored to use this and a new test takes advantage of it.

Finally, TestHostContext is updated to use the non-legacy OssSecretMasker.


Risk Assessment (Low / Medium / High)

Medium. Some refactoring was needed to take this update.


Unit Tests Added or Updated (Yes / No)

Yes.


Additional Testing Performed

Configured locally built agent to run in agent pool for a non-production org. Ran with and without AZP_ENABLE_NEW_MASKER_AND_REGEXES and tested with user secret variable and secret matching a rule from the library. User secrets were redacted with *** in both cases and rule-based secrets were SECNNN/NNN:ID redacted when new masker was enabled.

@nguerrera nguerrera requested review from a team as code owners May 22, 2025 18:51
@nguerrera nguerrera force-pushed the users/nguerrera/msuc-v1.18 branch from a537821 to d0bcce1 Compare May 29, 2025 19:18
@nguerrera
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nguerrera
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nguerrera nguerrera merged commit b57ff78 into master Jun 9, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants