
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Allows you to find taboo words, censor them and keep track of who created them. Optionally you can generate ActiveAdmin pages to import taboo words and keep track of the generated TabooPosts.
Add this line to your application's Gemfile:
gem 'bigbrotha'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bigbrotha
In order to create migrations for the models and the setup file in initializers, use:
bin/rails generate big_brotha:initializer
Running the migrations will generate tables for two models: Taboo and TabooPost.
BigBrotha.add_taboo!(taboo_word)
.
Remove taboo by calling BigBrotha.remove_taboo(taboo_word)
.
Find taboo object by calling BigBrotha.find_taboo(taboo_word)
.! Before you run rake db:migrate
make sure you have a User model that TabooPost can reference.
In "config/initializers/bigbrother.rb" you configure all the necessary places where checks for taboos need to be done.
Example configurations:
BigBrotha.configure do |config|
config.add(User, :self, [:username, :comment], :after, :save)
config.add(Room, :creator, :message, :before, :update)
end
In the add method you have to set the following parameters: Model, :relation_name, :column_names, :timing, :event
To create active admin pages for Taboos and TabooPosts run: bin/rails generate big_brotha:active_admin
.
Optionally you can add a button for importing taboos in csv format. To do this, you have to add
gem 'active_admin_importable'
to your Gemfile, run bundle install
and uncomment in "app/admin/taboo.rb" the block that allows you this option.
The csv files in the first line, have to contain the word: keyword
You can edit the active admin pages as you want, for more info go to: ActiveAdmin and ActiveAdmin importable.
1.Configure
BigBrotha.configure do |config|
config.add(User, :self, :username, :after, :save)
end
2.Add Taboos
>> BigBrotha.add_taboo!("princess")
3.Create User
>> user = User.create(username: "I'm princessita")
4.Result
>> user.username
"I'm *******ita"
5.Check TabooPost
>> BigBrotha::TabooPost.where(user: user)
#<BigBrotha::TabooPost id: 1, content: "I'm princessita", content_column: "User.username", user_id: 1>
Censor class contains additional method which you can use to censor text.
>> BigBrotha::Censor.censor_taboos_in_text("This is an example text with few taboos", ["example","taboo"])
"This is an ******* text with few *****s"
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/SnezanaDichevska/bigbrotha. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that bigbrotha 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.