Problem/Motivation

Some fields contain sensitive data (eg API keys etc) and the values should not be recorded in the log.
But log should contain which user has updated the key and when.

Steps to reproduce

Log record now:
Configuration changed: hubspot_api.settings.access_key changed from 123-124-125 to 222-444-555 at 1748009132

Proposed resolution

Add a configuration setting and text field on settings form (similar to "Configuration entity names to ignore") to not log config property value.

Proposed log record:
Configuration changed: hubspot_api.settings.access_key changed by user j.smith at 1748009132

Remaining tasks

- update settings to include new property "Do not log value of config property"
- update config settings form
- update logging logic

User interface changes

- settings form to include a new text field

API changes

- none

Data model changes

- update settings to include new property "Do not log value of config property"

This will help to prevent any leaks of API keys and other sensitive data.

CommentFileSizeAuthor
#3 add-sensitive-config-filter-3.patch19.95 KBnagy.balint

Issue fork config_log-3526289

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jannakha created an issue. See original summary.

nagy.balint’s picture

I just think that maybe this should be automatic instead.

Like we can have a list of common config names that are API key and such related. As I think in most cases we would like to not log these in the module.
And then this could also work inside the diff, like showing the diff but one part of the diff is a key then that would be ommitted.

And then we can have a checkbox which can turn this filter off, but with a note about security.

nagy.balint’s picture

Status: Active » Needs review
StatusFileSize
new19.95 KB

I would try something like this

jannakha’s picture

@nagy.balint thanks for the patch.
any chance for MR? it'll speed up testing and review process.

nagy.balint’s picture

Done

  • nagy.balint committed 3d400b6e on 4.x
    feat: #3526289 Log changes to sensitive field but do not log values
    
    By...
nagy.balint’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.