migrate symantec_icdx#611
Conversation
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
Summary of ChangesHello, 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 introduces the Symantec Integrated Cyber Defense Exchange (ICDX) integration, enabling seamless interaction with Symantec's security event data. It provides actions for retrieving individual events and querying events within a time window, alongside a dedicated connector for automated event ingestion and case creation. The integration is set up with Python 3.11, ensuring compatibility and leveraging recent language features. 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. Changelog
Activity
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
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
There was a problem hiding this comment.
Code Review
This pull request aims to migrate the Symantec ICDX integration, updating it to use Python 3.11 and a newer SDK structure. However, a security audit identified two medium-severity issues in the core manager class: a significant logic bug in the pagination implementation that could lead to crashes and missed security alerts, and an insecure default for SSL verification, posing a Man-in-the-Middle risk. Additionally, the current implementation has several issues, including multiple style guide violations (e.g., lack of mandatory unit tests, missing JSON example files, missing type annotations), a critical runtime bug in SymantecICDXManager due to an incorrectly scoped function, and opportunities to remove legacy Python 2 code patterns.
| :return: {CaseInfo} The newly created case | ||
| """ | ||
| self.logger.info( | ||
| f"Creating Case for Alert {str(alert.get('message')).encode('utf-8')}, UUID: {str(alert.get('uuid')).encode('utf-8')}" |
There was a problem hiding this comment.
Calling .encode('utf-8') on a string within an f-string for logging is a pattern from Python 2 that is incorrect in Python 3. This will result in a bytestring representation (e.g., b'...') in your logs. Please remove the .encode('utf-8') calls to log the string values directly.
| f"Creating Case for Alert {str(alert.get('message')).encode('utf-8')}, UUID: {str(alert.get('uuid')).encode('utf-8')}" | |
| f"Creating Case for Alert {alert.get('message')}, UUID: {alert.get('uuid')}" |
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from integration_testing.default_tests.import_test import import_all_integration_modules | ||
|
|
||
| from .. import common | ||
|
|
||
|
|
||
| def test_imports() -> None: | ||
| import_all_integration_modules(common.INTEGRATION_PATH) |
There was a problem hiding this comment.
The style guide mandates that all new features and integrations must include corresponding unit tests. The current test suite only verifies that modules can be imported. This is insufficient for ensuring production stability. Please add comprehensive unit tests for the actions and manager logic, mocking any external network calls. Refer to the "Golden Tests" mentioned in the style guide for examples of expected test structure and coverage.
References
- All new features, bug fixes, or integrations added to
content/response_integrations/**must include corresponding unit tests to ensure production stability. (link)
| ) | ||
|
|
||
| if events: | ||
| siemplify.result.add_result_json(events) |
There was a problem hiding this comment.
According to the style guide, if an action returns a JSON result using add_result_json, a corresponding JSON example file must exist in the integration's resources/ directory. Please add a GetEventsMinutesBack_json_example.json file and update the result_example_path in GetEventsMinutesBack.yaml accordingly.
References
- If a JSON result is detected (e.g., via calls to
result.add_result_json(...)), a corresponding JSON example file must exist in the integration'sresources/directory. (link)
| event_data = icdx_manager.get_event(event_uuid) | ||
|
|
||
| if event_data: | ||
| siemplify.result.add_result_json(event_data) |
There was a problem hiding this comment.
According to the style guide, if an action returns a JSON result using add_result_json, a corresponding JSON example file must exist in the integration's resources/ directory. Please add a GetEvent_json_example.json file and update the result_example_path in GetEvent.yaml accordingly.
References
- If a JSON result is detected (e.g., via calls to
result.add_result_json(...)), a corresponding JSON example file must exist in the integration'sresources/directory. (link)
|
|
||
|
|
||
| @output_handler | ||
| def main(): |
There was a problem hiding this comment.
Per the style guide, all function parameters and return types must be annotated. Please add a return type hint to the main function.
| def main(): | |
| def main() -> None: |
References
- All function parameters and return types must be annotated. (link)
|
|
||
|
|
||
| @output_handler | ||
| def main(): |
There was a problem hiding this comment.
Per the style guide, all function parameters and return types must be annotated. Please add a return type hint to the main function.
| def main(): | |
| def main() -> None: |
References
- All function parameters and return types must be annotated. (link)
| for alert_id, timestamp in list(existing_ids.items()): | ||
| if ( | ||
| timestamp | ||
| > arrow.utcnow().shift(hours=-IDS_HOURS_LIMIT).timestamp |
There was a problem hiding this comment.
| filtered_alerts = [] | ||
|
|
||
| for alert in alerts: | ||
| if alert.get("uuid") not in list(existing_ids.keys()): |
There was a problem hiding this comment.
|
|
||
| # Read already existing alerts ids | ||
| existing_ids = symantec_icdx_connector.read_ids( | ||
| os.path.join(connector_scope.run_folder, IDS_FILE) |
There was a problem hiding this comment.
The style guide (line 37) explicitly forbids using os.path.join. Please refactor this and other file operations in this file to use pathlib as mandated by the style guide (line 35). For example, this line could be pathlib.Path(connector_scope.run_folder) / IDS_FILE after importing pathlib.
References
- Do not use raw string concatenation or
os.path.joinfor file system operations. Always usepathlib.Path. (link)
|
|
||
|
|
||
| class SymantecICDXManager: | ||
| def __init__(self, api_root, api_key, verify_ssl=False): |
There was a problem hiding this comment.
The __init__ method defaults verify_ssl to False, which is an insecure default. This makes the integration vulnerable to Man-in-the-Middle (MitM) attacks by not verifying SSL certificates. It is highly recommended to default verify_ssl to True for security. Additionally, per the style guide, all function parameters and return types must be annotated.
| def __init__(self, api_root, api_key, verify_ssl=False): | |
| def __init__(self, api_root: str, api_key: str, verify_ssl: bool = True) -> None: |
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
2 similar comments
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
316a12f to
239f69a
Compare
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
5 similar comments
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
f0102d7 to
239f69a
Compare
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
2 similar comments
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
9659013 to
29a8076
Compare
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
1 similar comment
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
eb901fd to
1470995
Compare
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
1 similar comment
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
1 similar comment
|
❌ Marketplace Validation Failed Click to view the full reportValidation Report🧩 IntegrationsPre-Build Stagesymantec_icdx
|
* migrate symantec_icdx * use develop version * update integration metadata --------- Co-authored-by: Tal Shafir <94114984+TalShafir1@users.noreply.github.com>
… Feature: Add Signal Sciences Response Integration (#619) * [Buganizer ID - 490287141] Added new integration Signal Sciences. * working with tests * added core to tests * updated tests * refactoring datamodels * datamodel refactoring for Signal Sciences * add docstring comments * RN update * widgets updated * update widgets * updated icon for widget * docs: Improve descriptions for Signal Sciences actions and integration parameters. * Updated publich_time to current * add btach1 to ruf axcluded (#646) * [b/495661530] Added parsers contribution guidelines (#645) * Added parsers documentation * Resolved comments * Updated Timestamp Logic in BaseSyncJob (#623) * Updated Timestamp Logic in BaseSyncJob * Updated Timestamp Logic in BaseSyncJob * pagination logic applied in get_email_template * fixed the linter issue --------- Co-authored-by: Arabindaksha-Mishra <arabindaksha@google.com> Co-authored-by: Himshikhar <himshikhar@google.com> Co-authored-by: KrishnaSharma06 <kantkrishna@google.com> * migrate symantec_icdx (#611) * migrate symantec_icdx * use develop version * update integration metadata --------- Co-authored-by: Tal Shafir <94114984+TalShafir1@users.noreply.github.com> * add ticket number to google integration's rn files (#647) * Updated tipcommon in pyproject.toml * removed README.md * updated uv.lock --------- Co-authored-by: haggit-eliyahu <101981405+haggit-eliyahu@users.noreply.github.com> Co-authored-by: prasoonbirla-google <prasoonbirla@google.com> Co-authored-by: Sahithya1357 <marthasahithya@google.com> Co-authored-by: Arabindaksha-Mishra <arabindaksha@google.com> Co-authored-by: Himshikhar <himshikhar@google.com> Co-authored-by: KrishnaSharma06 <kantkrishna@google.com> Co-authored-by: Tal Shafir <94114984+TalShafir1@users.noreply.github.com>
… Feature: Add Signal Sciences Response Integration (#619) * [Buganizer ID - 490287141] Added new integration Signal Sciences. * working with tests * added core to tests * updated tests * refactoring datamodels * datamodel refactoring for Signal Sciences * add docstring comments * RN update * widgets updated * update widgets * updated icon for widget * docs: Improve descriptions for Signal Sciences actions and integration parameters. * Updated publich_time to current * add btach1 to ruf axcluded (#646) * [b/495661530] Added parsers contribution guidelines (#645) * Added parsers documentation * Resolved comments * Updated Timestamp Logic in BaseSyncJob (#623) * Updated Timestamp Logic in BaseSyncJob * Updated Timestamp Logic in BaseSyncJob * pagination logic applied in get_email_template * fixed the linter issue --------- Co-authored-by: Arabindaksha-Mishra <arabindaksha@google.com> Co-authored-by: Himshikhar <himshikhar@google.com> Co-authored-by: KrishnaSharma06 <kantkrishna@google.com> * migrate symantec_icdx (#611) * migrate symantec_icdx * use develop version * update integration metadata --------- Co-authored-by: Tal Shafir <94114984+TalShafir1@users.noreply.github.com> * add ticket number to google integration's rn files (#647) * Updated tipcommon in pyproject.toml * removed README.md * updated uv.lock --------- Co-authored-by: haggit-eliyahu <101981405+haggit-eliyahu@users.noreply.github.com> Co-authored-by: prasoonbirla-google <prasoonbirla@google.com> Co-authored-by: Sahithya1357 <marthasahithya@google.com> Co-authored-by: Arabindaksha-Mishra <arabindaksha@google.com> Co-authored-by: Himshikhar <himshikhar@google.com> Co-authored-by: KrishnaSharma06 <kantkrishna@google.com> Co-authored-by: Tal Shafir <94114984+TalShafir1@users.noreply.github.com>
No description provided.