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.
Simple redirector for a Rails app. Stores the key in redis (using namespace to stay out of the way) and redirects to the value.
it's a gem, do all that Gemfile stuff:
gem 'redis-redirect'
create a config/initializer/redis_redirect.rb like:
# Load config and set redis.
redis_config = YAML.load_file(rails_root + '/config/redis.yml')[rails_env]
RedisRedirect.redis = Redis.connect(:url => "redis://#{redis_config['host']}/#{redis_config['db']}")
# Set namespace to prevent collisions
RedisRedirect.redis.namespace = "redis_redirect" # default is redis_redirect
and hook it up to your routes file:
get "*path" => RedisRedirect::Routes
remember routes are run in order, you probably want the redirect pretty low. If the route is not matched, or the connection fails it will just continue down the routes.
This gem creates a model, Redirect, that has source and target instance variables. The Redirect model tries to act a bit like an ActiveRecord object so that form generation is easy. Notable differences is that there is no id field since the datastore is redis. Instead it uses the key to act as a to_param. so:
r = Redirect.new(source: '/some-old-path', target: '/new-hotness')
r.save
same_r = Redirect.find('/some-old-path')
same_r.destroy # works
Should work with Rails 3+, patches welcome.
FAQs
Unknown package
We found that redis-redirect 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.