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

Mask secrets in debug output #3711

Open
tekumara opened this issue Apr 25, 2024 · 1 comment
Open

Mask secrets in debug output #3711

tekumara opened this issue Apr 25, 2024 · 1 comment
Assignees
Labels

Comments

@tekumara
Copy link

Feature Description

Obfuscate or remove secrets in debug output, eg: the Api-Key value below has been replaced with ************:

time="2024-04-25T07:51:56Z" level=info msg="Request:\nPUT /collections/k6-load-test HTTP/1.1\nHost: myapp\nUser-Agent: k6/0.50.0 (https://k6.io/)\nContent-Length: 94\nApi-Key: ************\nContent-Type: application/json\nAccept-Encoding: gzip\n\n{\"vectors\":{\"size\":1536,\"distance\":\"Dot\"},\"replication_factor\":3,\"write_consistency_factor\":3}\n" group="::setup" iter=0 request_id=05651186-bbe5-41e0-7480-fa0a63214ecd source=http-debug vu=0

Suggested Solution (optional)

The easiest solution is probably to have a flag that disables outputting headers (which are the most likely location of secrets, tokens, api keys, cookies etc.)
A more advanced solution could detect and mask based on high entropy.

Already existing or connected issues / PRs (optional)

No response

@codebien
Copy link
Collaborator

codebien commented May 3, 2024

Honestly, it sounds like something unlikely to be developed in the current k6/http module directly from the k6 core team. At the moment the demand is not so high to justify the complexity it would bring to the API.

If you plan to contribute, we might consider it and discuss together an API.

@codebien codebien removed the triage label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants