
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
= blue_colr, database-based process launcher
== Overview
blue_colr allows you to easily launch processes using database as a queue. It consists of +bluecolrd+, a deamon that executes whatever finds in a queue, and a DSL for enqueuing processes that enables you to easily describe the order and dependencies of processes.
== Installation
gem install blue_colr
You may want to install +log4r+ gem as well, as it provides more powerful logging features than builtin Ruby's +Logger+.
== Example
require 'blue_colr'
BlueColr.launch do run 'echo These processes' run 'echo will be ran sequentially.' parallel do run 'echo And these' sequential do run 'echo (but not' run 'echo these two)' end run 'echo in parallel.' end run 'echo These will execute' run 'echo after all above are finished.' end
Previous code will queue processes within the database, keeping them in dependency order. Those within +sequential+ block (and in root block, by default) will run each after the one before finishes. Those within +parallel+ block will run in parallel. The commands after +parallel+ block will be executed after all the commands in +parallel+ block are sucessfully finished.
Note: the code above will not start the processes by itself, but enqueue them to the database, by default. A separate process called +bluecolrd+ is used for that.
The following chart, generated by the same code above, is its execution sequence:
http://github.com/downloads/jablan/blue_colr/readme_example.png
== Requirements and Configuration
In order to access the database, blue_colr requires sequel[http://sequel.rubyforge.org/] ORM library, if you don't have it, its gem will be installed along with blue_colr.
Blue_colr uses a relational database to simulate a process queue so you will have to provide one. It relies on two tables, named +process_items+ and +process_item_dependencies+ to work. +db/+ directory contains Sequel migrations for creating these two:
sequel -m db/ sqlite://examples/test.db
Basic configuration is passed to blue_colr either by setting options from your code, or (if not set), blue_colr will parse your command line arguments and get the path to yaml configuration file, using +-c+ option.
== bluecolrd
Blue_colr daemon is constantly running, checking the database for newly enqueued processes, and executing them in a subshell, observing the order.
== bcrun
This script is used to launch arbitrary command through blue_colr. You might want to do that if you want to keep track of the stuff you launch (as everything goes through a database table).
bcrun -c path_to_config.yaml -x "command to execute"
== Environments
An environment is something like category which you assign to a set of processes when enqueuing them. Then you can have multiple daemons running, each one of them targeting specific environment. That allows easy distribution of your tasks across multiple machines, while keeping them synchronized, like the following scenario:
== ToDo
FAQs
Unknown package
We found that blue_colr 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.