2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-17 21:23:18 +00:00

675 Commits

Author SHA1 Message Date
Jarrod Johnson
a574c69535 Implement SSH host key management
Like self-signed TLS certificates, SSH host keys
warrant a similar security policy.  This implementations
follows the lead of the TLS management and uses the same
policy name and interpretation, just storing the value
in 'pubkeys.ssh' for the node rather than an extensible
set of entry points (for now).
2016-02-11 09:13:21 -05:00
Jarrod Johnson
a2445e7f65 Have client exit on auth issue
Without this, an auth error will leave client just
hanging without any feedback.  Correct this with
raising an exception for now.
2016-01-28 10:26:28 -05:00
Jarrod Johnson
0b51edde97 Merge branch 'jjohnson42-fixwget' 2016-01-28 10:19:17 -05:00
Jarrod Johnson
6b014deb04 Fix response to wget and similar
If the client comes in without an HTTP_ACCEPT at all,
do not trigger a trace.
2016-01-28 10:17:06 -05:00
Jarrod Johnson
366de1235c Merge pull request #55 from jjohnson42/sshconsole
Implement shell infrastructure with ssh support
2016-01-08 15:06:26 -05:00
Jarrod Johnson
1d67f10432 Merge branch 'sshconsole' of github.com:jjohnson42/confluent into sshconsole 2016-01-08 14:55:17 -05:00
Jarrod Johnson
6e1adc88dd Have sessions deleted on disconnect
When the shell session disconnects, destroy all dependent
sessions.
2016-01-08 14:44:52 -05:00
Jarrod Johnson
2419d95b74 Rework session to console relationship
Previously, was using counters to track the relation, also had distinct tracking of users versus
callbacks.  Unify the callback and user into a single 'session' attach and then use the size
of the set of sessions and their declared users rather than trying to maintain a counter on the side.

This change simplifies the relationship, changes away the logging and clientcount counter for
a more robust strategy, and paves the way for the dependent ShellHandler to terminate connected
sessions when the shell session dies.
2016-01-08 14:44:49 -05:00
Jarrod Johnson
62801734ab Have shell sessions not autoreconnect
Unlike consoles, where the underlying concept is a real
persistent thing that needs some care to reattach to watch,
a shell session should die when it is lost, as a new one would
have to be created anyway.  Modify the disconnect behavior
for a shell session to set closed and notify the receivers.
It should also reap dependent watching objects in a future
change.
2016-01-08 14:44:47 -05:00
Jarrod Johnson
cf16bfdd95 Have builds include shell plugins
The builds were excluding the ssh plugin, correct the oversight.
2016-01-08 14:44:45 -05:00
Jarrod Johnson
d0bd275cb3 Instrument sessions/ collection
This causes some additional features into core.  Namely
the ability to use a fixed module rather than a string
defined plugin.  This allows shellserver to implement the
'plugin' interface without living in 'plugins'.  'plugins'
implies modularity and potential eventual choice, but
this functionality is core.  It would make sense for the
'attributes' plugin to be changed to match this strategy.
2016-01-08 14:44:42 -05:00
Jarrod Johnson
a332678312 Avoid double connect on shell start
When a shell session is initiated, it registers
a recipient at the same time it would be trying
to establish session for not being a 'wait for
recipient'.  Aggressively mark the state as connecting
to avoid the recipient erroneously thinking things have
not be set into motion yet.  Additionally, have the ssh
plugin avoid a traceback when disconnecting before completing
connection.
2016-01-08 14:44:39 -05:00
Jarrod Johnson
cfafa5a5bc Connect shellserver to httpapi
Have httpapi recognize the difference and start a shellserver
session when appropriate.  Next step will be to wire up enumeration of
current shellserver sessions, debug ssh.py traceback, delete on remote
close, and auto-delete when no client connected after some interval (e.g.
30 minutes).
2016-01-08 14:44:37 -05:00
Jarrod Johnson
23f025eb71 Use a plain incrementing session id
UUIDs when a simple number will do are harder to use.
Change to a simple increment id.  This could cause an issue
with multiple management nodes, but I think the sessions
should be contained to the instance used.
2016-01-08 14:44:34 -05:00
Jarrod Johnson
5695bf5288 Fix misuse of console log for shell sessions
console logging assumptions are not valid for shell sessions.
Correct by modifying the buffer init code to be conditional
and adding a stub 'log' to the ShellHandler class.
2016-01-08 14:44:32 -05:00
Jarrod Johnson
3d926bb264 Amend core to pass shell objects through
For 'handler' plugin definitions, also recognize
the 'console' exception to allow the plugin to pass
through to the shellserver infrastructure.
2016-01-08 14:44:29 -05:00
Jarrod Johnson
c8e5644061 Refactor socket api terminal handler
The 'terminal' handler code is broken out to get ready
for using 'shell' as well as 'console'
2016-01-08 14:44:27 -05:00
Jarrod Johnson
ff857bce14 Retrofit consoleserver and make shellserver
Provide a common 'shellserver' capability cloned off of 'consoleserver'.
This will enable the concept of per-user shells with option for multiple
shells per.  Each user will have their own set of shell sessions rather
than shared across users.  Can revisit in future if sharing between
users is desired.
2016-01-08 14:44:25 -05:00
Jarrod Johnson
9146fce016 Add internal resource for 'shell' 2016-01-08 14:44:22 -05:00
Jarrod Johnson
afa67f9bf7 Add a module for ssh 'console' API
Create a module that does ssh and treats it like
a console.  The plan is to have a cliserver.py to
behave in a manner resembling consoleserver.py, but
with option to have multiple distinct sessions per
target.
2016-01-08 14:44:13 -05:00
Jarrod Johnson
d54e31a1c5 Merge pull request #54 from jjohnson42/tlspolicies
Implement strategy for dealing with TLS targets
2016-01-08 14:40:15 -05:00
Jarrod Johnson
15ddb554f9 Have sessions deleted on disconnect
When the shell session disconnects, destroy all dependent
sessions.
2016-01-08 14:39:01 -05:00
Jarrod Johnson
4a660d2fb1 Rework session to console relationship
Previously, was using counters to track the relation, also had distinct tracking of users versus
callbacks.  Unify the callback and user into a single 'session' attach and then use the size
of the set of sessions and their declared users rather than trying to maintain a counter on the side.

