Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement All Integration Management Functions - Pt 1: Integration functions & Helpers
Summary
Part of a larger PR to implement all SOAR integration management capabilities to the SecOps SDK. This PR includes:
New SDK Modules (
src/secops/chronicle/integration/)integrations.pyintegration_instances.pymarketplace_integrations.pyNew Utility Helpers (
src/secops/chronicle/utils/)New helpers added for consistency and deduplication:
format_utils.pyformat_resource_id()— Extracts the final ID segment from a full Chronicle resource path (e.g.projects/.../instances/.../abc123→abc123). Safely passes through plain IDs.parse_json_list()— Accepts either alist[dict]or a JSON string and returns a parsed list. Used for parameter inputs (e.g.--parameters '[{"name":"p1"}]').build_patch_body()— Builds a PATCH request body andupdateMaskquery param from a list of(api_key, mask_key, value)tuples. Auto-generates the update mask from non-None fields, or accepts an explicit override.request_utils.pychronicle_request_bytes()— New helper for endpoints that return raw bytes (used bydownload_integrationanddownload_integration_dependency).New Data Models (
src/secops/chronicle/models.py)Enums:
PythonVersion—V2_7,V3_7,V3_11DiffType—COMMERCIAL,PRODUCTION,STAGINGTargetMode—PRODUCTION,STAGINGIntegrationType—RESPONSE,EXTENSIONIntegrationParamType—BOOLEAN,INT,STRING,PASSWORD,IP,URL,DOMAIN,EMAIL,VALUES_LIST, etc.ActionParamType—STRING,BOOLEAN,WFS_REPOSITORY,USER_REPOSITORY,STAGES_REPOSITORYActionType—PING,CONNECTOR,JOB, etc.ParamType— For connector parametersConnectorParamMode—REQUIRED,OPTIONAL, etc.ConnectorRuleType— Rule types for connector definitionsScheduleType—ONE_TIME,DAILY,WEEKLY,MONTHLY,ADVANCEDDayOfWeek—MONDAYthroughSUNDAYIntegrationParameterType— For integration instance parametersConnectorConnectivityStatus—CONNECTED,DISCONNECTED, etc.TransformerType— Transformer definition typesLogicalOperatorType— Logical operator definition typesDataclasses:
IntegrationParam— Integration-level parameter definitionActionParameter— Action parameter with type and validationConnectorParameter— Connector parameter with mode and rulesConnectorRule— Connector rule definitionIntegrationJobInstanceParameter— Job instance parameterDate,TimeOfDay— Date/time components for schedulingOneTimeScheduleDetails,DailyScheduleDetails,WeeklyScheduleDetails,MonthlyScheduleDetails— Schedule configurationAdvancedConfig— Advanced scheduling (cron-like)JobParameter— Job definition parameterIntegrationInstanceParameter— Integration instance parameterConnectorInstanceParameter— Connector instance parameterTransformerDefinitionParameter— Transformer parameterIntegrationLogicalOperatorParameter— Logical operator parameterCLI Commands (
src/secops/cli/commands/integration/)Added a complete
secops integrationCLI command tree with 21 subcommand modules, all registered viaintegration_client.py:secops integration integrationslist,get,create,delete,download,download-dependency,export-items,get-affected-items,get-agent,get-diff,get-dependencies,get-restricted-agents,transition,update,update-customsecops integration instanceslist,get,create,update,delete,test,get-affected-items,get-defaultsecops integration marketplacelist,get,diff,install,uninstallTests
Unit Tests - SDK Modules (
tests/chronicle/integration/)test_integrations.pytest_integration_instances.pytest_marketplace_integrations.pyUnit Tests - Utility Helpers (
tests/chronicle/utils/)test_format_utils.py-Tests forformat_resource_id,parse_json_list,build_patch_bodytest_request_utils.py- Tests forchronicle_request_bytesand updated request helpersDocumentation Updates
README.mdSDK usage examples for every new module, following the established format:
CLI.mdCLI usage documentation with bash examples for all integration subcommands, including workflow examples for revision-based safe updates.
api_module_mapping.mdChronicleClientUpdatesclient.py- All new integration module functions added asChronicleClientmethods with full docstrings__init__.py- All new functions exported in__all__and publicly importable fromsecops.chronicleAPI Version Support
All integration modules support both v1beta (default) and v1alpha via the
api_versionparameter