
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Browserify plugin that bans certain packages from being imported.
Normally you should do this at the package manager level (e.g. using dependency-ban). However, this plugin is useful in scenarios when you want to use a dependency but want to ensure that only parts of it are ever included in the browserify build.
This plugin is inspired by Apache Maven Enforcer Plugin.
Let's say you are using lodash and only cherry-picking certain functions to keep the resulting bundle small.
var find = require('lodash/collection/find');
You want to enforce that no one accidentally requires all of lodash (e.g. by require('lodash')
) because that would invalidate the effort. You can use banify to do that:
var banify = require('banify');
var BLACKLIST = [
'lodash',
];
gulp.src(['./index.js'])
.pipe(bro({
plugin: [banify(BLACKLIST)]
}))
The plugin fails the build if require('lodash')
or is found anywhere in the codebase. Other imports (e.g. require('lodash/collection/find')
) will succeed.
Besides exact matches a blacklist can also contain regular expressions:
var BLACKLIST = [
/lodash\/fp\/.*/,
];
FAQs
Browserify plugin that enforces that certain packages are not imported
We found that banify 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.