Skip to content

migrate f5_big_iq#692

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

migrate f5_big_iq#692
haggit-eliyahu wants to merge 5 commits intomainfrom
migrate-f5_big_iq

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 19, 2026 16:17
@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 completes the migration of the F5 Big IQ integration into the current repository structure. The changes include setting up the necessary directory hierarchy, implementing core management logic, defining new actions for policy enforcement and log retrieval, and updating project-wide configuration files to ensure compatibility and consistency.

Highlights

  • Integration Migration: Migrated the F5 Big IQ integration to the new repository structure, including core logic, actions, and configuration files.
  • New Functionality: Added support for 'Change Policy Enforcement Mode' and 'Get Event Logs By Blocking ID' actions.
  • Configuration and Tooling: Updated project configuration files (pyproject.toml, ruff.toml) to support Python 3.11 and align with project standards.

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

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 implements the F5 Big IQ integration for Google SecOps, adding actions for policy enforcement and log retrieval. The review highlights critical bugs in the manager's authentication flow and the use of global state, which poses risks in concurrent environments. Additionally, the feedback identifies several style guide violations, including non-standard Ping action messages, missing type annotations, and incorrect configuration defaults. Actionable suggestions were provided to fix these issues and ensure the integration meets production-ready standards.

Comment on lines +45 to +54
f5_bigiq_manager = F5BigIQManager(host_address, username, password, verify_ssl)

if f5_bigiq_manager:
output_message = "Connection Established"
result_value = True
else:
output_message = "Connection Failed"
result_value = False