This change simplifies the relationship, changes away the logging and clientcount counter for
a more robust strategy, and paves the way for the dependent ShellHandler to terminate connected
sessions when the shell session dies.
2016-01-08 11:23:55 -05:00
Jarrod Johnson
849193cf98 Have shell sessions not autoreconnect
Unlike consoles, where the underlying concept is a real
persistent thing that needs some care to reattach to watch,
a shell session should die when it is lost, as a new one would
have to be created anyway.  Modify the disconnect behavior
for a shell session to set closed and notify the receivers.
It should also reap dependent watching objects in a future
change.
2016-01-07 16:51:22 -05:00
Jarrod Johnson
00feca7e5b Have builds include shell plugins
The builds were excluding the ssh plugin, correct the oversight.
2016-01-07 16:15:59 -05:00
Jarrod Johnson
be75018609 Instrument sessions/ collection
This causes some additional features into core.  Namely
the ability to use a fixed module rather than a string
defined plugin.  This allows shellserver to implement the
'plugin' interface without living in 'plugins'.  'plugins'
implies modularity and potential eventual choice, but
this functionality is core.  It would make sense for the
'attributes' plugin to be changed to match this strategy.
2016-01-07 15:36:44 -05:00
Jarrod Johnson
a891745386 Avoid double connect on shell start
When a shell session is initiated, it registers
a recipient at the same time it would be trying
to establish session for not being a 'wait for
recipient'.  Aggressively mark the state as connecting
to avoid the recipient erroneously thinking things have
not be set into motion yet.  Additionally, have the ssh
plugin avoid a traceback when disconnecting before completing
connection.
2016-01-07 10:30:30 -05:00
Jarrod Johnson
46d3779774 Connect shellserver to httpapi
Have httpapi recognize the difference and start a shellserver
session when appropriate.  Next step will be to wire up enumeration of
current shellserver sessions, debug ssh.py traceback, delete on remote
close, and auto-delete when no client connected after some interval (e.g.
30 minutes).
2016-01-06 17:03:10 -05:00
Jarrod Johnson
5d73548583 Use a plain incrementing session id
UUIDs when a simple number will do are harder to use.
Change to a simple increment id.  This could cause an issue
with multiple management nodes, but I think the sessions
should be contained to the instance used.
2016-01-06 11:40:31 -05:00
Jarrod Johnson
8ae8b79837 Fix misuse of console log for shell sessions
console logging assumptions are not valid for shell sessions.
Correct by modifying the buffer init code to be conditional
and adding a stub 'log' to the ShellHandler class.
2016-01-06 11:27:11 -05:00
Jarrod Johnson
0df21ddeb0 Amend core to pass shell objects through
For 'handler' plugin definitions, also recognize
the 'console' exception to allow the plugin to pass
through to the shellserver infrastructure.
2016-01-06 10:06:09 -05:00
Jarrod Johnson
0e821a7bfe Refactor socket api terminal handler
The 'terminal' handler code is broken out to get ready
for using 'shell' as well as 'console'
2016-01-05 16:29:21 -05:00
Jarrod Johnson
30ed563810 Retrofit consoleserver and make shellserver
Provide a common 'shellserver' capability cloned off of 'consoleserver'.
This will enable the concept of per-user shells with option for multiple
shells per.  Each user will have their own set of shell sessions rather
than shared across users.  Can revisit in future if sharing between
users is desired.
2016-01-05 15:34:52 -05:00
Jarrod Johnson
89edc020d5 Use correct exception params on manual policy
In the rework of the exception to include full certificate
in body, a call was missed in the verify_cert() routine.
2015-12-01 09:11:08 -05:00
Jarrod Johnson
e2b79a063d Provide full certificate to client on error
When a certificate error happens, provide full certificate data to the
caller so that they may implement whatever strategy they feel appropriate.
2015-11-30 12:32:14 -05:00
Jarrod Johnson
f6ce9f2c1e Add infrastructure for TLS certificate handling
When connecting to peer devices that use TLS, provide
a mechanism of tracking peer fingerprint and handling
missing or mismatch of fingerprint.
2015-11-25 11:39:48 -05:00
Jarrod Johnson
ba9d62b4e5 Merge pull request #53 from jjohnson42/fixnonrootconfetty
No longer break when prompting for name/password
1.2.0
2015-11-16 14:56:44 -05:00
Jarrod Johnson
4442ce1c71 No longer break when prompting for name/password
In the confetty CLI, readline clear history was done as
part of login process.  Since readline is not a given
to accomodate scripting behaviors, no longer do the
clear_history().  The concern I had was that
the password might have gotten into history, but that
seems to not be the case.
2015-11-10 12:56:04 -05:00
Jarrod Johnson
1d64792cb9 Merge pull request #52 from jjohnson42/nopam
Remove hard require of PyPAM
2015-11-10 11:11:32 -05:00
Jarrod Johnson
e721f8836e Remove hard require of PyPAM
Since PAM support is not a mandatory feature,
do not make it required to install.
2015-11-10 11:10:11 -05:00
Jarrod Johnson
6770fe9342 Merge pull request #51 from jjohnson42/fixdynamicgroups
Correct dynamic group behavior
2015-11-06 11:57:05 -05:00
Jarrod Johnson
804d4c2d95 Correct dynamic group behavior
Expansion of a noderange containing a dynamic group
would erroneously make the dynamic members get promoted
to 'permament' members.  Fix this by isolating the
change so that the underlying group config is not changed
just by adding in dynamic nodes.
2015-11-06 11:55:13 -05:00
Jarrod Johnson
f946fab3c5 Merge pull request #50 from jjohnson42/fixhttpapi
Force 'databynode' to consistently be an array
2015-11-03 09:10:35 -05:00
Jarrod Johnson
5a0ac899b9 Force 'databynode' to consistently be an array
If only one node was in given noderange, then
the httpapi response would not look similar in
structure to a multi-node response.  Force even
single items in this special case to be an array
to allow easier javascript client code.
2015-11-03 09:08:18 -05:00
Jarrod Johnson
dfc1e32546 Merge branch 'sshconsole' of github.com:jjohnson42/confluent into sshconsole 2015-11-03 09:06:59 -05:00
Jarrod Johnson
310bd11669 Merge pull request #49 from jjohnson42/fixsystemd
Prevent hang on systemctl stop confluent
2015-11-02 14:13:23 -05:00
Jarrod Johnson
5ab1d6ea59 Prevent hang on systemctl stop confluent
systemd's default stop seems to be incapable of understanding
how to shut down our service.  Provide an explicit ExecStop
to have systemd act more sanely.
2015-11-02 14:11:07 -05:00
Jarrod Johnson
d03ca6eafe Add internal resource for 'shell' 2015-10-28 10:50:27 -04:00
Jarrod Johnson
4d148751e5 Add a module for ssh 'console' API
Create a module that does ssh and treats it like
a console.  The plan is to have a cliserver.py to
behave in a manner resembling consoleserver.py, but
with option to have multiple distinct sessions per
target.
2015-10-28 10:50:22 -04:00
Jarrod Johnson
d8c3b2f267 Merge pull request #48 from jjohnson42/debugsignals
Add facility to dump trace to log
2015-10-28 10:46:09 -04:00