How can I extend the Sails built in security? For example how can I implement lusca (module from Kraken) in Sails? What are other alternate ways of extending the built in security in Sails?
Extend Sails built in security with lusca
650 views Asked by Cirakuze At
2
There are 2 answers
0
On
The above answer given by @MjZac is perfectly worked. I just want to add an updated version of the file as per the latest version of the sails Js.
var helmet = require('helmet');
module.exports.http = {
cache: 365.25 * 24 * 60 * 60 * 1000,
trustProxy: true,
middleware: {
order: [
'cookieParser',
'session',
'bodyParser',
'compress',
'helmetProtection',
'xss',
'router',
'www',
'favicon'
],
xss: require('lusca').xssProtection('1'),
helmetProtection: function helmetProtection(req, res, next) {
return helmet({
frameguard: false
})(req, res, next);
}
}
};
You can add modules like
luscaandhelmetinhttp.jsand configuring the order.