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

Hide sensitive and long columns from inspect output #770

Closed
wants to merge 1 commit into from

Conversation

byucesoy
Copy link
Member

Eventhough they are encrypted, it is better to not print some columns such as superuser_password or root_cert_key1. Apart from that, there are some columns with very long text without human readable info such as root_cert_1. With this commit, we are excluding them them from inspect output to improve overall development and operations experience.

Eventhough they are encrypted, it is better to not print some columns such as
superuser_password or root_cert_key1. Apart from that, there are some columns
with very long text without human readable info such as root_cert_1. With this
commit, we are excluding them them from inspect output to improve overall
development and operations experience.
@byucesoy byucesoy self-assigned this Oct 23, 2023
@@ -68,4 +68,9 @@ def hostname
def connection_string
URI::Generic.build2(scheme: "postgres", userinfo: "postgres:#{URI.encode_uri_component(superuser_password)}", host: hostname).to_s
end

def inspect_values
hidden_columns = [:superuser_password, :root_cert_1, :root_cert_key_1, :root_cert_2, :root_cert_key_2, :server_cert, :server_cert_key]
Copy link
Member

Choose a reason for hiding this comment

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

I'm brainstorming a similar concept for Clog. In the future, we might consider moving this variable to the class level.
#766

Copy link
Member

Choose a reason for hiding this comment

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

Encrypted columns can be accessed with column_encryption_metadata.keys and we may hide them in the inspect output of all models.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's do this. We used to have our own Model class (perhaps it should be named CloverModel) that all models inherited from, and then switched to Sequel::Model because we were doing nothing interesting in there, and then now may be good occasion to switch back again.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also let's improve the rendering of NetAddr columns, for the love of all that is holy (yes, we could also fork netaddr, and probably should at some point)

@byucesoy
Copy link
Member Author

byucesoy commented Nov 8, 2023

Closing in favor of this #854

@byucesoy byucesoy closed this Nov 8, 2023
@byucesoy byucesoy deleted the hide-sensitive-columns-from-inspect branch December 3, 2023 06:35
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.

None yet

3 participants