Skip to content
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

[test] vitest can leak secrets in pipeline output #29630

Open
timovv opened this issue May 8, 2024 · 5 comments
Open

[test] vitest can leak secrets in pipeline output #29630

timovv opened this issue May 8, 2024 · 5 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system.

Comments

@timovv
Copy link
Member

timovv commented May 8, 2024

When a test fails with an error, vitest outputs a JSON serialization of the error object to console. This is helpful when debugging, but can cause information that would have otherwise been sanitized to be output in pipeline runs, like in this example where an access token showed up (MS internal link): https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3768430&view=logs&j=8f098e13-557e-5a76-9331-06424800e0fa&t=5005ede9-2880-5bbf-ce42-ae979164a4d1&l=105. Is it possible to suppress this output or sanitize it somehow in the pipeline?

Cc @mpodwysocki

@github-actions github-actions bot added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 8, 2024
@xirzec xirzec added EngSys This issue is impacting the engineering system. Client This issue points to a problem in the data-plane of the library. labels May 8, 2024
@xirzec
Copy link
Member

xirzec commented May 8, 2024

/cc @jeremymeng

@github-actions github-actions bot removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label May 8, 2024
@jeremymeng
Copy link
Contributor

I wonder whether we should remove the request object from the RestError object, or sanitize it by default?

@timovv
Copy link
Member Author

timovv commented May 9, 2024

I feel like there are definitely production use cases where customers would want to see the content of the request in an error case. Sometimes there may be secrets in the response as well, which is an even more useful property. Maybe it would be possible to sub in a different mock implementation of RestError during tests that doesn't have this information, or sanitizes things? (this is if Matt's current PR doesn't fix the problem, I haven't had a chance to test that yet)

@jeremymeng
Copy link
Contributor

I am a little concerned because error objects most likely get logged all the time.

@timovv
Copy link
Member Author

timovv commented May 13, 2024

Yeah I agree that is a concern. I guess there are a few different ways people could log the error:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. EngSys This issue is impacting the engineering system.
Projects
None yet
Development

No branches or pull requests

4 participants