-
Notifications
You must be signed in to change notification settings - Fork 174
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
Guidance requested: static SQL queries may contain sensitive values #436
Comments
this is tricky, I don't love any of these options:
|
of those options, I think (1) is the best? I'm not entirely solid in that opinion though. It would also help if there was a sanitization processor (there might be) for the collector. A half-step to (1) might be to collect by default but issue a warn log that the user has to explicitly disable in config? There are issues with that as well though because SDK logging is entirely disabled by default in JS and it isn't common to enable it unless there is a problem. (3) is really tough. There are likely good parsers in some languages, but not all, and requiring them to be included as a part of the bundle is tough in resource constrained environments (which is common in at least JS). |
We could also disable collection of static queries by default. In this case parameterized queries would be assumed to be safe, which potentially can still be untrue, but in most cases is probably a reasonable assumption. |
Related: #877 |
currently the database semconv says that
I think what's missing that would help answer @dyladan's original question above is an explicit recommendation on whether to trust that parameterized queries have already been sanitized. my initial thought is that capturing parameterized queries by default is probably a good trade-off between risk and reward, meaning
this might be an apt analogy in terms of risk / reward(?)
|
Yes I can confirm that it does |
The current database semconv states the following:
source:
semantic-conventions/model/trace/database.yaml
Line 211 in 064fe4e
In JS, most of our instrumentations solve this by taking advantage of the parameterized API provided by SQL clients. For example, the user may call
sql.query('SELECT * FROM mydb WHERE userid = ?', userId)
or similar. In this case we collect the string'SELECT * FROM mydb WHERE userid = ?'
. This presents the following problems:In at least some SIGs such as Java, they have handled this by parsing the SQL and removing values, but in JS this is difficult due to bundle size restrictions and lack of good parsers available. I suspect this may also affect other SIGs. What is the recommendation of the Semantic Conventions group?
The text was updated successfully, but these errors were encountered: