Repository navigation
Conversation
`config :ash_admin, :reveal_sensitive_fields?, false` keeps sensitive values redacted: no eye icon, and the reveal event is refused when sent without it; no filtering, sorting or searching on sensitive columns, which would leak the values one row match at a time; and update forms leave sensitive attributes out instead of filling them with the stored value. `show_sensitive_fields` still applies. The default is unchanged.
Contributor
|
One thing: if an update action has an argument with the same name as the sensitive attribute (i.e |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sensitive attributes show as
--redacted--, but the eye icon next to them shows the value, and there is no way to turn that off. That is a problem when the admin can be opened on production data: anyone who can open it can read every credential. Hiding the icon with CSS doesn't help, because the reveal event can be sent without it.This adds an opt-in setting:
With it, a sensitive value never reaches the browser:
SensitiveAttributerenders only--redacted--, without the icon. It also refuses the toggle event, which can be sent without the icon.DataTableturns off filtering, sorting and search on sensitive columns. Otherwise the rows that match leak the value: a substring filter on a token column rebuilds the token one guess at a time. Cinder already ignores filter, sort and search events for columns that don't allow them, so this also covers events sent by hand.Fields listed in
show_sensitive_fieldsare unaffected, and the default (true) keeps today's behaviour. Not covered: a sensitive primary key still appears in links, as before.I made it application config, like
:titleand:max_primary_key_byte_size, since it's an app-wide policy. I'm happy to make it a router option likehost_app_pathinstead if you prefer.Tests are in
test/sensitive_fields_test.exs. They use a newCredentialfixture in its own test domain, because adding it toAshAdmin.Test.Domainwould change the dropdown tests' groups. They cover the default reveal, the record page with a reveal event sent without the icon, table filters, sorts and search (including events sent by hand), and update and create forms. Locally,mix checkpasses apart fromhex_audit, which fails onmaintoo (retiredash_sql0.8.4,ectoadvisory). I didn't rundialyzerorreuselocally.