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

PII Scrubbing usernames from paths for Attachments / Minidumps not working #4368

Closed
gid-sentry opened this issue Dec 10, 2024 · 9 comments · Fixed by #4441
Closed

PII Scrubbing usernames from paths for Attachments / Minidumps not working #4368

gid-sentry opened this issue Dec 10, 2024 · 9 comments · Fixed by #4441
Assignees

Comments

@gid-sentry
Copy link

Scrubbing seems to work for both attachment and event field for native crash events sent to /minidump endpoint via curl command.

Scrubbing does not work for "mannually" constructed event. Example:

void SendEventToSenty(const std::string& minidumpPath)
{
    sentry_options_t* options = sentry_options_new();
    sentry_options_set_dsn(options, "DSN");
    sentry_options_set_database_path(options, "c:\\temp\\sentry-db");
    sentry_options_set_release(options, "My_Minidump");
    sentry_options_set_debug(options, 1);
    
    sentry_options_add_attachment(options, minidumpPath.c_str());
    sentry_options_add_attachment(options,"c:\\temp\\logfile.txt");
   
    gMinidumpPath = new std::string(minidumpPath);
    sentry_init(options);

    sentry_value_t event = sentry_value_new_message_event(
        SENTRY_LEVEL_ERROR,
        "pii-test2",
        "PII test2"
    );
   
    sentry_capture_event(event);
    sentry_close();
}

Example links in Customer Case

[#4351 fix(pii): Fix scrubbing user paths in minidump debug modules](#4351)

did not fix it unfortunately

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 10, 2024
@jjbayer
Copy link
Member

jjbayer commented Dec 12, 2024

  • PII scrubbing in minidumps had a bug that prevented user paths from being scrubbed, that should be fixed by fix(pii): Fix scrubbing user paths in minidump debug modules #4351.
  • Unlike what the docs imply, we do not scrub attachments other than minidumps. I will discuss with the team whether we can enable scrubbing for any attachment type, at least as a beta.
  • Attaching the minidump via add_attachment does not work because it will be treated as a regular attachment with attachment type event.attachment (see above). Minidump attachments require attachment type event.minidump.

I will keep this issue open because we need to at least improve our docs around this topic.

@jjbayer
Copy link
Member

jjbayer commented Dec 19, 2024

Query to surface PII rules with $attachments.'some_file': https://redash.getsentry.net/queries/7999/

@jjbayer
Copy link
Member

jjbayer commented Jan 9, 2025

Limited attachment scrubbing is now enabled and documented here: https://docs.sentry.io/security-legal-pii/scrubbing/attachment-scrubbing/#attachment-source-selectors

@gid-sentry feel free to reopen if any users still encounter issues.

@jjbayer jjbayer closed this as completed Jan 9, 2025
@MindWrapper
Copy link

Using the code example above, I uploaded an event logfile. txt attached with the following content.

Alice Johnson
[email protected] 
+1234567890
4111 1111 1111 1111
Bob Smith [email protected] +9876543210 5500 0000 0000 0004
Charlie Brown [email protected] +1928374650 3782 822463 10005
Dana White [email protected] +1029384756 6011 0009 9013 9424
path=c:\Users\yan\mylogfile.txt
password=mysupersecretpassword123

The masking rule is defined like this:

[Mask] [Email addresses] from [$attachments.'logfile.txt']

logfile.txt attached to an event is not scrubbed:
(it also doesn't work for a minidump, but I guess it is the same problem)

Image

@jjbayer
Copy link
Member

jjbayer commented Jan 10, 2025

@MindWrapper thank you for the report, I will try to reproduce & get back to you.

@jjbayer
Copy link
Member

jjbayer commented Jan 10, 2025

This PR should fix the use case above, I will roll it out on Monday at the latest: #4441

@jjbayer
Copy link
Member

jjbayer commented Jan 14, 2025

@MindWrapper the fix is deployed now, let me know if it works for you!

@MindWrapper
Copy link

Hey @jjbayer, thank you very much for the fix. It works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants