Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
content-security-policy
Advanced tools
Readme
Middleware to add Content-Security-Policy header according to http://www.w3.org/TR/CSP/
$ npm install content-security-policy --save
$ npm install --dev
$ npm test
const csp = require('content-security-policy');
const express = require('express');
const app = express();
const cspPolicy = {
'report-uri': '/reporting',
'default-src': csp.SRC_NONE,
'script-src': [ csp.SRC_SELF, csp.SRC_DATA ]
};
const globalCSP = csp.getCSP(csp.STARTER_OPTIONS);
const localCSP = csp.getCSP(cspPolicy);
// This will apply this policy to all requests if no local policy is set
app.use(globalCSP);
app.get('/', (req, res) => {
res.send('Using global content security policy!');
});
// This will apply the local policy just to this path, overriding the globla policy
app.get('/local', localCSP, (req, res) => {
res.send('Using path local content security policy!');
});
app.listen(3000, () => {
console.log('Example app listening on port 3000!');
});
FAQs
Middleware to add Content-Security-Policy header.
The npm package content-security-policy receives a total of 936 weekly downloads. As such, content-security-policy popularity was classified as not popular.
We found that content-security-policy 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.