siemplify.end(output_message, result_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.

high

The connectivity check logic is flawed. The F5BigIQManager constructor calls self.login(), which raises an exception if authentication fails. Consequently, the else block is unreachable, and the action will fail with an unhandled exception instead of returning a proper failure message. Additionally, the success and failure messages must follow the exact format required by the style guide.

Suggested change
f5_bigiq_manager = F5BigIQManager(host_address, username, password, verify_ssl)
if f5_bigiq_manager:
output_message = "Connection Established"
result_value = True
else:
output_message = "Connection Failed"
result_value = False
siemplify.end(output_message, result_value)
try:
f5_bigiq_manager = F5BigIQManager(host_address, username, password, verify_ssl)
output_message = "Successfully connected to the F5 Big IQ server with the provided connection parameters!"
result_value = True
except Exception as e:
output_message = f"Failed to connect to the F5 Big IQ server! Error is {e}"
result_value = False
siemplify.end(output_message, result_value)
References
  1. Every integration must have a Ping action with exact output messages for success and failure. (link)

Comment on lines +33 to +57
GET_EVENTS_PAYLOAD = {
"query": {"query_string": {"query": "support_id: {0}"}},
"from": 0,
"size": 1,
"sort": {"date_time": "desc"},
}

CHANGE_POLICY_ENFORCEMENT_MODE_PAYLOAD = {"enforcementMode": "(0)"}

# =====================================
# CONSTS #
# =====================================
# Formats
QUERY_FORMAT = "support_id: {0}"

# Headers
GET_EVENT_URL = "mgmt/cm/shared/es/logiq/asmindex/_search"
CHANGE_POLICY_ENFORCEMENT_MODE_URL = (
"/mgmt/cm/asm/working-config/policies/{0}" # {0} - Policy ID
)
# Login URL.
OBTAIN_TOKEN_URL = "/mgmt/shared/authn/login"

# Header
HEADERS = {"Content-Type": "application/json"}
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.

high

The use of global dictionaries (GET_EVENTS_PAYLOAD, CHANGE_POLICY_ENFORCEMENT_MODE_PAYLOAD, HEADERS) to store request state is problematic. These dictionaries are modified within instance methods (e.g., login, get_event_logs_by_blocking_id), which can lead to race conditions and data corruption if multiple instances of the manager are used or if the code is executed in a concurrent environment. These should be defined as instance attributes or local variables within the methods.

Comment on lines +93 to +97
requests.patch(
urllib.parse.urljoin(self.host, f"mgmt/shared/authz/tokens/{self.token}"),
json={"timeout": 4200},
verify=self.verify,
)
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.

high

The login method attempts to extend the token lifetime using self.token before it has been assigned the value from the current login response. Since self.token is initialized to an empty string, this request will target an incorrect endpoint (mgmt/shared/authz/tokens/). The token should be extracted from the response before attempting to extend it.


# consts
F5_BIG_IQ_PROVIDER = "F5BigIQ"
SCRIPT_NAME = "Get Event Logs By Blocking ID"
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 SCRIPT_NAME constant is incorrect for the Ping action. It appears to have been copied from the GetEventLogsByBlockingID action.

Suggested change
SCRIPT_NAME = "Get Event Logs By Blocking ID"
SCRIPT_NAME = "Ping"

verify_ssl = extract_configuration_param(
siemplify,
provider_name=F5_BIG_IQ_PROVIDER,
param_name="Verify SSL",
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 according to the repository style guide.

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

# =====================================
# CLASSES #
# =====================================
class F5BigIQManager:
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 F5BigIQManager class and its methods are missing type annotations and Google-style docstrings, which are required by the repository style guide.

References
  1. All function parameters and return types must be annotated. Use Google Style Docstrings for all modules, classes, and functions. (link)

name = "F5BigIQ"
version = "8.0"
description = " BIG-IQ centralizes management, licensing, monitoring, and analytics for your dispersed BIG-IP infrastructure."
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 an upper bound for the Python version to ensure compatibility.

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

is_mandatory: true
integration_identifier: F5BigIQ
- 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 according to the repository style guide.

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

event_logs = f5_bigiq_manager.get_event_logs_by_blocking_id(block_id)

if event_logs:
siemplify.result.add_json(f"Event Logs For: {block_id}", json.dumps(event_logs))
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

A JSON result is being reported, but the corresponding example file resources/GetEventLogsByBlockingID_JsonResult_example.json is missing from the resources/ directory.

References
  1. If a JSON result is detected, a corresponding JSON example file must exist in the integration's resources/ directory, named action_name_JsonResult_example.json. (link)

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

f5_big_iq

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ Ping Message Format Validation f5_big_iq: Ping success message must contain: 'Successfully connected to the'; Ping failure message must contain: 'Failed to connect to the'
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in F5 Big IQ must be a boolean true

1 similar comment
@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

f5_big_iq

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ Ping Message Format Validation f5_big_iq: Ping success message must contain: 'Successfully connected to the'; Ping failure message must contain: 'Failed to connect to the'
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in F5 Big IQ must be a boolean true

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

f5_big_iq

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ Ping Message Format Validation f5_big_iq: Ping success message must contain: 'Successfully connected to the'; Ping failure message must contain: 'Failed to connect to the'
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in F5 Big IQ must be a boolean true

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

f5_big_iq

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ Ping Message Format Validation f5_big_iq: Ping success message must contain: 'Successfully connected to the'; Ping failure message must contain: 'Failed to connect to the'
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in F5 Big IQ must be a boolean true

1 similar comment
@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

f5_big_iq

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ Ping Message Format Validation f5_big_iq: Ping success message must contain: 'Successfully connected to the'; Ping failure message must contain: 'Failed to connect to the'
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in F5 Big IQ must be a boolean true

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

f5_big_iq

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ Ping Message Format Validation f5_big_iq: Ping success message must contain: 'Successfully connected to the'; Ping failure message must contain: 'Failed to connect to the'
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in F5 Big IQ must be a boolean true

@github-actions
Copy link
Copy Markdown

Marketplace Validation Failed

Click to view the full report

Validation Report

🧩 Integrations
Pre-Build Stage

f5_big_iq

Validation Name Details
⚠️ Integration Version Bump New integration project.toml and release_note.yaml version must be initialize to 1.0
⚠️ Ping Message Format Validation f5_big_iq: Ping success message must contain: 'Successfully connected to the'; Ping failure message must contain: 'Failed to connect to the'
⚠️ SSL Integration Validation The default value of the 'Verify SSL' param in F5 Big IQ must be a boolean true

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