Skip to content

Flag to allow application data in logging #1374

Closed

Description

@rowanmiller

From a security point of view we decided that, by default, both the message action and state passed to ILogger.Write should not contain any application data. That is, data that comes from the data store or may be supplied by an end user of the application. Depending on the application, this data may contain sensitive information (usernames, credit card numbers, etc.). Examples include, results from queries, values stored in entity instances, and constant values used in LINQ expressions.

We'll have a simple flag that can be enabled to allow this information to be included. This is especially useful for logging queries, where it is helpful to have the parameter values logged along with the query.

This work item includes:

  • Creating the flag (off by default)
  • Reviewing existing logging to make sure it honors the flag
  • Writing a warning to the log when the flag is enabled (once per context, ServiceProvider, or whatever is easiest)
  • Wherever data is filtered out of a message, include a message in place of the data letting folks know they can enable the flag to get the data (and a warning that it may result in logging sensitive info)

We should try and add this in a way that makes it easy to use it for future logging that we add.

Activity

  1. added this to the 7.0.0 milestone on Jan 9, 2015
  2. rowanmiller commented on Jan 9, 2015

    @rowanmiller
    ContributorAuthor

    @lukewaters please work with @anpete to get some direction on this one

  3. divega commented on Jun 30, 2015

    @divega
    Contributor

    @rowanmiller @anpete @ajcvickers need to find an owner for this.

  4. rowanmiller commented on Jun 30, 2015

    @rowanmiller
    ContributorAuthor

    Didn't we handle this with a log level that applies across all technologies?

  5. anpete commented on Jun 30, 2015

    @anpete
    Contributor

    This should probably be replaced by a bug to switch from logging to event notification.

  6. lukewaters commented on Jun 30, 2015

    @lukewaters
    Contributor

    @rowanmiller I did add a Debug log level and a minimum level to logging a couple months ago, the minimum level prevented more detailed level messages from being distributed to registered loggers for security purposes

  7. 3 remaining items

  8. divega commented on Jul 1, 2015

    @divega
    Contributor

    Thanks again!

  9. divega commented on Jul 1, 2015

    @divega
    Contributor

    @anpete all yours!

  10. modified the milestones: , 7.0.0 on Sep 17, 2015
  11. added 3 commits that reference this issue on Oct 1, 2015
    e93783b
    9dcfa31
    0373f57
  12. modified the milestones: , 1.0.0 on Oct 15, 2022
  13. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions