Skip to content

Enriching OracleParameterInfo with flag for PII data #70

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

opejanovic
Copy link
Contributor

@opejanovic opejanovic commented Dec 21, 2024

I submitted a pull request to the project, introducing a new flag called MaskValueWhenLogging to the OracleParameterInfo class.

This flag is intended to identify Oracle parameters that contain Personally Identifiable Information (PII). When set to true, it enables masking of parameter values in logs, improving data security and supporting compliance with privacy regulations.

Added a new flag, MaskValueWhenLogging, to the OracleParameterInfo class. This flag is used to identify Oracle parameters containing Personally Identifiable Information (PII). When set to true, the parameter values can be masked in logs to enhance data security and compliance with privacy standards.
@opejanovic
Copy link
Contributor Author

opejanovic commented Dec 21, 2024

I find this flag very useful in practice. Here's a simple example demonstrating how it can be used to mask sensitive parameter values before logging:

var paramDic = new Dictionary<string, string>();
foreach (var name in parameters?.ParameterNames)
{
    var paramInfo = parameters.GetParameter(name);

    string paramValue;

    if (paramInfo.MaskValueWhenLogging)
    {
        paramValue = "***MASKED***";
    }
    else
    {
        paramValue = GetParameterValue<dynamic>(parameters, name);
    }
	paramDic.Add(name, paramValue);
}
logger.LogInformation("SQL executed wiht {@parameters}", paramDic);

This approach helps ensure that PII or other sensitive values are not exposed in logs while still retaining visibility into which parameters were used.

@opejanovic
Copy link
Contributor Author

@epaulsen can you please pick this one off the ground?

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.

1 participant