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

Redact sensitive data in SUMA GenServer state #2381

Merged
merged 1 commit into from
Mar 4, 2024
Merged

Conversation

jamie-suse
Copy link
Contributor

@jamie-suse jamie-suse commented Mar 4, 2024

Description

This PR redacts sensitive data (password, auth, ca_cert) in the SUMA GenServer state when the GenServer is inspected or logged. More concretely, a custom Inspect protocol is implemented for the GenServer's State struct, thereby redacting said fields when inspections such as :sys.get_state/1 or :sys.get_status/1 are called and printed.

How was this tested?

Added unit test

@jamie-suse jamie-suse added enhancement New feature or request elixir Pull requests that update Elixir code labels Mar 4, 2024
Copy link
Member

@nelsonkopliku nelsonkopliku left a comment

Choose a reason for hiding this comment

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

Super 🚀

we could also test against :sys.get_status(), but don't bother, I tested manually and it works as expected.

Copy link
Contributor

@dottorblaster dottorblaster left a comment

Choose a reason for hiding this comment

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

🔥

@jamie-suse jamie-suse merged commit dcb8ef2 into main Mar 4, 2024
32 checks passed
@jamie-suse jamie-suse deleted the inspect-suma-gs branch March 4, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

3 participants