Commit Graph

39 Commits

Author SHA1 Message Date
Ken Moore
bcaf188dc1 Disable the installation of the jobd routines, and also deactivate the 2nd layer SSL encryption through a bridge for the moment (base64 only right now). 2016-06-21 15:14:29 -04:00
Ken Moore
ea9ed1fa6b Enable a randomized encryption layer within the server->client communications through a bridge. 2016-05-27 11:39:12 -04:00
Ken Moore
ce41041ce5 Get encryption turned on in the server for bridged connections. Still not fully-functional - but getting there. 2016-05-26 15:37:55 -04:00
Ken Moore
9fcc25d239 Clean up some more of the communication system for the server/client connection through a bridge. Seems to be functioning with base64 encoding only right now. 2016-05-26 13:31:46 -04:00
Ken Moore
68a4bb29c7 Get the encryption systems setup with a temporary base64 encoding instead of full SSL encryption (for testing the encode/decode routines) 2016-05-25 09:01:38 -04:00
Ken Moore
12d2517f17 Another couple minor tweaks to the server auth systems. 2016-05-25 08:35:35 -04:00
Ken Moore
4ec1dd2694 Get the server all setup for enabling encryption (alternate API calls implemented - just no encryption turned on yet). 2016-05-25 08:16:15 -04:00
Ken Moore
2ac91c7c70 Get all the MD5 key generation/matching functional for the server/bridge. Also add an internal 1 minute timer to the bridge connections just to check/remove any broken connections as necessary. 2016-05-23 10:31:49 -04:00
Ken Moore
23c254e11e Get a lot more of the bridge/server connections functional. Just have to work through a mismatch between server/client MD5 sums of valid keys. 2016-05-20 14:11:06 -04:00
Ken Moore
a81ca75519 Add a new CLI option to the sysadm server:
"-import_ssl_key <user> <key> <nickname> [<email>]": This will add the designated key (file path or raw text) to the SSL keys available for authentication to the server.
2016-05-17 12:42:14 -04:00
Ken Moore
8a16f9a4d0 Completely finish up the raw changes to the sysadm-server so it can operator over a bridge connection (untested).
This also adds some stand-alone CLI options to the sysadm-binary utility:
"bridge_list": List any bridge connections in the settings file. Output Format: "name (url)"
"bridge_add <name> <url>": Add a bridge connection to the settings with the given name. (if websocket server is running, this change will take effect within 5 minutes).
"bridge_remove <name>": Remove a bridge connection from the settings. If a websocket server is running, this change will take effect within 5 minutes (closing the connection to the removed bridge as needed).

There is also a new option in the global server config file:
BRIDGE_CONNECTIONS_ONLY=[true/false]
If true, this will allow the websocket server to run without listening on any ports, and instead force all traffic through the existing bridge connections.
2016-05-12 10:25:16 -04:00
Ken Moore
916069ce69 Add support for the server to become the initiator in a client->bridge connection. The bridge setting to use are still not implemented yet, and the new bridge-specific SSL key pair still needs to be created on first run. 2016-05-11 15:29:37 -04:00
Ken Moore
9012c7cb57 Add an additional localhost verification check for passwordless logins: Ensure that the designated user is actually active on the localhost (via "users" if no graphical sessions running, or number of active processes if there are graphical sessions running) 2016-05-11 12:14:20 -04:00
Ken Moore
a303e160af Get the sysadm-server all setup for bridge relay connections (untested). 2016-05-10 15:56:16 -04:00
Ken Moore
9287390e54 Fix up the parsing/usage of REST requests in the sysadm server. A Websocket-specific filtering rule was put in place earlier which was filtering out all the REST messages. 2016-05-09 10:15:59 -04:00
Ken Moore
f9af7c2efe Add a API call to the server:
rpc/settings: "action" = "list_ssl_checksums"
This will list the MD5 checksums of all the known SSL keys (in no particular order)

REST Request:
-------------------------------
PUT /rpc/settings
{
   "action" : "list_ssl_checksums"
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "list_ssl_checksums"
   },
   "namespace" : "rpc",
   "name" : "settings",
   "id" : "fooid"
}

