在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:koajs/koa-lusca开源软件地址:https://github.com/koajs/koa-lusca开源编程语言:JavaScript 100.0%开源软件介绍:koa-luscaWeb application security middleware for koa. Fork from lusca, krakenjs/lusca#26. Usagevar koa = require('koa');
var lusca = require('koa-lusca');
var app = koa();
app.use(lusca({
csrf: true,
csp: { /* ... */},
xframe: 'SAMEORIGIN',
p3p: 'ABCDEF',
hsts: { maxAge: 31536000, includeSubDomains: true },
xssProtection: true
})); Setting any value to app.use(lusca.csrf());
app.use(lusca.csp({/* ... */}));
app.use(lusca.xframe({ value: 'SAMEORIGIN' }));
app.use(lusca.p3p({ value: 'ABCDEF' }));
app.use(lusca.hsts({ maxAge: 31536000 });
app.use(lusca.xssProtection(); APIlusca.csrf(options)
Enables Cross Site Request Forgery (CSRF) headers. If enabled, the CSRF token must be in the payload when modifying data or you will receive a 403 Forbidden. To send the token you'll need to echo back the lusca.csp(options)
Enables Content Security Policy (CSP) headers. Example Options// Everything but images can only come from own domain (excluding subdomains)
{
policy: {
'default-src': '\'self\'',
'img-src': '*'
}
} See the MDN CSP usage page for more information on available policy options. lusca.xframe(value)
Enables X-FRAME-OPTIONS headers to help prevent Clickjacking. lusca.p3p(value)
Enables Platform for Privacy Preferences Project (P3P) headers. lusca.hsts(options)
Enables HTTP Strict Transport Security for the host domain. The preload flag is required for HSTS domain submissions to Chrome's HSTS preload list lusca.xssProtection(options)
Enables X-XSS-Protection headers to help prevent cross site scripting (XSS) attacks in older IE browsers (IE8) License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论