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.
ProcessSip lets you make ad-hoc adapters for CLIs to interface with from Ruby.
Here's wrapping git
:
git = ProcessSip.git # Connect an adapter to an executable, here `git`.
# Any subcommands are automatically proxied, so:
git.branch.call # Calls `git branch` on the commandline.
git.branch :remote # Automatically calls when passed arguments, `git branch --remote`.
git.branch :r # `git branch -r`. 1-count symbols get prefixed with -, while anything else gets --.
git.branch :show_current # Get the current branch: `git branch --show-current`.
git.diff.call # `git diff`
git.status :name_only # `git diff --name-only`
And here's bundle
:
# Run `bundle install` and stream each line into the block:
ProcessSip.bundle.install.stream do |line|
puts line
end
ProcessSip.bundle.update.call # `bundle update`
ProcessSip.bundle.update :only_bundler # `bundle update --only-bundler`
ProcessSip.gem.update :system # `gem update --system`
The real power of ProcessSip is to extend the default proxying with your ad-hoc needs. So you can extend the git
adapter like this:
# Open an adapter for a specific executable, here `git`.
ProcessSip.git do
def commit_all(message)
add "." and commit message
end
def commit(message)
super :m, message
end
def with_work_tree = with(work_tree: __dir__)
def with_git_dir = with(git_dir: __dir__ + "/.git")
end
git = ProcessSip.git.with_work_tree.with_git_dir
# Now every git command will use the --work-tree and --git-dir context arguments
git.branch.call # `git --work-tree= --git-dir branch`
deleted_lines = git.diff.select { _1.start_with?("- ") } # `git --work-tree= --git-dir diff`
Install the gem and add to the application's Gemfile by executing:
$ bundle add process_sip
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install process_sip
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
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 the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/kaspth/process_sip.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that process_sip 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
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.