
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.
@entur/csp
Advanced tools
Generate CSP headers with help from TypeScript.
The Content-Security-Policy is an important security feature. But it can get pretty long and cumbersome to update. This nifty tool lets you generate the header string from a JavaScript (or TypeScript) object.
If you are using TypeScript you can use our enums to get help in the form of type coverage and autocomplete in your editor.
npm install @entur/csp
// myCsp.ts
import { stringifyCSP, Directive, PolicyValue } from '@entur/csp'
const myDomains = [
PolicyValue.SELF,
'example.com',
'*.example.com',
]
const policyString = stringifyCSP({
[Directive.DEFAULT_SRC]: [SELF],
[Directive.CONNECT_SRC]: [
...MY_DOMAINS,
],
[Directive.SCRIPT_SRC]: [
PolicyValue.SELF,
PolicyValue.UNSAFE_INLINE,
PolicyValue.UNSAFE_EVAL,
PolicyValue.BLOB,
'https://www.googletagmanager.com',
'https://tagmanager.google.com',
],
[Directive.IMG_SRC]: [
...MY_DOMAINS,
PolicyValue.DATA,
PolicyValue.BLOB,
'https://www.google-analytics.com',
],
[Directive.STYLE_SRC]: [
PolicyValue.SELF,
PolicyValue.UNSAFE_INLINE,
],
})
FAQs
Generate CSP headers with help from TypeScript
The npm package @entur/csp receives a total of 403 weekly downloads. As such, @entur/csp popularity was classified as not popular.
We found that @entur/csp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 open source maintainers 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.