Commit Graph

22 Commits

Author SHA1 Message Date
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