diff --git a/authenticode.js b/authenticode.js index 213d3d4d..37d39d50 100644 --- a/authenticode.js +++ b/authenticode.js @@ -1235,7 +1235,7 @@ function createAuthenticodeHandler(path) { if (args.hash == 'sha512') { hashOid = forge.pki.oids.sha512; fileHash = obj.getHash('sha512'); } if (args.hash == 'sha224') { hashOid = forge.pki.oids.sha224; fileHash = obj.getHash('sha224'); } if (args.hash == 'md5') { hashOid = forge.pki.oids.md5; fileHash = obj.getHash('md5'); } - if (hashOid == null) { func(false); return; }; + if (hashOid == null) { func('Invalid signing hash: ' + args.hash); return; }; // Create the signature block var xp7 = forge.pkcs7.createSignedData(); @@ -1453,7 +1453,7 @@ function createAuthenticodeHandler(path) { // Open the output file var output = null; try { output = fs.openSync(args.out, 'w+'); } catch (ex) { } - if (output == null) { func(false); return; } + if (output == null) { func('Unable to open output file: ' + args.out); return; } var tmp, written = 0, executableSize = obj.header.sigpos ? obj.header.sigpos : filesize; // Compute pre-header length and copy that to the new file diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 3a1df702..14b39226 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -343,6 +343,7 @@ "ipkvm": { "type": "boolean", "default": false, "description": "Set to true to enable IP KVM device support in this domain." }, "minify": { "type": "boolean", "default": false, "description": "When enabled, the server will send reduced sided web pages." }, "newAccounts": { "type": "boolean", "default": false, "description": "When set to true, allow new user accounts to be created from the login page." }, + "newAccountsPass": { "type": "string", "default": null, "description": "When set this password will be required in order to create a new account from the login screen." }, "newAccountsUserGroups": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, "userNameIsEmail": { "type": "boolean", "default": false, "description": "When enabled, the username of each account is also the email address of the account." }, "newAccountEmailDomains": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, diff --git a/meshcentral.js b/meshcentral.js index 3aa2a17e..77867e70 100644 --- a/meshcentral.js +++ b/meshcentral.js @@ -3675,6 +3675,7 @@ function mainStart() { var wildleek = false; var nodemailer = false; var sendgrid = false; + var captcha = false; if (require('os').platform() == 'win32') { for (var i in config.domains) { domainCount++; if (config.domains[i].auth == 'sspi') { sspi = true; } else { allsspi = false; } } } else { allsspi = false; } if (domainCount == 0) { allsspi = false; } for (var i in config.domains) { @@ -3697,6 +3698,7 @@ function mainStart() { } if (config.domains[i].sessionrecording != null) { sessionRecording = true; } if ((config.domains[i].passwordrequirements != null) && (config.domains[i].passwordrequirements.bancommonpasswords == true)) { wildleek = true; } + if ((config.domains[i].newaccountscaptcha != null) && (config.domains[i].newaccountscaptcha !== false)) { captcha = true; } } // Build the list of required modules @@ -3705,6 +3707,8 @@ function mainStart() { if (ldap == true) { modules.push('ldapauth-fork'); } if (ssh == true) { if (nodeVersion < 11) { addServerWarning('MeshCentral SSH support requires NodeJS 11 or higher.', 1); } else { modules.push('ssh2'); } } if (passport != null) { modules.push(...passport); } + if (captcha == true) { modules.push('svg-captcha'); } + if (sessionRecording == true) { modules.push('image-size'); } // Need to get the remote desktop JPEG sizes to index the recodring file. if (config.letsencrypt != null) { modules.push('acme-client'); } // Add acme-client module if (config.settings.mqtt != null) { modules.push('aedes@0.39.0'); } // Add MQTT Modules diff --git a/mpsserver.js b/mpsserver.js index cacc4241..0fe4d631 100644 --- a/mpsserver.js +++ b/mpsserver.js @@ -58,7 +58,7 @@ module.exports.CreateMpsServer = function (parent, db, args, certificates) { obj.server.listen(args.mpsport, args.mpsportbind, function () { console.log("MeshCentral Intel(R) AMT server running on " + certificates.AmtMpsName + ":" + args.mpsport + ((args.mpsaliasport != null) ? (", alias port " + args.mpsaliasport) : "") + "."); obj.parent.authLog('mps', 'Server listening on ' + ((args.mpsportbind != null) ? args.mpsportbind : '0.0.0.0') + ' port ' + args.mpsport + '.'); - }).on("error", function (err) { console.error("ERROR: MeshCentral Intel(R) AMT server port " + args.mpsport + " is not available."); if (args.exactports) { process.exit(); } }); + }).on("error", function (err) { console.error("ERROR: MeshCentral Intel(R) AMT server port " + args.mpsport + " is not available. Check if the MeshCentral is already running."); if (args.exactports) { process.exit(); } }); obj.server.on('tlsClientError', function (err, tlssocket) { if (args.mpsdebug) { var remoteAddress = tlssocket.remoteAddress; if (tlssocket.remoteFamily == 'IPv6') { remoteAddress = '[' + remoteAddress + ']'; } console.log('MPS:Invalid TLS connection from ' + remoteAddress + ':' + tlssocket.remotePort + '.'); } }); } diff --git a/package.json b/package.json index c7126152..9eaa2dd4 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,8 @@ "sample-config-advanced.json" ], "dependencies": { + "@crowdsec/express-bouncer": "^0.1.0", + "@yetzt/nedb": "^1.8.0", "archiver": "^5.3.1", "body-parser": "^1.19.0", "cbor": "~5.2.0", @@ -45,13 +47,21 @@ "express": "^4.17.0", "express-handlebars": "^5.3.5", "express-ws": "^4.0.0", + "image-size": "^1.0.1", "ipcheck": "^0.1.0", + "loadavg-windows": "^1.1.1", "minimist": "^1.2.5", "multiparty": "^4.2.1", - "@yetzt/nedb": "^1.8.0", "node-forge": "^1.0.0", + "node-windows": "^0.1.4", + "otplib": "^10.2.3", + "pg": "^8.7.1", + "pgtools": "^0.3.2", + "ssh2": "^1.11.0", + "web-push": "^3.5.0", "ws": "^5.2.3", - "yauzl": "^2.10.0" + "yauzl": "^2.10.0", + "yubikeyotp": "^0.2.0" }, "engines": { "node": ">=10.0.0" diff --git a/views/login.handlebars b/views/login.handlebars index e364cd78..9d44fead 100644 --- a/views/login.handlebars +++ b/views/login.handlebars @@ -122,6 +122,14 @@ Creation Token: + + + + + + Security Check: + +
@@ -131,6 +139,7 @@
Back to login +