Skip to content

Commit 4853721

Browse files
authored
Merge branch 'master' into fix/4676_inherit_env
2 parents 6e455fb + e9430eb commit 4853721

File tree

18 files changed

+100
-32
lines changed

18 files changed

+100
-32
lines changed

ADOPTERS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Who uses StackStorm?
2+
As the StackStorm Community evolves, we'd like to keep track of our users. Please submit a PR with your organization and a brief use case description below.
3+
14
This is an alphabetical list of known [StackStorm](https://stackstorm.com/) adopters:
25

36
<!-- Max 3 Github lines for each adopter! -->

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ in development
66

77
Fixed
88
~~~~~
9+
* Additional fixes for st2 client auth when proxy auth mode enabled #6049
10+
Contributed by @floatingstatic
11+
912
* Fix issue with linux pack actions failed to run remotely due to incorrect python shebang. #5983 #6042
1013
Contributed by Ronnie Hoffmann (@ZoeLeah Schwarz IT KG)
1114

@@ -24,6 +27,11 @@ Fixed
2427

2528
* Fix #4676, edge case where --inherit-env is skipped if the action has no parameters
2629

30+
* Update cryptography 3.4.7 -> 39.0.1, pyOpenSSL 21.0.0 -> 23.1.0, paramiko 2.10.5 -> 2.11.0 (security). #6055
31+
32+
* Bumped `eventlet` to `0.33.3` and `gunicorn` to `21.2.0` to fix `RecursionError` bug in setting `SSLContext` `minimum_version` property. #6061
33+
Contributed by @jk464
34+
2735
Added
2836
~~~~~
2937

contrib/runners/python_runner/python_runner/python_action_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
from __future__ import absolute_import
1717

18-
# Ignore CryptographyDeprecationWarning warnings which appear on older versions of Python 2.7
18+
# Ignore CryptographyDeprecationWarning warnings which appear on Python 3.6
19+
# TODO: Remove after dropping python3.6
1920
import warnings
20-
from cryptography.utils import CryptographyDeprecationWarning
2121

22-
warnings.filterwarnings("ignore", category=CryptographyDeprecationWarning)
22+
warnings.filterwarnings("ignore", message="Python 3.6 is no longer supported")
2323

2424
import os
2525
import sys

fixed-requirements.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ chardet<3.1.0
77
cffi<1.15.0
88
# NOTE: 2.0 version breaks pymongo work with hosts
99
dnspython>=1.16.0,<2.0.0
10-
cryptography==3.4.7
10+
cryptography==39.0.1
1111
# Note: 0.20.0 removed select.poll() on which some of our code and libraries we
1212
# depend on rely
13-
eventlet==0.30.2
13+
eventlet==0.33.3
1414
flex==6.14.1
1515
gitpython==3.1.15
1616
# Needed by gitpython, old versions used to bundle it
1717
gitdb==4.0.2
1818
# Note: greenlet is used by eventlet
1919
greenlet==1.0.0
20-
gunicorn==20.1.0
20+
gunicorn==21.2.0
2121
jsonpath-rw==1.4.0
2222
jsonschema==2.6.0
2323
kombu==5.0.2
@@ -36,15 +36,16 @@ decorator==4.4.2
3636
# See https://github.com/StackStorm/st2/issues/4160#issuecomment-394386433 for details
3737
oslo.config>=1.12.1,<1.13
3838
oslo.utils<5.0,>=4.0.0
39-
paramiko==2.10.5
39+
# paramiko 2.11.0 is needed by cryptography > 37.0.0
40+
paramiko==2.11.0
4041
passlib==1.7.4
4142
prompt-toolkit==1.0.15
4243
pyinotify==0.9.6 ; platform_system=="Linux"
4344
pymongo==3.11.3
4445
pyparsing<3
4546
zstandard==0.15.2
46-
# pyOpenSSL 22.0.0 requires cryptography>=35.0
47-
pyOpenSSL<=21.0.0
47+
# pyOpenSSL 23.1.0 supports cryptography up to 40.0.x
48+
pyOpenSSL==23.1.0
4849
python-editor==1.0.4
4950
python-keyczar==0.716
5051
pytz==2021.1

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ bcrypt==3.2.0
1414
cffi<1.15.0
1515
chardet<3.1.0
1616
ciso8601
17-
cryptography==3.4.7
17+
cryptography==39.0.1
1818
decorator==4.4.2
1919
dnspython>=1.16.0,<2.0.0
20-
eventlet==0.30.2
20+
eventlet==0.33.3
2121
flex==6.14.1
2222
gitdb==4.0.2
2323
gitpython==3.1.15
2424
greenlet==1.0.0
25-
gunicorn==20.1.0
25+
gunicorn==21.2.0
2626
importlib-metadata==3.10.1
2727
jinja2==2.11.3
2828
jsonpath-rw==1.4.0
@@ -40,12 +40,12 @@ orjson==3.5.2
4040
orquesta@ git+https://github.com/StackStorm/[email protected]
4141
oslo.config>=1.12.1,<1.13
4242
oslo.utils<5.0,>=4.0.0
43-
paramiko==2.10.5
43+
paramiko==2.11.0
4444
passlib==1.7.4
4545
prettytable==2.1.0
4646
prompt-toolkit==1.0.15
4747
psutil==5.8.0
48-
pyOpenSSL<=21.0.0
48+
pyOpenSSL==23.1.0
4949
pyinotify==0.9.6 ; platform_system=="Linux"
5050
pymongo==3.11.3
5151
pyparsing<3

st2actions/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
MarkupSafe<2.1.0,>=0.23
99
apscheduler==3.7.0
1010
chardet<3.1.0
11-
eventlet==0.30.2
11+
eventlet==0.33.3
1212
gitpython==3.1.15
1313
jinja2==2.11.3
1414
kombu==5.0.2

st2api/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# If you want to update depdencies for a single component, modify the
66
# in-requirements.txt for that component and then run 'make requirements' to
77
# update the component requirements.txt
8-
eventlet==0.30.2
9-
gunicorn==20.1.0
8+
eventlet==0.33.3
9+
gunicorn==21.2.0
1010
jsonschema==2.6.0
1111
kombu==5.0.2
1212
mongoengine==0.23.0

st2auth/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# in-requirements.txt for that component and then run 'make requirements' to
77
# update the component requirements.txt
88
bcrypt==3.2.0
9-
eventlet==0.30.2
10-
gunicorn==20.1.0
9+
eventlet==0.33.3
10+
gunicorn==21.2.0
1111
oslo.config>=1.12.1,<1.13
1212
passlib==1.7.4
1313
pymongo==3.11.3

st2auth/st2auth/handlers.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,25 @@ def handle_auth(
130130
remote_addr = headers.get("x-forwarded-for", remote_addr)
131131
extra = {"remote_addr": remote_addr}
132132

133+
# Needed to support st2client which does not connect via st2web
134+
if authorization and not remote_user:
135+
try:
136+
auth_value = base64.b64decode(authorization[1])
137+
except Exception:
138+
LOG.audit("Invalid authorization header", extra=extra)
139+
abort_request()
140+
return
141+
142+
split = auth_value.split(b":", 1)
143+
if len(split) != 2:
144+
LOG.audit("Invalid authorization header", extra=extra)
145+
abort_request()
146+
return
147+
148+
remote_user = split[0]
149+
if six.PY3 and isinstance(remote_user, six.binary_type):
150+
remote_user = remote_user.decode("utf-8")
151+
133152
if remote_user:
134153
ttl = getattr(request, "ttl", None)
135154
username = self._get_username_for_request(remote_user, request)

st2auth/tests/unit/test_handlers.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,31 @@ def test_proxy_handler(self):
4848
)
4949
self.assertEqual(token.user, "test_proxy_handler")
5050

51+
def test_proxy_handler_no_remote_user(self):
52+
h = handlers.ProxyAuthHandler()
53+
request = {}
54+
token = h.handle_auth(
55+
request,
56+
headers={},
57+
remote_addr=None,
58+
remote_user=None,
59+
authorization=("basic", DUMMY_CREDS),
60+
)
61+
self.assertEqual(token.user, "auser")
62+
63+
def test_proxy_handler_bad_auth(self):
64+
h = handlers.ProxyAuthHandler()
65+
request = {}
66+
67+
with self.assertRaises(exc.HTTPUnauthorized):
68+
h.handle_auth(
69+
request,
70+
headers={},
71+
remote_addr=None,
72+
remote_user=None,
73+
authorization=None,
74+
)
75+
5176
def test_standalone_bad_auth_type(self):
5277
h = handlers.StandaloneAuthHandler()
5378
request = {}

0 commit comments

Comments
 (0)