
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= ruby-binlog
== Description
ruby-binlog is Ruby binding for MySQL Binary log API.
== Install
gem install ruby-binlog
== Required Privileges
== Example
#!/usr/bin/env ruby require "rubygems" require "binlog" require "pstore"
$db = PStore.new("/tmp/foo")
#master_log_file = "mysql-bin.000001" #master_log_pos = 4
master_log_file = nil master_log_pos = nil
$db.transaction do master_log_file = $db["master_log_file"] master_log_pos = $db["master_log_pos"] end
def save_position(master_log_file, master_log_pos) $db.transaction do $db["master_log_file"] = master_log_file $db["master_log_pos"] = master_log_pos end end
begin # XXX: Do not reuse a client instance, after connection goes out. client = Binlog::Client.new("mysql://repl:repl@example.com") sleep 0.3 until client.connect
if master_log_file and master_log_pos
client.set_position(master_log_file, master_log_pos)
end
while event = client.wait_for_next_event
puts "(#{event.event_type})"
master_log_pos = event.next_position
case event
when Binlog::QueryEvent
puts event.db_name
puts event.query
save_position(master_log_file, master_log_pos)
when Binlog::RowEvent
puts event.event_type
puts event.db_name
puts event.table_name
p event.columns
p event.rows
save_position(master_log_file, master_log_pos)
when Binlog::RotateEvent
master_log_file = event.binlog_file
master_log_pos = event.binlog_pos
save_position(master_log_file, master_log_pos)
end
end
rescue Binlog::Error => e puts e retry if client.closed? raise e end
== Notice
The following type are not supported in row mode.
see the following urls:
FAQs
Unknown package
We found that ruby-binlog demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.