+ Implement SSH PubKey authentication

* Security related items to config/security dir
This commit is contained in:
Bryan Ashby 2019-02-20 23:55:09 -07:00
parent 65ef1feb6c
commit 57938e761e
No known key found for this signature in database
GPG key ID: B49EB437951D2542
7 changed files with 164 additions and 96 deletions

View file

@ -22,7 +22,12 @@ const _ = require('lodash');
exports.userLogin = userLogin;
function userLogin(client, username, password, cb) {
function userLogin(client, username, password, options, cb) {
if(!cb && _.isFunction(options)) {
cb = options;
options = {};
}
const config = Config();
if(config.users.badUserNames.includes(username.toLowerCase())) {
@ -34,7 +39,7 @@ function userLogin(client, username, password, cb) {
}, 2000);
}
client.user.authenticate(username, password, err => {
client.user.authenticate(username, password, options, err => {
if(err) {
client.user.sessionFailedLoginAttempts = _.get(client.user, 'sessionFailedLoginAttempts', 0) + 1;
const disconnect = config.users.failedLogin.disconnect;