-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hardening suggestions for python-security / safe_urlopen #21
Conversation
@@ -58,7 +58,7 @@ def get( | |||
**kwargs, | |||
): | |||
UrlParser(url).check(allowed_protocols, host_validator) | |||
return unsafe_get(url, params=params, **kwargs) | |||
return unsafe_get(url, params=params, **kwargs, timeout=60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add timeout to requests
call
@@ -70,4 +70,4 @@ def post( | |||
**kwargs, | |||
): | |||
UrlParser(url).check(allowed_protocols, host_validator) | |||
return unsafe_post(url, data=data, json=json, **kwargs) | |||
return unsafe_post(url, data=data, json=json, **kwargs, timeout=60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add timeout to requests
call
@@ -58,7 +58,7 @@ def get( | |||
**kwargs, | |||
): | |||
UrlParser(url).check(allowed_protocols, host_validator) | |||
return unsafe_get(url, params=params, **kwargs) | |||
return unsafe_get(url, params=params, **kwargs, timeout=60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch use of requests for security.safe_requests
@@ -13,6 +13,7 @@ description = "The security toolkit for the Python community" | |||
keywords = ["security", "appsec"] | |||
dependencies = [ | |||
"requests", | |||
"security==1.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This library holds security tools for protecting Python API calls.
License: MIT ✅ Open Source ✅ More facts
Quality Gate passedIssues Measures |
I've reviewed the recently opened PR (20 - Fix tests and add lint and test workflows) and have identified some area(s) that could benefit from additional hardening measures.
These changes should help prevent potential security vulnerabilities and improve overall code quality.
Thank you for your consideration!
docs | feedback
Powered by: pixeebot