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

Fixed: Vault warns when valid JSON contains special character sequences #416

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

decoyjoe
Copy link

Description

Fixes an issue where Chef Vault writes a warning when a valid JSON document contains special character sequences, exposing sensitive vault data in the warning message.

Chef Vault should be agnostic to the content of the vault item JSON. It no longer inspects vault item contents, validation responsibility is left to the JSON parser to ensure the JSON data is valid.

Related Issue

Fixes #415 Chef Vault warns and leaks secrets when vault json contains properly encoded special characters · Issue #415 · chef/chef-vault

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@decoyjoe decoyjoe requested review from a team as code owners November 25, 2024 22:50
Copy link
Collaborator

@jaymzh jaymzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good minus a few typos

end

it "Not to raise error if valid data provided" do
expect { validate_json(json_data) }.to_not raise_error
it "should not to raise error if valid data provided" do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"should not to" ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

end

it "not to raise error if data consist of tab/new line OR space" do
it "should not to raise error if data consist of tab/new line OR space" do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@decoyjoe decoyjoe force-pushed the bugfix/vault-warns-when-item-contains-special-characters branch from 6ebf263 to e959039 Compare November 26, 2024 18:43
This partially reverts commit 2e0ee1b

Fixes chef#415

Signed-off-by: Joseph Larionov <jlarionov@webmd.net>
@decoyjoe decoyjoe force-pushed the bugfix/vault-warns-when-item-contains-special-characters branch from e959039 to f4ad81a Compare November 26, 2024 19:07
Copy link
Collaborator

@jaymzh jaymzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming tests pass, I'm good with this.

@jaymzh
Copy link
Collaborator

jaymzh commented Nov 26, 2024

Hey @johnmccrae - I think this is related to powershell stuff?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chef Vault warns and leaks secrets when vault json contains properly encoded special characters
2 participants