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

fix!: Return message when sql is over the obfuscation limit #1149

Merged

Conversation

kaylareopelle
Copy link
Contributor

@kaylareopelle kaylareopelle commented Sep 4, 2024

When SQL queries had prepended comments and were over the configured obfuscation limit, the query would fail to obfuscate and sensitive data could be exposed.

The previous approach was incompatible because the first index with a match would be the zero index, so the range would return the entire SQL string and append the truncation message to the end of it.

Until we can find a way to make the first match approach work with prepended queries, let's return a message stating the query was over the limit.

Resolves #1146

Previously, when a SQL query with a prepended comment
exceeded the obfuscation limit, the query would be truncated without
obfuscation.

Now, when the obfuscator detects a prepended comment in a query that
needs to be truncated, the prepended comment will be replaced with the
placeholder and the remaining query will be truncated to the
obfuscation limit.
When the obfusaction limit is hit, return a message stating this and
do not attempt to obfuscate
This obfuscation limit matches what New Relic uses for their Ruby agent.
The previous 2000 limit seemed arbitrary.
@kaylareopelle kaylareopelle changed the title fix: Remove prepended SQL comments when truncating fix!: Increase obfuscation limit and return message when sql is over the obfuscation limit Sep 6, 2024
@kaylareopelle kaylareopelle changed the title fix!: Increase obfuscation limit and return message when sql is over the obfuscation limit fix: Return message when sql is over the obfuscation limit Sep 6, 2024
@kaylareopelle kaylareopelle changed the title fix: Return message when sql is over the obfuscation limit fix!: Return message when sql is over the obfuscation limit Sep 6, 2024
@arielvalentin
Copy link
Collaborator

Ready?

@kaylareopelle
Copy link
Contributor Author

Whoops, yes, @arielvalentin! Opened now.

@arielvalentin
Copy link
Collaborator

cc: @reid-rigo Making you aware that we are reverting this functionality.

We will be looking to restore it in the near future, but we have identified an issue with sanitizing SQL queries that prepend comments, so we have to revert it now.

@kaylareopelle kaylareopelle merged commit 8e778ba into open-telemetry:main Sep 10, 2024
57 checks passed
@kaylareopelle kaylareopelle deleted the sql-obfuscation-comments branch September 10, 2024 20:25
@github-actions github-actions bot mentioned this pull request Sep 10, 2024
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.

sql-obfuscation does not sanitize SQL that exceed size limits
4 participants