Skip to content

migrate fire_eye_ex#694

Open
haggit-eliyahu wants to merge 5 commits intomainfrom
migrate-fire_eye_ex
Open

migrate fire_eye_ex#694
haggit-eliyahu wants to merge 5 commits intomainfrom
migrate-fire_eye_ex

Conversation

@haggit-eliyahu
Copy link
Copy Markdown
Contributor

No description provided.

@haggit-eliyahu haggit-eliyahu requested a review from a team as a code owner April 20, 2026 07:16
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 migrates the FireEye EX integration to the latest repository structure. The changes include adding core manager logic, new actions for managing quarantined emails and alert artifacts, and a robust alerts connector. Additionally, it introduces predefined widgets to enhance the user experience when viewing action results and updates linting configurations to include the new integration.

Highlights

  • Integration Migration: Migrated the FireEye EX integration to the new structure, including updated configuration and action definitions.
  • New Functionality: Added support for downloading alert artifacts and quarantined emails, with configurable local download paths.
  • Connector Updates: Implemented the FireEye EX Alerts Connector with improved alert grouping and overflow detection.
  • Widget Enhancements: Added predefined widgets for improved visualization of action results.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python error: Failed to generate package metadata for tipcommon==1.0.12 @ path+../../../../../packages/tipcommon/whls/TIPCommon-1.0.12-py2.py3-none-any.whl Caused by: Failed to read from the distribution cache Caused by: failed to query metadata of file /home/runner/work/content-hub/packages/tipcommon/whls/TIPCommon-1.0.12-py2.py3-none-any.whl: No such file or directory (os error 2)
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

2 similar comments
@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python error: Failed to generate package metadata for tipcommon==1.0.12 @ path+../../../../../packages/tipcommon/whls/TIPCommon-1.0.12-py2.py3-none-any.whl Caused by: Failed to read from the distribution cache Caused by: failed to query metadata of file /home/runner/work/content-hub/packages/tipcommon/whls/TIPCommon-1.0.12-py2.py3-none-any.whl: No such file or directory (os error 2)
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python error: Failed to generate package metadata for tipcommon==1.0.12 @ path+../../../../../packages/tipcommon/whls/TIPCommon-1.0.12-py2.py3-none-any.whl Caused by: Failed to read from the distribution cache Caused by: failed to query metadata of file /home/runner/work/content-hub/packages/tipcommon/whls/TIPCommon-1.0.12-py2.py3-none-any.whl: No such file or directory (os error 2)
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a 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 the FireEye EX integration, including core management logic, connectors for alerts, and several actions such as listing, downloading, releasing, and deleting quarantined emails. The code changes include the necessary configuration files, metadata, and widget definitions. I have provided feedback regarding critical runtime errors, security best practices for logging, and adherence to the repository's style guide, specifically concerning path handling and import conventions.

siemplify.result.add_attachment(
f"Alert_Artifacts_{alert_uuid}.zip",
f"Alert_Artifacts_{alert_uuid}.zip",
base64.b64encode(zip_content.content.encode("utf-8")),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

zip_content.content is a bytes object and does not have an encode method. This will cause an AttributeError at runtime. It should be base64 encoded directly and then decoded to a string for the attachment.

Suggested change
base64.b64encode(zip_content.content.encode("utf-8")),
base64.b64encode(zip_content.content).decode("utf-8"),

f"{error_msg}: {error} {response.content}"
)

raise FireEyeEXManagerError(f"{error_msg}: {error} {response.content}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Avoid logging response.content directly as it may contain sensitive information or PII. The style guide prohibits logging raw response content to prevent accidental data exposure.

Suggested change
raise FireEyeEXManagerError(f"{error_msg}: {error} {response.content}")
raise FireEyeEXManagerError(f"{error_msg}: {error}")

from soar_sdk.ScriptResult import EXECUTION_STATE_COMPLETED, EXECUTION_STATE_FAILED
from TIPCommon import extract_configuration_param, extract_action_param
import base64
from urllib.parse import urljoin
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Import pathlib to handle file system operations as required by the style guide.

Suggested change
from urllib.parse import urljoin
import pathlib
from urllib.parse import urljoin
References
  1. Always use pathlib.Path for file system operations. (link)

siemplify,
provider_name=INTEGRATION_NAME,
param_name="Verify SSL",
default_value=False,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The default value for the "Verify SSL" parameter should be True to adhere to the repository style guide.

Suggested change
default_value=False,
default_value=True,
References
  1. All integrations must have a Verify SSL boolean parameter, default true. (link)

base64.b64encode(zip_content.content.encode("utf-8")),
)

