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

Support secrets: things that should not be saved verbatim #2947

Open
docwhat opened this issue Jun 20, 2024 · 3 comments
Open

Support secrets: things that should not be saved verbatim #2947

docwhat opened this issue Jun 20, 2024 · 3 comments
Labels
enhancement New feature or request topic: secret

Comments

@docwhat
Copy link

docwhat commented Jun 20, 2024

Problem to solve

There are values that are secret and should not be saved. Even cookies that become invalid quickly should not be stored for others to see.

The specific case I have is when generating reports or when running in CI.

Proposal

I don't know enough about the innards, but from a user point of view it would be nice if there was a way to taint values.

Some example things:

  • hurl --secret 'a variable that is pre-tainted' file.hurl
  • Instead of variable = use secret = .
  • When doing multi-step authentication, not only should the password/secret be tainted, but the captured items might need to be as well. Maybe secret :: csrf_token: xpath "normalize... (modifying the example for capturing response.

Additional context and resources

I don't think it's worth looking for matching strings; just tracking the variable should be enough.

Tasks to complete

@docwhat docwhat added the enhancement New feature or request label Jun 20, 2024
@fabricereix
Copy link
Collaborator

Hi @docwhat,
thanks for your issue. This would be indeed a good feature for Hurl.
We have to think how we can add it.

@fabricereix
Copy link
Collaborator

@jcamiel,
We could add another field mask to the runtime String value.

For example
--variable user=bob initializes the string variable user with the value { plain: "bob", mask: "bob"}
--secret password=secret initializes the string variable password with the value { plain: "secret", mask: "*****"}

The following template {{name}}:{{value}} will be evaluated to { plain:"bob:secret", mask: "bob:*****}.
The same concatenation operation applies to both the mask and plain fields.

Anytime we need to log a string variable, we will use its mask field.

@docwhat
Copy link
Author

docwhat commented Jun 26, 2024

Clever.

That way, you can compose strings multiple times and keep the secret secret and not have to replace the whole composed string with ****.

Otherwise, composed items become "elevated" or "tainted," meaning you'd have to replace the composed item with ***** which would be uninformative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: secret
Projects
None yet
Development

No branches or pull requests

3 participants