Skip to content

feat(proofpoint-et-intelligence): migrate connector to manager-supported mode (#6768)#6784

Open
jabesq wants to merge 12 commits into
masterfrom
feat/6768-migrate-proofpoint-et-intelligence
Open

feat(proofpoint-et-intelligence): migrate connector to manager-supported mode (#6768)#6784
jabesq wants to merge 12 commits into
masterfrom
feat/6768-migrate-proofpoint-et-intelligence

Conversation

@jabesq

@jabesq jabesq commented Jun 19, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Migrate the proofpoint-et-intelligence connector to manager-supported mode using Pydantic settings and connectors-sdk, replacing the legacy get_config_variable / YAML config loading pattern
  • Add settings.py with typed Pydantic models (ConnectorSettings, ConnectorConfig) using SecretStr for the API key, Literal for TLP levels, and timedelta for the time window
  • Refactor the connector class to receive injected config and helper instead of instantiating them internally
  • Remove legacy config_variables.py and config_variables_models.py modules
  • Add unit tests for settings validation and connector initialization
  • Update docker-compose.yml, .env.sample, and config.yml.sample with correct defaults and environment variable mappings
  • Set manager_supported: true in the connector manifest (connector-manifest.json)
  • Generate connector_config_schema.json and CONNECTOR_CONFIG_DOC.md from the Pydantic settings
  • Add typing overloads to Utils.get_now for improved type safety
  • Fix converter_to_stix.py to use helper.connect_name instead of helper.connector.name
  • Add package information in pyproject.toml

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

This PR follows the standard manager-supported migration pattern: each commit corresponds to one discrete migration step (config files → Pydantic settings → package init → entry point → tests → manifest → refactor → cleanup). The connector now uses the connectors-sdk ConnectorSettings base class, which enables centralized configuration management through the OpenCTI manager. All configuration is validated at startup via Pydantic, with proper typing (SecretStr, Literal, timedelta) replacing stringly-typed config lookups. The net diff is roughly neutral in line count (467 insertions, 438 deletions), reflecting a like-for-like replacement of the legacy pattern with the modern SDK approach.

Copilot AI review requested due to automatic review settings June 19, 2026 13:46
@jabesq jabesq added the filigran team Item from the Filigran team. label Jun 19, 2026
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.74419% with 10 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...-enrichment/proofpoint-et-intelligence/src/main.py 0.00% 6 Missing ⚠️
...ofpoint-et-intelligence/src/connector/connector.py 66.66% 3 Missing ⚠️
...-intelligence/src/connector/services/client_api.py 66.66% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (879d6ea) and HEAD (0fbb886). Click for more details.

HEAD has 119 uploads less than BASE
Flag BASE (879d6ea) HEAD (0fbb886)
connectors 123 4
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #6784       +/-   ##
===========================================
- Coverage   33.27%    0.45%   -32.83%     
===========================================
  Files        1993     1900       -93     
  Lines      122690   120039     -2651     
===========================================
- Hits        40829      541    -40288     
- Misses      81861   119498    +37637     
Files with missing lines Coverage Δ
...oofpoint-et-intelligence/src/connector/__init__.py 100.00% <100.00%> (+100.00%) ⬆️
...t-et-intelligence/src/connector/models/__init__.py 100.00% <ø> (+100.00%) ⬆️
...et-intelligence/src/connector/services/__init__.py 100.00% <ø> (+100.00%) ⬆️
...igence/src/connector/services/converter_to_stix.py 55.88% <ø> (+55.88%) ⬆️
...nt-et-intelligence/src/connector/services/utils.py 43.90% <100.00%> (+43.90%) ⬆️
...oofpoint-et-intelligence/src/connector/settings.py 100.00% <100.00%> (ø)
...-intelligence/src/connector/services/client_api.py 41.30% <66.66%> (+41.30%) ⬆️
...ofpoint-et-intelligence/src/connector/connector.py 13.55% <66.66%> (+13.55%) ⬆️
...-enrichment/proofpoint-et-intelligence/src/main.py 0.00% <0.00%> (ø)

... and 1144 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

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.

Pull request overview

This PR migrates the internal-enrichment/proofpoint-et-intelligence connector to a manager-supported configuration model using connectors-sdk + Pydantic settings, replacing the legacy YAML / get_config_variable approach and updating the connector to accept injected config and helper.

Changes:

  • Introduce typed Pydantic settings (ConnectorSettings) and refactor connector entrypoint/constructor to use injected config + helper.
  • Remove legacy config loader modules and update the API client / converter to use the new settings and helper attributes.
  • Add unit tests validating settings parsing and connector/helper initialization; update metadata/config artifacts for manager support.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal-enrichment/proofpoint-et-intelligence/tests/test-requirements.txt Pin pytest version for consistent test runs.
internal-enrichment/proofpoint-et-intelligence/tests/test_settings.py Add settings validation tests using connectors-sdk error handling.
internal-enrichment/proofpoint-et-intelligence/tests/test_main.py Add initialization tests for settings, helper, and connector wiring.
internal-enrichment/proofpoint-et-intelligence/tests/conftest.py Ensure src/ is importable during tests.
internal-enrichment/proofpoint-et-intelligence/src/requirements.txt Add connectors-sdk dependency from the monorepo.
internal-enrichment/proofpoint-et-intelligence/src/main.py Update entrypoint to build settings + helper and inject into connector.
internal-enrichment/proofpoint-et-intelligence/src/connector/settings.py Add typed connector + connector-specific settings with Pydantic.
internal-enrichment/proofpoint-et-intelligence/src/connector/services/utils.py Add overloads/TypedDict for Utils.get_now type safety.
internal-enrichment/proofpoint-et-intelligence/src/connector/services/converter_to_stix.py Use helper.connect_name for author naming.
internal-enrichment/proofpoint-et-intelligence/src/connector/services/config_variables.py Remove legacy YAML/env config loader.
internal-enrichment/proofpoint-et-intelligence/src/connector/services/client_api.py Switch API client to typed settings and SecretStr handling.
internal-enrichment/proofpoint-et-intelligence/src/connector/services/init.py Remove legacy config export from services package.
internal-enrichment/proofpoint-et-intelligence/src/connector/models/config_variables_models.py Remove legacy config variable Pydantic model.
internal-enrichment/proofpoint-et-intelligence/src/connector/models/init.py Drop legacy config model export.
internal-enrichment/proofpoint-et-intelligence/src/connector/connector.py Refactor connector initialization + settings usage throughout processing.
internal-enrichment/proofpoint-et-intelligence/src/connector/init.py Export ConnectorSettings alongside the connector class.
internal-enrichment/proofpoint-et-intelligence/src/config.yml.sample Update sample YAML to match manager-supported settings.
internal-enrichment/proofpoint-et-intelligence/pyproject.toml Add minimal project metadata and pytest configuration.
internal-enrichment/proofpoint-et-intelligence/docker-compose.yml Update env var defaults/mappings for the new settings.
internal-enrichment/proofpoint-et-intelligence/.gitignore Ignore additional local tooling files (uv.lock, .python-version).
internal-enrichment/proofpoint-et-intelligence/.env.sample Add environment variable template for local configuration.
internal-enrichment/proofpoint-et-intelligence/metadata/connector_manifest.json Mark connector as manager_supported: true.
internal-enrichment/proofpoint-et-intelligence/metadata/connector_config_schema.json Add generated config schema from Pydantic settings.
internal-enrichment/proofpoint-et-intelligence/metadata/CONNECTOR_CONFIG_DOC.md Add generated human-readable config documentation.

Comment on lines +37 to 40
url = f"{self.config.api_base_url}{source_entity_type}/{entity_value}"
if target_entity_type:
url += f"/{target_entity_type}"
return url
Comment on lines +772 to 777
def process_message(self, data: dict) -> str | None:
"""The main process used by the connector to collect intelligence.

Returns:
str : messages
str: messages
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(Proofpoint): migrate connectors to the catalog

3 participants