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

Add Support for a Tag to Hide Field Values in Logs #7368

Open
IGLOU-EU opened this issue Feb 12, 2025 · 0 comments
Open

Add Support for a Tag to Hide Field Values in Logs #7368

IGLOU-EU opened this issue Feb 12, 2025 · 0 comments
Assignees
Labels
type:feature_request feature request

Comments

@IGLOU-EU
Copy link

IGLOU-EU commented Feb 12, 2025

Describe the feature

I've started work on adding support for a struct tag to exclude sensitive fields (e.g., API keys, personal information) from logs.

For example:

type MySuperStuff struct {
    MySecretName string
    MySecretKey  string `gorm:"isSensitive"`
}
INSERT INTO "my_super_stuff" ("my_secret_name","my_secret_key") VALUES ('toto','***')....

The idea is to let ParamsFilter handle the filtering process, but currently, it receives stmt.Vars without schema field information.
How can we associate the schema fields with stmt.Vars so that ParamsFilter can properly filter sensitive data?
Would love your thoughts on the approach and whether a PR for this feature is of interest.

Motivation

The intention is to prevent accidental exposure of sensitive data (e.g., API keys, personal information, ...) in logs. This improves security by ensuring that such values are never output, without altering the behavior of data operations.

Related Issues

None.

@github-actions github-actions bot added the type:feature_request feature request label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature_request feature request
Projects
None yet
Development

No branches or pull requests

2 participants