Response:
-------------------------------
{
  "args": {
    "md5_keys": [
      "0`H\u0013\r*\u00023\u000bc"
    ]
  },
  "id": "fooid",
  "name": "response",
  "namespace": "rpc"
}
2016-05-05 09:55:38 -04:00
Ken Moore
b27166d1d4 Add a couple new settings:
auth/allowUserPassAuth [bool]: Enable username/password combinations for authentication (default value: true)
auth/allowServiceAuth [bool]: Allow local services to connect to the server with reduced priviledges (default value: false)
2016-04-29 14:37:55 -04:00
Ken Moore
3cebb77190 Clean up some of the dispatcher multi-threading, and turn off some debugging in the auth manager. 2016-02-29 16:15:20 -05:00
Ken Moore
e1c162454e Fix a bug in the auth system where exising auth tokens could accidentally get removed from the internal hash. 2016-02-25 12:46:27 -05:00
Ken Moore
e64bf091ab Rework how the SSL registration information is saved/retrieved for listing a bit. 2016-02-25 09:24:40 -05:00
Ken Moore
dddfabaef2 Just in case, also specify the char* length on the server when loading it into the QByteArray. 2016-02-23 11:22:56 -05:00
Ken Moore
775ce5c337 Remove a lot of debugging and fix a possible crash with the SSL decrypt routine on the server. This now completely works. 2016-02-23 11:20:59 -05:00
Ken Moore
cab15e9137 Revert "Fix the crash of the server on SSL login attempt - still does not work reliably though."
The encrypt/decrypt string method works better than the SSL hash/sign/verify routine from this commit.
This reverts commit 68a520bb48.
2016-02-23 10:39:43 -05:00
Ken Moore
68a520bb48 Fix the crash of the server on SSL login attempt - still does not work reliably though. 2016-02-22 16:45:55 -05:00
Ken Moore
dfdc795bb2 Require that the SSL public key be base64 encoded when recieved for registration on the server. Also change the server SSL type flag to TLS 1.0 or later (instead of TLS 1.0 only) 2016-02-22 14:02:02 -05:00
Ken Moore
7e230c5f5f Change the location of the sysadm server internal settings file (QSettings file), and add support for an optional sysadm.conf file which is loaded on server startup. 2016-02-22 12:25:52 -05:00
Ken Moore
19618b7581 Get rid of the "toLatin1()" call when converting the base64 encrypted string to a bytearray. 2016-02-19 16:25:13 -05:00
Ken Moore
9bb9add1db Update the server to expect a base64 encoded string as the encrypted string (for JSON transport). 2016-02-19 16:07:39 -05:00
Ken Moore
767bf82ec8 Finish fixing up the new auth_ssl option (lots of debugging still enabled). The SSL encode/decode systems still are not working yet - looks like an inherent incompatibility with a text-base transport system (JSON), so we will need to find another method (acting on a file and sending the hash instead?). 2016-02-19 15:13:29 -05:00
Ken Moore
6cfaf6e597 Completely re-do the SSL authentication systems. Now it is a two-stage auth system, where the server generates a random string, sends it to the client for encryptions with their private SSL key, then gets sent back to the server where the new string is decrypted with the known SSL keys and compared to teh original for accuracy. 2016-02-18 17:01:09 -05:00
Ken Moore
750f7c8c85 Turn off some debugging which was pringting the user/pass combo to the log file. 2016-02-11 09:18:09 -05:00
Ken Moore
06edd43945 Add API call for list/register/revoke SSL Certificate management (auth system: alternate for the user/password combo). I don't have a way to test this just yet (still need to write the other side of the system in the client first), but here is the expected inputs:
Namespace: "sysadm"
Name: "settings"
Arguments structure needs the "action" variable/value for all calls:

Action: "list_ssl_certs"
 - No additional input needed: will list the known/registered certificates organized by <username> : { <public_key> : <certificate as text> }

Action: "register_ssl_cert"
Example Payload: {"action" : "register_ssl_cert", "pub_key" : <public_key> }
The <public_key> string needs to match the public key of one of the certificates currently loaded into the server/client connection. This will register that certificate on the server and allow that user to authenticate without a password as long as that same certificate is loaded up in any future connections. No special outputs are send back (just overall error/ok status).

Action: "revoke_ssl_cert"
Example Payload: {"action" : "revoke_ssl_cert", "pub_key" : <public_key>, "user" : <optional-username> }
The <public_key> string needs to match one of the keys given by the list function (does not need to match any currently-loaded certs). The "user" field is optional, and allows a connection with full admin privileges to revoke certs belonging to other users.

Note about current user/connection permissions level:
If the current user has full admin access, the "list_ssl_certs" API call will return the registered certificates for all users on the system - otherwise it will only return the certificates for the current user. Similarly, the "revoke_ssl_cert" may be used to remove certs registered to other users only if the current user/connection has full admin access - otherwise it may only be used to manage the current user's certificates.
2016-02-10 13:26:46 -05:00
Ken Moore
edbef3e759 Add a full chain of SSL Certificate management fucntions to the authorization manager, and setup the main "auth" API call to use the cert system if no password was supplied for authorization.
While here, also move the location of the server config file to /usr/local/etc/sysadm.conf, and print out that location in the main server log file.
2016-02-10 12:43:06 -05:00
Ken Moore
e1b9bc833c Fix up the detection of the localhost address when there is both IPv4 and IPv6 information available for the connection. 2016-02-09 09:18:21 -05:00
Ken Moore
8166ef8a79 Cleanup a lot of the logging in the sysadm server. Now the hostinfo log file will clearly list connection time/IP, auth attempts/IP, Dispatches/IP, disconnections/IP. The dispatcher and events systems also properly log activity within their individual log files. 2016-02-02 13:46:23 -05:00
Ken Moore
b36958b33a Enable a bit more logging from host/client connections. Still seems to be a problem with the log getting saved to disk though. 2016-02-01 16:37:39 -05:00
Ken Moore
1ae716ebfc Add IP blacklisting to the sysadm server.
Current Settings:
1) 5 auth attempts allowed before failover
2) If no communications for 10 minutes, the failover counter gets reset
3) On failover - the IP is placed on the server blacklist for 1 hour
Note: The blacklist system is connection independant, and uses the host IP for unique tracking/blocking.
2016-01-21 10:12:13 -05:00
Ken Moore
d93b0a5ba7 Add a new auth subsystem to teh backend of the server.
Now the user's who login are divided up into "Full Access" users or not. This allows for additional restrictions in the backend subsystems to restrict certain types of operations to only the "full access" (root-permissioned) users.
The users are divided up like this:
1) The user must be in either the "wheel" or "operator" groups to get any access whatsoever (restricting automated services from connecting).
2) If the user is in the "wheel" group, they get full access to the server's capabilities
3) If the user is in the "operator" group instead, then they only get limited access to the server's capabilities.

While here, also allow password-less logins to the server if the client is connecting to a server on the same system (local access). User restrictions still apply.
2016-01-13 13:12:10 -05:00
Ken Moore
f5dab0048c Add a copy of the syscache-webclient server into the sysadm/src/server.
Also setup the server to make it easier to extend for API/library support in the backend. All backend functionality can now be added to the new "WebBackend.cpp" file (and WebSocket.h file for headers).
2015-12-15 13:06:42 -05:00