absolute_path = urljoin(download_path, f"Alert_Artifacts_{alert_uuid}.zip")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

urljoin is intended for URL manipulation. For local filesystem paths, use pathlib.Path and the / operator as required by the style guide.

Suggested change
absolute_path = urljoin(download_path, f"Alert_Artifacts_{alert_uuid}.zip")
absolute_path = str(pathlib.Path(download_path) / f"Alert_Artifacts_{alert_uuid}.zip")
References
  1. Always use pathlib.Path for file system operations. Avoid String Concatenation. (link)

# ============================= IMPORTS ===================================== #
from __future__ import annotations
import requests
import os
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The os module is used for path handling. The style guide mandates the use of pathlib for all file system operations.

Suggested change
import os
import pathlib
References
  1. Always use pathlib.Path for file system operations. (link)

from ..core.FireEyeEXManager import FireEyeEXManager, FireEyeEXUnsuccessfulOperationError
from soar_sdk.SiemplifyAction import SiemplifyAction
from soar_sdk.ScriptResult import EXECUTION_STATE_COMPLETED, EXECUTION_STATE_FAILED
from TIPCommon import extract_configuration_param, extract_action_param
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

TIPCommon imports should use submodules (e.g., TIPCommon.extraction) instead of flat imports for integrations using TIPCommon 2.x+.

Suggested change
from TIPCommon import extract_configuration_param, extract_action_param
from TIPCommon.extraction import extract_configuration_param, extract_action_param
References
  1. TIPCommon imports should use submodules (for TIPCommon 2.x+). (link)

Comment on lines +351 to +355
with open(download_path, "wb") as f:
for chunk in response.iter_content():
f.write(chunk)
return True
return False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Use pathlib.Path for file system operations instead of os.path and built-in open. This is mandatory according to the repository style guide.

Suggested change
with open(download_path, "wb") as f:
for chunk in response.iter_content():
f.write(chunk)
return True
return False
path = pathlib.Path(download_path)
if not path.exists():
with path.open("wb") as f:
for chunk in response.iter_content():
f.write(chunk)
return True
References
  1. Always use pathlib.Path for file system operations. (link)

is_mandatory: true
integration_identifier: FireEyeEX
- name: Verify SSL
default_value: ''
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The "Verify SSL" parameter should have a default value of true in the integration definition to adhere to the repository style guide.

    default_value: 'true'
References
  1. All integrations must have a Verify SSL boolean parameter, default true. (link)

name = "FireEyeEX"
version = "14.0"
description = "FireEye Email Security detects and blocks every kind of unwanted email, especially targeted advanced attacks. Time and again, this solution has proven itself capable of detecting corporate email threats in traffic accepted as safe by other products"
requires-python = ">=3.11"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The requires-python field should specify a version range to ensure compatibility. The repository style guide recommends ">=3.11,<3.12".

Suggested change
requires-python = ">=3.11"
requires-python = ">=3.11,<3.12"
References
  1. The requires-python field should be ">=3.11,<3.12". (link)

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python Resolved 32 packages in 334ms The lockfile at uv.lock needs to be updated, but --check was provided. To update the lockfile, run uv lock.
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python Resolved 32 packages in 210ms The lockfile at uv.lock needs to be updated, but --check was provided. To update the lockfile, run uv lock.
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python Resolved 32 packages in 531ms The lockfile at uv.lock needs to be updated, but --check was provided. To update the lockfile, run uv lock.
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python Resolved 32 packages in 321ms The lockfile at uv.lock needs to be updated, but --check was provided. To update the lockfile, run uv lock.
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

fire_eye_ex

Validation Name Details
⚠️ Uv Lock Error happened while executing a command: uv lock --check: Using CPython 3.11.15 interpreter at: /opt/hostedtoolcache/Python/3.11.15/x64/bin/python Resolved 32 packages in 339ms The lockfile at uv.lock needs to be updated, but --check was provided. To update the lockfile, run uv lock.
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in FireEye EX must be a boolean true
⚠️ Connectors Documentation Link Validation Integration 'fire_eye_ex' contains connectors with missing documentation link: - FireEye EX - Alerts Connector
⚠️ JSON Result Example Validation Actions with JSON results missing example files in resources/: ListQuarantinedEmails, DownloadQuarantinedEmail, DownloadAlertArtifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants