
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= mysql-pause
== Description
mysql-pause is a proxy server to pause a query to MySQL.
== Source Code
https://bitbucket.org/winebarrel/mysql-pause
== Dependency
== Install
gem install mysql-pause
== Example === Start server
shell> mysql-pause start Starting daemon... Waiting for daemon to start... Daemon status: running pid=56921
shell> mysql -h 127.0.0.1 -P 13306 -u scott -ptiger mysql> select 1; +---+ | 1 | +---+ | 1 | +---+ 1 row in set (0.00 sec)
=== Pause
shell> mpctl pause
mysql> select 1; (...no response...)
=== Resume
shell> mpctl resume
(...resume response...) +---+ | 1 | +---+ | 1 | +---+ 1 row in set (18.01 sec)
== Extend MySQL adapter === Install
gem install mysql-pause-adapter-ext
=== Example code
require 'active_record' require 'mysql-pause/adapter-ext'
ActiveRecord::Base.establish_connection( :adapter => 'mysql2', :host => '127.0.0.1', :port => 13306, :username => 'scott', :password => 'tiger', :database => 'employees', :reconnect => true, )
class Employee < ActiveRecord::Base; end
loop do employee = Employee.new employee.first_name = 'Taro' employee.last_name = 'Yamada' employee.save! sleep 3 end
=== Behavior
log> DEBUG -- : (0.6ms) BEGIN
log> DEBUG -- : SQL (0.7ms) INSERT INTO employees
(first_name
, last_name
) VALUES ('Taro', 'Yamada')
log> DEBUG -- : (0.8ms) COMMIT
log> DEBUG -- : (0.6ms) BEGIN
shell> mpctl pause shell> service mysql restart shell> mpctl resume
log> DEBUG -- : (0.6ms) BEGIN
(...handle error and reconnect...)
log> DEBUG -- : Mysql2::Error: %MYSQL_PAUSE%;;1000;;Aborted backend connection: BEGIN
log> WARN -- : ActiveRecord::StatementInvalid: Mysql2::Error: %MYSQL_PAUSE%;;1000;;Aborted backend connection: BEGIN
log> DEBUG -- : (0.3ms) BEGIN
log> DEBUG -- : SQL (2.1ms) INSERT INTO employees
(first_name
, last_name
) VALUES ('Taro', 'Yamada')
log> DEBUG -- : (0.8ms) COMMIT
FAQs
Unknown package
We found that mysql-pause 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.