Implement preliminary pentest remediations

This commit is contained in:
Tuan Dang
2023-06-05 00:44:10 +01:00
parent 4865b69e6d
commit 0c18bd71c4
14 changed files with 3592 additions and 22 deletions
+2 -1
View File
@@ -34,12 +34,13 @@ const sendMail = async ({
const temp = handlebars.compile(html);
const htmlToSend = temp(substitutions);
await smtpTransporter.sendMail({
const x = await smtpTransporter.sendMail({
from: `"${await getSmtpFromName()}" <${await getSmtpFromAddress()}>`,
to: recipients.join(', '),
subject: subjectLine,
html: htmlToSend
});
} catch (err) {
Sentry.setUser(null);
Sentry.captureException(err);
+2 -11
View File
@@ -8,9 +8,6 @@ const apiLimiter = rateLimit({
legacyHeaders: false,
skip: (request) => {
return request.path === '/healthcheck' || request.path === '/api/status'
},
keyGenerator: (req, res) => {
return req.clientIp
}
});
@@ -19,10 +16,7 @@ const authLimit = rateLimit({
windowMs: 60 * 1000,
max: 10,
standardHeaders: true,
legacyHeaders: false,
keyGenerator: (req, res) => {
return req.clientIp
}
legacyHeaders: false
});
// 10 requests per hour
@@ -30,10 +24,7 @@ const passwordLimiter = rateLimit({
windowMs: 60 * 60 * 1000,
max: 10,
standardHeaders: true,
legacyHeaders: false,
keyGenerator: (req, res) => {
return req.clientIp
}
legacyHeaders: false
});
const authLimiter = (req: any, res: any, next: any) => {