2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-21 13:00:37 +00:00

100 Commits

Author SHA1 Message Date
Jarrod Johnson
95659db00a Stop trying to use generic cookie parsing
Trying to do so while guarding against errors and sanitizing input was more code and slower
than targeting the one possible cookie we might care about.

So the code is simpler and
the performance is better, and the effect of stray cookies are mitigated.
2020-10-29 11:36:26 -04:00
Jarrod Johnson
3ac6677d2d Sanitize cookies
If an invalid cookie from another site breaks the cookie jar,
then sanitize it.

https://bugs.python.org/issue31456

Performance enhancement through setting a header in javascript in
lieu of cookie parsing seems a wise move for the future.
2020-10-24 11:10:52 -04:00
Jarrod Johnson
e8eaddf375 Fix for HTTP API browser
Python 3 had data coming in as bytes.
2020-08-27 13:11:21 -04:00
Jarrod Johnson
bf706f82cf Fix a typo in httpapi 2020-08-05 08:28:30 -04:00
Jarrod Johnson
16667ed41c Add SSH cert to self api
This allows nodes to get a cert from
confluent.
2020-04-16 13:11:05 -04:00
Jarrod Johnson
dcdc8e4d5a Merge branch 'master' into osdeploy 2020-04-16 12:10:03 -04:00
Jarrod Johnson
f97fd3105f Prevent GET from indicating a non-idempotent opreation
This could bypass CSRF protection in theory.
2020-04-16 12:08:47 -04:00
Jarrod Johnson
58fd760698 Implement begins of self api
This paves the way to get deployment started
in earnest.
2020-04-10 16:46:41 -04:00
Jarrod Johnson
ed050b37e1 Fix httpapi with python3
async is now particularly special,
rename variable to fix it
2020-04-10 11:58:45 -04:00
Jarrod Johnson
331d10140a Fix httpapi with python3
async is now particularly special,
rename variable to fix it
2020-04-10 11:57:59 -04:00
Jarrod Johnson
453c344f7f Fix audit log for non root usage with python 3 2019-10-10 16:07:45 -04:00
Jarrod Johnson
bc85d93cf4 More Py3 fixes 2019-10-09 11:20:03 -04:00
Jarrod Johnson
1e963106fe Fix unicode issues with web api 2019-10-09 11:03:30 -04:00
Jarrod Johnson
a9f0e345db Another set of python3 fixes 2019-10-08 17:10:56 -04:00
Jarrod Johnson
90e546bcac Implement a number of py3 compatible adjustments 2019-10-02 08:58:39 -04:00
Jarrod Johnson
fbc4fc6846 Make unexpected error more specific
Often a usable summary message is obfuscated.  Assume the subject line
is safe to relay, but continue to do a more verbose trace.
2019-07-08 14:28:56 -04:00
Jarrod Johnson
6d5f0cdb16 Make TCP_FASTOPEN opportunistic
Certain Linux-like but not Linux environments fail
at this.
2019-06-27 15:36:27 -04:00
Jarrod Johnson
d33c6be758 Fix forwarder over custom https ports 2019-05-16 14:36:39 -04:00
Jarrod Johnson
4d5bfb13bf Add support for Operator role
Support a reduced privilege user that can still perform
most operations, but cannot modify, delete, or add
users/groups to confluent or to BMCs.
2019-05-01 16:57:15 -04:00
Jarrod Johnson
5289d34206 Fix the exception name in previous commit. 2019-02-11 10:56:29 -05:00
Jarrod Johnson
f7f8247d02 Fallback to older eventlet signature
Older eventlet did not understand some arguments
on wsgi.  Fallback to not using those arguments
if unavailable.
2019-02-11 10:51:56 -05:00
Jarrod Johnson
2d63e68494 Enable support for TCP_FASTOPEN
It might matter in some context.
2019-01-10 15:17:34 -05:00
Jarrod Johnson
b0a3bb18fe Add terminal resizing to http api
This enables javascript clients to submit terminal changes.
2018-11-27 09:12:53 -05:00
Jarrod Johnson
7207013abc Have httpapi be able to accept initial size on consoles
consoles and shells can now put into the body parameters including
the width and height.
2018-11-26 16:43:52 -05:00
Jarrod Johnson
6ba8ca2fa2 Remove accidental change
keepalive was disabled, which negatively impacted
web ui performance.  Re-enable.
2018-06-19 11:07:23 -04:00
Jarrod Johnson
810be71720 Initial support for non-console dispatch
For non-exceptional cases, it is now functional.
2018-06-15 15:54:26 -04:00
Jarrod Johnson
a560dc1974 Add timeout on httpapi socket
Clients that fail to send any data, or keep a persistent socket
open without using it are killed off.
2018-06-01 16:26:21 -04:00
Jarrod Johnson
308db99dbb Fix inconsistent dict member extension
If two portions of a list come back piecewise from the plugin that
are both lists, extend them rather than making a nested list.
2018-03-15 12:09:45 -04:00
Jarrod Johnson
463f61fac7 Modify XSS-Protection directive 2018-03-12 13:41:18 -04:00
Jarrod Johnson
d5be1ccf8c Restrict lifetime of port relay to session
If a session is closed, also kill off any associated
relays in progress.  One exception, video port relay
in ESTABLISHED is left alone due to limitation, but
at least no new open.
2017-10-27 14:47:10 -04:00
Jarrod Johnson
34fb159801 Restrict forward source ip to requestor
This prevents sockets from opening up to the world that could be used
to connect to management interfaces directly, apart from the specific
requestors.
2017-10-22 12:35:12 -04:00
Jarrod Johnson
3a1e9fe0bc Fix typo in function name 2017-10-16 11:21:18 -04:00
Jarrod Johnson
f1f6c3b066 Correct syntax error
The prior commit had a grave syntax error.
2017-10-16 10:30:02 -04:00
Jarrod Johnson
a962a5afc3 Exempt Web Forwarding from CSRF
Web forward from popup context requires it be exempt from CSRF
protection.  This is harmless (as all GET should be, but erring on side
of caution), so add it to the whitelist of CSRF skipping on a CSRF
enabled client session.
2017-10-16 10:20:49 -04:00
Jarrod Johnson
f44eb412c5 Add /nodes/<node>/forward/web
This facilitates GUI to launch web interface,
even if the target is unreachable.
2017-09-22 13:53:37 -04:00
Jarrod Johnson
486c322233 Have binding network sockets occur in a retry loop
There seems to be scenarios where a previously used socket won't open up immediately.  Retry when
this is detected.
2017-01-17 13:59:22 -05:00
Jarrod Johnson
c016c55340 Add HTTP/1.0 cache suppression
There is not a single client that will ever talk
to this service that would not support HTTP/1.1.
However, do this to satisfy a scanner.
2016-11-30 11:42:50 -05:00
Jarrod Johnson
d2156f3d67 Move the anti-referrer login to only logout
This has no functional difference, just a cosmetic
difference that does not give the erroneous impression
a logout actually occurred.  This does mean that if a browser
disables cookies and uses the api explorer, there would
be an opportunity for a CSRF.
2016-11-30 10:15:44 -05:00
Jarrod Johnson
bf8dff90f3 Provide CSRF protection to logout resource
Though more annoying than harmful, guard against CSRF succeeding
against the logout resource.
2016-11-30 10:04:25 -05:00
Jarrod Johnson
004d40e7ca Implement more CSRF countermeasures
At some expense of convenience, make it difficult
for CSRF to succeed even against the API explorer
for most people.  User/Password will now only be
accepted on hitting enter in the address bar rather
than following any link.
2016-11-30 09:57:58 -05:00
Jarrod Johnson
7557136d5d Add a number of security headers
There are a number of headers security scanners expect.
Explicitly declare how strict browser should be with
responses.
2016-11-29 10:49:02 -05:00
Jarrod Johnson
107337fdba Merge branch 'master' of github.com:jjohnson42/confluent 2016-11-07 10:19:41 -05:00
Jarrod Johnson
eb02247a58 Fix consistency of sessionid
Regardless of whether the client uses it as a session id
or not, the fact remains a sessionid is assigned.
Pass the session id in the auth data even if the client
did not send it.
2016-11-07 10:18:32 -05:00
Jarrod Johnson
53904a2a5a Revert "Remove 'path' condition for session cookie"
This reverts commit 0ad4ae90c9a4071771bad58c199bfda54086b46d.
2016-11-01 13:45:33 -04:00
Jarrod Johnson
0ad4ae90c9 Remove 'path' condition for session cookie
The cookie had an unnecessary limitation.  path need not be specified,
and it is possible for a client to request in a way that fails the criteria.
2016-10-21 09:56:14 -04:00
Jarrod Johnson
9f0daf324e Refactor error code into exceptions
This makes the exceptions more self describing and simplifies httpapi and sockapi.
An important step to improve asynchttp conveyance of error data that would normally
be an http error in synchronous operation.
2016-09-23 16:32:53 -04:00
Jarrod Johnson
1286f8af3c Add facility for Anti-CSRF measures
Enable a WebUI to request an auth token.  This will allow it to indicate it is running in a browser and have the server implement protections such that
other software in the browser cannot send arbitrary requests into the server API.

This is implemented in a backward compatible fashion, allowing, for example, purely non-browser clients to ignore the CSRF protection as
it doesn't apply to that use case.
2016-09-22 11:09:05 -04:00
Jarrod Johnson
4d04c1fb18 Add break and reopen to http consoles
HTTP console API did not have a means to send break
or request session reopen.  Rectify this discrepency
by adding an 'action' key to request certain console
specific actions.  In retrospect, closing the session
should have just been an 'action', but leaving things
as-is.
2016-08-23 14:04:20 -04:00
Jarrod Johnson
22509946c0 Reduce verbosity of audit log
There are a number of pretty innocuous requests that
need not be individually tracked.  For such requests,
we'll abstain from putting it into the log.
2016-04-08 16:51:32 -04:00
Jarrod Johnson
50aefee728 Correct a number of issues
There were a number of careless mistakes in the feature, correct
the bad usage and typos.
2016-03-26 09:34:46 -04:00