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.
Rails gem for a pattern to manage 3rd party service integrations
gem 'has_integrations'
or
gem install has_integrations
Once the gem is installed, in your app, run
rails generate has_integrations:install
Which will set up the Integration
Model and a migration for the Integration
model.
class User < ApplicationRecord
# ...
has_many :integrations,
dependent: :destroy, extend: HasIntegrations,
as: :owner
# ...
end
# Get Stripe Integration.
stripe_integration = user.integrations[:stripe]
# Set Stripe Integration.
# This will create and save a new integration
# if there wasn't already a stripe integration record.
user.integrations[:stripe] = { "livemode" => false, "stripe_user_id" => 1 }
# Check if an Integration exists.
user.integrations.has?(:stripe)
# => true or false
This gem assumes each owning object can only have one type of each integration.
In config/initializers/has_integrations.rb
:
HasIntegrations.encryption_key = 'my great key'
Used for attr_encrypted
on the config column
With the built in Integration
class, you can monkey patch to add validations / whatever other logic.
Integration
class. This may be a weird config option, because the Integration
class needs kind
, encrypted_config
, owner_id
, and owner_type
-- would all these columns need to be configurable?FAQs
Unknown package
We found that has_integrations 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.