
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
A Ruby library for handling Unix socket-based communication.
message.key
).Add this gem to your Gemfile:
gem 'unix_socks'
And install it using Bundler:
bundle install
Or install the gem directly:
gem install unix_socks
Create a server instance and start listening for connections:
require 'unix_socks'
server = UnixSocks::Server.new(socket_name: 'my_socket')
# Run the server in the background to avoid blocking
thread = server.receive_in_background(force: true) do |message|
puts "Received message: #{message.inspect}"
end
thread.join
Transmit messages to connected clients:
client = UnixSocks::Server.new(socket_name: 'my_socket')
# Prepare your message
message = { status: 'success', data: [1, 2, 3] }
# Send the message
client.transmit(message)
Handle incoming messages and send responses:
require 'unix_socks'
server = UnixSocks::Server.new(socket_name: 'my_socket')
def handle_message(message)
# Access message body values using method names
puts "Received status: #{message.status}"
# Send a response
message.respond({ status: 'acknowledged' })
end
# Use in your server setup
thread = server.receive_in_background(force: true) do |message|
handle_message(message)
end
thread.join
And in the client:
client = UnixSocks::Server.new(socket_name: 'my_socket')
# Prepare your message
message = { status: 'success', data: [1, 2, 3] }
# Send the message
response = client.transmit_with_response(message)
# Receive the response
puts "Received server response status: #{response.status}"
message.status
automatically map to the message body.disconnect
.respond
method handles disconnections gracefully.FAQs
Unknown package
We found that unix_socks 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.
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.