-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Ruff: add and fix T20 #10091
Ruff: add and fix T20 #10091
Conversation
Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.
Note 🟢 Risk threshold not exceeded. Change Summary (click to expand)The following is a summary of changes in this pull request made by me, your security buddy 🤖. Note that this summary is auto-generated and not meant to be a definitive list of security issues but rather a helpful summary from a security perspective. Summary: The code changes in this pull request cover a wide range of updates and improvements to the Defect Dojo application, with a focus on enhancing the security-related functionality and testing. The changes include improvements to logging, input validation, deduplication of findings, Jira integration, and various test suite enhancements. From an application security perspective, the key points to highlight are:
Overall, the changes in this pull request demonstrate a security-conscious approach to the development and maintenance of the Defect Dojo application. The focus on improving logging, input validation, and comprehensive testing is a positive step towards enhancing the application's security posture. Files Changed:
Powered by DryRun Security |
dfed3e6
to
3c0146f
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
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 one will need a little more TLC. Loggers cannot take more than one argument like print can:
>>> import logging
>>> logger = logging.getLogger(__name__)
>>> logger.error("one", "two", "three")
--- Logging error ---
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py", line 1160, in emit
msg = self.format(record)
^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py", line 999, in format
return fmt.format(record)
^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py", line 703, in format
record.message = record.getMessage()
^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/logging/__init__.py", line 392, in getMessage
msg = msg % self.args
~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
File "<stdin>", line 1, in <module>
Message: 'one'
Arguments: ('two', 'three')
Thanks @Maffooch for this. I can see it only in
I just fixed them. Have you found them somewhere else as well? |
There are a few that are commented out that would break if someone were to uncomment them. An example being Thought it may be more appropriate to just remove. What do you think? |
Agree. I will remove them |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
DryRun Security SummaryThe pull request includes a wide range of updates and improvements across various components of the DefectDojo application, focusing on enhancing security, logging, and testing capabilities, with the changes aiming to improve the overall security, reliability, and maintainability of the application. Expand for full summarySummary: The code changes in this pull request cover a wide range of updates and improvements across various components of the DefectDojo application, with a focus on enhancing the application's security, logging, and testing capabilities. The changes include improvements to the handling of Chrome dependencies in a Docker environment, the management of OpenAPI schema generation, the logging and error handling in various management commands, the integration with the Jira issue tracker, and the testing framework. These changes aim to improve the overall security, reliability, and maintainability of the application. While the changes do not introduce any obvious security vulnerabilities, it is important to review the broader context and implementation details to ensure that the application's security posture is not compromised. This includes reviewing the handling of user input, the implementation of access controls, the secure storage and transmission of sensitive data, and the overall security practices and testing procedures. Files Changed:
Code AnalysisWe ran
Riskiness🟢 Risk threshold not exceeded. |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
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.
A few minor comments
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Co-authored-by: Charles Neill <[email protected]> Co-authored-by: Cody Maffucci <[email protected]>
Conflicts have been resolved. A maintainer will review the pull request shortly. |
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.
Looks good!
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.
Approved
all
print
s replaced withlogger.info
orlogger.debug
https://docs.astral.sh/ruff/rules/#flake8-print-t20