fix(pyats): prevent credential exposure in PyATS archives (#689)#698
fix(pyats): prevent credential exposure in PyATS archives (#689)#698
Conversation
Disable EnvironmentDebugPlugin which was writing environment variables (including passwords) to env.txt files in PyATS result archives. Add E2E regression test that scans all output artifacts (including ZIP contents) for a sentinel password value to catch future credential leaks.
09f0c07 to
07b6270
Compare
aitestino
left a comment
There was a problem hiding this comment.
LGTM — clean, minimal security fix. The plugin disable mechanism is correct and the sentinel-based E2E regression test is well-designed.
A couple of minor suggestions that can land in #697:
- Add
: strtype annotation toTEST_CREDENTIAL_SENTINELfor convention consistency - Consider a brief YAML comment above the
EnvironmentDebugPlugin: enabled: Falseentries explaining the rationale (#689)
Approving as-is — the expedited fix is the right call before UAT.
|
Hey @oboehmer — I haven't verified this against an actual run, but while reviewing #698 I noticed that Quick glance only — I could be wrong about the cleanup path. Worth a look? P.S. — This comment was drafted using voice-to-text via Claude Code. If the tone comes across as overly direct or terse, please know that's just how it tends to phrase things. No offense or criticism is intended — this is purely an objective technical review of the PR. Thanks for understanding! 🙂 |
Ouch, good catch.. Will fix this as part of #697 soon. Merging this one as is, will address your comment in the "real" fix |
|
Actually: we shouldn't log testbed creds, we should save the |
@aitestino , confirmed, pyats dumps the |
Description
Quick fix to prevent credential exposure in PyATS result archives. The
EnvironmentDebugPluginwas writing environment variables (including passwords) toenv.txtfiles within PyATS archives.This is an expedited fix to address the security issue before UAT. A more comprehensive PR (#697) is in progress that includes this fix along with additional cleanup for #570.
Closes
Related Issue(s)
Type of Change
Test Framework Affected
Network as Code (NaC) Architecture Affected
Platform Tested
Key Changes
EnvironmentDebugPluginin PyATS subprocess runner configuration to prevent env vars from being written to archivesTesting Done
pytest/pre-commit run -a)Test Commands Used
without the fix in subprocess_runner, I see the new test fail:
Checklist
pre-commit run -apasses)Screenshots (if applicable)
N/A
Additional Notes
This is a minimal, targeted fix to mitigate the security issue quickly. PR #697 will supersede this with a more comprehensive solution that also addresses #570 (tech debt cleanup and code deduplication).