-
Notifications
You must be signed in to change notification settings - Fork 44
The initial upload of the Silent Push Google Sec Ops integration. #433
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: cdunningsp <[email protected]>
…irectory Removing the unzipped files. Signed-off-by: cdunningsp <[email protected]>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @cdunningsp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes the foundational integration between Silent Push and Google Sec Ops. It provides a comprehensive toolkit for security analysts to leverage Silent Push's threat intelligence capabilities directly within their security workflows, facilitating proactive threat hunting, incident response, and asset management through a rich set of API-driven actions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a new integration for Silent Push. The initial implementation adds a comprehensive set of actions. However, there are several critical issues and style guide violations that need to be addressed before this can be merged.
Key issues include:
- Missing Unit Tests: The repository style guide mandates unit tests for all new integrations in this directory, but none are provided. This is a critical requirement for production stability.
- Missing JSON Example Files: Several actions generate JSON results but are missing the corresponding
_json_example.jsonfiles in aresourcesdirectory, as required by the style guide. - Critical Runtime Errors: Multiple action scripts contain
NameErrorbugs in exception handlers from using undefined variables. There are also calls to methods that don't exist (e.g.,client.validate_ip_address) and use of functions from other SOAR frameworks (demisto.error). - Code Duplication: Python code is duplicated across
.actiondeffiles and standalone.pyscripts inActionsScripts/. This will make future maintenance difficult. - Style Guide Violations: There is a widespread lack of required type hints and Google-style docstrings.
- Debugging Artifacts: Leftover
print()statements and unused code blocks are present throughout the action scripts.
Please address these foundational issues to ensure the integration is secure, reliable, and maintainable.
|
|
||
| try: | ||
| sp_manager = SilentPushManager(server_url, api_key, logger=siemplify.LOGGER) | ||
| ipv4_addresses, ipv6_addresses = validate_ips(ips, sp_manager) |
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.
| except Exception as error: | ||
| result_value = False | ||
| status = EXECUTION_STATE_FAILED | ||
| output_message = f"Failed to retrieve data found for ASN {asn} for {INTEGRATION_NAME} server! Error: {error}" |
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.
The variable asn is not defined in this scope, which will cause a NameError if this exception block is executed. You may have intended to use a different variable like feed_uuid in the error message.
| output_message = f"Failed to retrieve data found for ASN {asn} for {INTEGRATION_NAME} server! Error: {error}" | |
| output_message = f"Failed to add tags to feed {feed_uuid} for {INTEGRATION_NAME} server! Error: {error}" |
| except Exception as error: | ||
| result_value = False | ||
| status = EXECUTION_STATE_FAILED | ||
| output_message = f"Failed to retrieve data found for ASN {asn} for {INTEGRATION_NAME} server! Error: {error}" |
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.
The variable asn is not defined in this scope, which will cause a NameError if this exception block is executed. You may have intended to use a different variable like feed_uuid or indicator_name in the error message.
| output_message = f"Failed to retrieve data found for ASN {asn} for {INTEGRATION_NAME} server! Error: {error}" | |
| output_message = f"Failed to add tags to indicator {indicator_name} in feed {feed_uuid} for {INTEGRATION_NAME} server! Error: {error}" |
| except Exception as error: | ||
| result_value = False | ||
| status = EXECUTION_STATE_FAILED | ||
| output_message = f"Failed to retrieve data found for ASN {asn} for {INTEGRATION_NAME} server! Error: {error}" |
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.
The variable asn is not defined in this scope, which will cause a NameError if this exception block is executed. You may have intended to use a different variable like feed_uuid in the error message.
| output_message = f"Failed to retrieve data found for ASN {asn} for {INTEGRATION_NAME} server! Error: {error}" | |
| output_message = f"Failed to add indicators to feed {feed_uuid} for {INTEGRATION_NAME} server! Error: {error}" |
| except Exception as error: | ||
| result_value = False | ||
| status = EXECUTION_STATE_FAILED | ||
| output_message = f"Failed to retrieve reputation data found for IPv4: {ipv4} for {INTEGRATION_NAME} server! Error: {error}" |
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.
The variable ipv4 is not defined in this scope. It seems you intended to use the nameserver variable, which holds the IP address for this action.
| output_message = f"Failed to retrieve reputation data found for IPv4: {ipv4} for {INTEGRATION_NAME} server! Error: {error}" | |
| output_message = f"Failed to retrieve reputation data found for IPv4: {nameserver} for {INTEGRATION_NAME} server! Error: {error}" |
| if explain == "false": | ||
| explaination:bool = False | ||
| else: | ||
| explaination:bool = True |
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.
| except Exception as error: | ||
| result_value = False | ||
| status = EXECUTION_STATE_FAILED | ||
| output_message = f"Failed to add feeds for {INTEGRATION_NAME} server! Error: {error}" |
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.
The error message here seems to be copied from another action and is not relevant to exporting data. It should be updated to reflect the current action's context.
| output_message = f"Failed to add feeds for {INTEGRATION_NAME} server! Error: {error}" | |
| output_message = f"Failed to get data export for {INTEGRATION_NAME} server! Error: {error}" |
| sp_manager = SilentPushManager(server_url, api_key, logger=siemplify.LOGGER) | ||
| raw_response = sp_manager.get_asn_takedown_reputation(asn, explaination, limit) | ||
| takedown_history = raw_response.get("takedown_reputation") | ||
| print(raw_response) |
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.
| if explain == "false": | ||
| explaination:int = 0 | ||
| else: | ||
| explaination:int = 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.
| "Date": entry.get("date"), | ||
| } | ||
| if explain and entry.get("asn_reputation_explain") : | ||
| print("On line 73", explain) |
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.
Initial upload of the Silent Push Google Sec Ops integration.