-
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
feat(GTI): Private URL scanning #117
base: master
Are you sure you want to change the base?
Conversation
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.
Hi @pablobpezj and reviewers,
I'm currently reviewing this pull request and will provide my feedback in a few minutes. In the meantime, I'm giving you a summary of the pull request's content to help you and other reviewers quickly understand the changes and intent.
This pull request, titled "feat(GTI): Private URL scanning", aims to add functionality for scanning private URLs using the Google Threat Intelligence (GTI) integration. The changes include:
- Addition of
private_url
method: A new methodprivate_url
has been added to theGoogleThreatIntelligence.py
file (lines 173-182) to handle requests for private URL analysis reports. This method uses the_http_request
method with a specific endpoint for private URLs. - Modification of debug logging: The debug logging in
private_file_scan
(lines 362-367) has been updated to reflect that it's now handling private file scans (lines 375-378). - Addition of
private_url_scan
method: A new methodprivate_url_scan
has been added (lines 412-421) to initiate private URL scans via a POST request to the appropriate GTI endpoint. - New output function: A new function
build_private_url_output
(lines 1435-1463) has been added to format the output for private URL scans. - Improved debug messages: The debug messages in
private_file_command
(lines 1784-1787) have been updated for clarity (lines 1837-1840). - Added
private_url_command
function: A new functionprivate_url_command
(lines 1885-1915) has been added to handle the new private URL commands. - Added
private_url_scan_and_get_analysis
function: A new functionprivate_url_scan_and_get_analysis
(lines 2212-2256) has been added to handle scheduled private URL scans and analysis retrieval. - Added
private_scan_url_command
function: A new functionprivate_scan_url_command
(lines 2286-2290) has been added to handle private URL scans. - Updated
scan_url
function: Thescan_url
function (lines 2293-2310) has been updated to support both private and public URL scans. - Updated
main
function: Themain
function (lines 2794-2809) has been updated to include the new private URL commands (lines 2945-2966).
The changes appear to be well-structured and address the stated goal. However, I'll need to verify the functionality and test coverage during my full review.
Here's a little something to lighten the mood:
Code flows like a stream,
Tests catch bugs, a gentle hand,
Clean code, pure delight.
Looking forward to completing the review 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 pull request introduces private URL scanning functionality, which is a valuable addition. The implementation looks generally good, but there are a few minor points to address regarding consistency and documentation.
I've referenced elements from the Google Python Style Guide in this review, specifically around docstrings and naming conventions.
@@ -2794,6 +2945,10 @@ def main(params: dict, args: dict, command: str): | |||
results = private_file_command(client, args) | |||
elif command == f'{COMMAND_PREFIX}-privatescanning-file-scan': | |||
results = private_file_scan(client, args) |
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.
We should rename this to private_scan_file_command
to keep consistency.
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.
Yes but URL scan command is called scan_url_command
while file scan command is called file_scan
. We should rename this command too.
'url', | ||
'title', | ||
'last_http_response_content_sha256', | ||
'positives', |
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.
Let's call this detection_ratio
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.
We are calling this attribute positives
in all commands (it appears in all build_<ioc>_output
methods).
Contributing to Cortex XSOAR Content
Make sure to register your contribution by filling the contribution registration form
The Pull Request will be reviewed only after the contribution registration form is filled.
Status
Related Issues
fixes: link to the issue
Description
A few sentences describing the overall goals of the pull request's commits.
Must have