Archived
1
0

add timestamp to auth log, add fail2ban conf+docs

This commit is contained in:
Dean Sheather
2019-07-09 10:57:09 +10:00
parent 14d917179c
commit c48a275d33
3 changed files with 60 additions and 1 deletions

View File

@ -89,13 +89,15 @@ export const createApp = async (options: CreateAppOptions): Promise<{
if (cookies.password) {
if (!safeCompare(cookies.password, options.password)) {
let userAgent = req.headers["user-agent"];
let timestamp = Math.floor(new Date().getTime() / 1000);
if (Array.isArray(userAgent)) {
userAgent = userAgent.join(", ");
}
logger.info("Failed login attempt",
field("password", cookies.password),
field("remote_address", remoteAddress(req)),
field("user_agent", userAgent));
field("user_agent", userAgent),
field("timestamp", timestamp));
return false;
}