Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
opentelemetry-helpers-sql-obfuscation
Advanced tools
This Ruby gem contains logic to obfuscate SQL. It's intended for use by by gem authors instrumenting SQL adapter libraries, such as mysql2, pg, and trilogy.
The logic is largely drawn from the New Relic Ruby agent's SQL Obfuscation Helpers module.
Add the gem to your instrumentation's gemspec file:
# opentelemetry-instrumentation-your-gem.gemspec
spec.add_dependency 'opentelemetry-helpers-sql-obfuscation'
Add the gem to your instrumentation's Gemfile:
# Gemfile
group :test, :development do
gem 'opentelemetry-helpers-sql-obfuscation', path: '../../helpers/sql-obfuscation'
end
Make sure the Instrumentation
class for your gem contains configuration options for:
:obfuscation_limit
: the length at which the SQL string will not be obfuscated
Example: option :obfuscation_limit, default: 2000, validate: :integer
If you want to add support for a new adapter, update the following constants to include keys for your adapter:
DIALECT_COMPONENTS
CLEANUP_REGEX
You must also add a new constant that calls the generate_regex
method with your adapter's DIALECT_COMPONENTS that is named like <ADAPTER>_COMPONENTS_REGEX
, such as: MYSQL_COMPONENTS_REGEX
.
Check New Relic's SQL Obfuscation Helpers module to see if regular expressions for your adapter already exist.
To obfuscate sql in your library:
OpenTelemetry::Helpers::SqlObfuscation.obfuscate_sql(sql, obfuscation_limit: config[:obfuscation_limit], adapter: :postgres)
The opentelemetry-helpers-sql-obfuscation
gem source is on github, along with related gems including opentelemetry-instrumentation-pg
and opentelemetry-instrumentation-trilogy
.
The OpenTelemetry Ruby gems are maintained by the OpenTelemetry Ruby special interest group (SIG). You can get involved by joining us on our GitHub Discussions, Slack Channel or attending our weekly meeting. See the meeting calendar for dates and times. For more information on this and other language SIGs, see the OpenTelemetry community page.
The opentelemetry-helpers-sql-obfuscation
gem is distributed under the Apache 2.0 license. See LICENSE for more information.
FAQs
Unknown package
We found that opentelemetry-helpers-sql-obfuscation demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.