-
Notifications
You must be signed in to change notification settings - Fork 10
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 codemodder-python / pydantic-codetf #358
Conversation
@@ -7,5 +7,5 @@ | |||
@pytest.fixture(scope="module") | |||
def codetf_schema(): | |||
schema_path = "https://raw.githubusercontent.com/pixee/codemodder-specs/main/codetf.schema.json" | |||
response = requests.get(schema_path) | |||
response = requests.get(schema_path, 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
@@ -176,8 +177,7 @@ def test_file_rewritten(self, codetf_schema): | |||
self.check_code_before() | |||
self.check_dependencies_before() | |||
|
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.
Replaces subprocess.{func} with more secure safe_command library functions.
@@ -191,8 +191,7 @@ def test_file_rewritten(self, codetf_schema): | |||
|
|||
def _run_idempotency_chec(self, command): | |||
# idempotency test, run it again and assert no files changed | |||
completed_process = subprocess.run( | |||
command, | |||
completed_process = safe_command.run(subprocess.run, command, |
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.
Replaces subprocess.{func} with more secure safe_command library functions.
pyproject.toml
Outdated
@@ -24,6 +24,7 @@ dependencies = [ | |||
"tomlkit~=0.12.0", | |||
"wrapt~=1.16.0", | |||
"chardet~=5.2.0", | |||
"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
8c67680
to
1c925ae
Compare
7d0bad7
to
8d8e8ee
Compare
Quality Gate passedIssues Measures |
I've reviewed the recently opened PR (357 - Use Pydantic to generate and validate CodeTF data models) 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