Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Perform backups and restores of databases, scrubbing records along the way. This allows taking limited snapshots of large databases and keeps customer info out of your staging site.
Add this line to your application's Gemfile:
gem 'stage_hand'
And then execute:
$ bundle
Or install it yourself as:
$ gem install stage_hand
Generate an example config file
stage_hand install
Create a new, modified copy of the production database
stage_hand capture -e production
Load the current database file, currently just does rake db:structure:load
but may be exapnded in the future
stage_hand load -e staging
StageHand uses a configuration file found in config/stage_hand.yml. There are two sections of this file.
This is a list of all the tables to exclude. These tables are skipped by data insertion, but they are reset to the current schema currently. schema_migrations is always in the excluded list, though the structure load will set the values of that table to the most recent migration.
excluded_tables:
- sites
- secrets
Here is where the real magic happens. You can specify fields to either be set to blank (by using nil or false) or by evaluating code. Faker is included to make doing so easy. There is also a special variable called existing_value
which contains the value before any changes. These fields will be changed in flight to the sql file and thus sensitive data can be removed from the production data dump.
fields:
users:
email: "existing_value.match('notch8.com') ? existing_value : Faker::Internet.unique.email"
zip: false
action_items:
name: "Faker::Name.unique.name"
-[ ] File upload -[ ] File Download -[ ] Ability to limit the number of rows to insert per table
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://gitlab.com/notch8/stage_hand. 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.
Everyone interacting in the StageHand project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.
FAQs
Unknown package
We found that stage_hand 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.