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

Personal data logged out in the json format #2695

Closed
yanns opened this issue Feb 27, 2023 · 11 comments
Closed

Personal data logged out in the json format #2695

yanns opened this issue Feb 27, 2023 · 11 comments

Comments

@yanns
Copy link
Contributor

yanns commented Feb 27, 2023

Is your feature request related to a problem? Please describe.
When using the jons format, the spans are also logged.
In some spans, the graphql variables and document are logged:

"span": {
    "apollo_private.field_level_instrumentation_ratio":0.01,
    "apollo_private.graphql.variables":"{\"sku\":\"\"}",
    "graphql.document":"fragment ..."

Those values could log some personal data.
As far as I've checked, "apollo_private.graphql.variables" does not seem to disclose any value.
But "graphql.document" can disclose some personal data:
Ex:

{
        users(
          where:"email=\"<removed by me>\"",
        ) {

Describe the solution you'd like

Describe alternatives you've considered
No real alternative. The application should not log any personal data.
.

@Geal
Copy link
Contributor

Geal commented Feb 27, 2023

which spans are affected? How is telemetry configured, especially the send_variable_values option?

@yanns
Copy link
Contributor Author

yanns commented Feb 27, 2023

The name of the span is "name":"supergraph".

@yanns
Copy link
Contributor Author

yanns commented Feb 27, 2023

We have not changed the send_variable_values, and variables seem fine.
I think that the issue is about "graphql.document" for now.

@Geal
Copy link
Contributor

Geal commented Feb 27, 2023

Ah, right. For data sent to Apollo, all the hardcoded variable values are removed, but probably not for other telemetry options.
Is it something you can fix on the client side? If queries contain hardcoded user data, then a separate query plan will have to be generated and stored for each of them, so you'll run in a lot of issues

@yanns
Copy link
Contributor Author

yanns commented Feb 27, 2023

Our API is used directly by all our customers.
We cannot change that.

In our current implementation, we remove all values on variables before logging the query.

@Geal
Copy link
Contributor

Geal commented Feb 27, 2023

I understand, but the query content, with variables tweaking the behaviour, is useful to investigate production issues.
We will look into what can be done here. But as I said, this is bound to create a lot more issues for you in the long run. Do you know which proportion of your users is affected?

@yanns
Copy link
Contributor Author

yanns commented Feb 27, 2023

I don't know the exact proportion, but it's quite important.
And the proportion is not very useful for us: we are not allowed to log any personal data.

Maybe a plugin could remove those values if they need with a middleware?

@yanns
Copy link
Contributor Author

yanns commented Mar 9, 2023

For me, implementing #1651 would be sufficient. Then I'd create my own json logger that would not log the query.

@abernix
Copy link
Member

abernix commented Aug 7, 2023

This also relates to work that is getting discussed in #3226 in terms of toggling these options on and off.

@abernix
Copy link
Member

abernix commented Aug 7, 2023

@yanns Do you think we could close this in favor of #3226?

@yanns
Copy link
Contributor Author

yanns commented Aug 8, 2023

ok for me

@yanns yanns closed this as completed Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants