Skip to content

feat(modat-enrichment): add Modat internal enrichment connector (#6829)#6830

Open
RT-MDT wants to merge 1 commit into
OpenCTI-Platform:masterfrom
modat-io:feat/modat-enrichment
Open

feat(modat-enrichment): add Modat internal enrichment connector (#6829)#6830
RT-MDT wants to merge 1 commit into
OpenCTI-Platform:masterfrom
modat-io:feat/modat-enrichment

Conversation

@RT-MDT

@RT-MDT RT-MDT commented Jun 29, 2026

Copy link
Copy Markdown

Internal-enrichment connector for the Modat Magnify host API (GET /host/{ip}/v1). Enriches IPv4-Addr observables with ASN, organization, geolocation, resolving domains, X.509 certificates, optional CVEs, and a summary note. Parses the API response into a typed pydantic model; includes unit tests and a STIX output reference.

Proposed changes

  • New internal-enrichment connector for IPv4-Addr (one GET /host/{ip}/v1 call per observable).
  • Creates ASN, organization, locations, domains, X.509 certificates, optional CVEs, and a summary note.

Related issues

Checklist

  • I tested the code for its functionality using different use cases
  • I added the relevant documentation

Copilot AI review requested due to automatic review settings June 29, 2026 14:14
@filigran-cla-bot filigran-cla-bot Bot added the cla:pending CLA signature required. label Jun 29, 2026
@filigran-cla-bot

filigran-cla-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

Contributor License Agreement

CLA signed 💚

Thank you @RT-MDT for signing the Contributor License Agreement! Your pull request can now be reviewed and merged.

We appreciate your contribution to Filigran's open source projects! ❤️

This is an automated message from the Filigran CLA Bot.

@Filigran-Automation Filigran-Automation changed the title feat(modat-enrichment): add Modat internal enrichment connector feat(modat-enrichment): add Modat internal enrichment connector (#6829) Jun 29, 2026
@Filigran-Automation Filigran-Automation added the community Contribution from the community. label Jun 29, 2026

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

Adds a new Modat Magnify internal-enrichment connector to the OpenCTI connectors monorepo, focused on enriching IPv4-Addr observables via GET /host/{ip}/v1 and emitting both structured STIX objects and an optional human-readable summary Note.

Changes:

  • Implements a Modat API client with IPv4-only validation and a lenient Pydantic model for parsing host-detail payloads.
  • Generates STIX objects (ASN/org, locations, domains, certificates, optional vulnerabilities) plus a stable, idempotent summary Note per observable.
  • Adds unit/integration-style tests covering config validation, model coercion/leniency, summary rendering, and end-to-end process_message() bundle creation.

Reviewed changes

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

Show a summary per file
File Description
internal-enrichment/modat-enrichment/src/modat_client/api_client.py Modat HTTP client with IPv4 validation and per-request Authorization header.
internal-enrichment/modat-enrichment/src/modat_client/models.py Lenient Pydantic models for parsing partial/messy Modat host responses.
internal-enrichment/modat-enrichment/src/modat_client/init.py Exposes ModatClient and ModatHost as package API.
internal-enrichment/modat-enrichment/src/connector/settings.py Connector configuration models (OpenCTI + Modat settings).
internal-enrichment/modat-enrichment/src/connector/utils.py Summary rendering + helper parsers/validators (TLS, DNs, domains, banners).
internal-enrichment/modat-enrichment/src/connector/converter_to_stix.py Translates parsed Modat host data into STIX objects + relationships.
internal-enrichment/modat-enrichment/src/connector/connector.py Main enrichment workflow: TLP gating, API query, parsing, STIX emission, idempotent Note.
internal-enrichment/modat-enrichment/src/connector/init.py Connector package exports with lazy import for ModatConnector.
internal-enrichment/modat-enrichment/src/main.py Entrypoint wiring settings → helper → connector run.
internal-enrichment/modat-enrichment/src/requirements.txt Runtime dependencies (pycti, pydantic, requests, connectors-sdk).
internal-enrichment/modat-enrichment/tests/conftest.py Test path setup for importing connector sources.
internal-enrichment/modat-enrichment/tests/test_main.py End-to-end tests for process_message() + ModatClient validation/SSRF defense.
internal-enrichment/modat-enrichment/tests/test-requirements.txt Test dependencies (pytest + runtime requirements include).
internal-enrichment/modat-enrichment/tests/tests_connector/test_settings.py Settings validation tests (valid + invalid cases).
internal-enrichment/modat-enrichment/tests/tests_connector/test_models.py Tests ensuring model leniency/coercion and “never raise” behavior.
internal-enrichment/modat-enrichment/tests/tests_connector/test_summary.py Tests for summary note rendering across service types and caps.
internal-enrichment/modat-enrichment/README.md Connector documentation (config, deployment, behavior, STIX output overview).
internal-enrichment/modat-enrichment/docs/STIX.md Detailed STIX output documentation and bundle inspection guidance.
internal-enrichment/modat-enrichment/Dockerfile Alpine-based container build for the connector.
internal-enrichment/modat-enrichment/entrypoint.sh Container entrypoint to run the connector.
internal-enrichment/modat-enrichment/docker-compose.yml Example compose service definition and env vars.
internal-enrichment/modat-enrichment/config.yml.sample Sample config.yml for manual deployments.
internal-enrichment/modat-enrichment/.dockerignore Docker ignore rules for metadata, caches, configs.
internal-enrichment/modat-enrichment/metadata/connector_manifest.json Connector manifest metadata for OpenCTI ecosystem integration.

Comment on lines +274 to +281
stix_domain = stix2.DomainName(
value=domain["value"],
custom_properties={
"x_opencti_created_by_ref": self.author["id"],
"x_opencti_score": self.default_score,
"x_opencti_labels": ["modat", "modat-enriched"],
},
)
Comment on lines +343 to +354
stix_domain = stix2.DomainName(
value=san_domain,
custom_properties={
"x_opencti_created_by_ref": self.author["id"],
"x_opencti_score": self.default_score,
"x_opencti_labels": [
"modat",
"modat-enriched",
"certificate-san",
],
},
)
Comment on lines +270 to +272
## Recommended Next Step

Add an end-to-end test for `process_message()` driven by saved `GET /host/{ip}/v1` JSON fixtures. A captured-bundle assertion turns this document from "derived from code" into "derived from tested output".
@@ -0,0 +1,3 @@
# Main dependencies needs to be installed
@filigran-cla-bot filigran-cla-bot Bot removed the cla:pending CLA signature required. label Jul 6, 2026
Internal-enrichment connector for the Modat Magnify host API (GET /host/{ip}/v1). Enriches IPv4-Addr observables with ASN, organization, geolocation, resolving domains, X.509 certificates, optional CVEs, and a summary note. Parses the API response into a typed pydantic model; includes unit tests and a STIX output reference.

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

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

Comment on lines +274 to +281
stix_domain = stix2.DomainName(
value=domain["value"],
custom_properties={
"x_opencti_created_by_ref": self.author["id"],
"x_opencti_score": self.default_score,
"x_opencti_labels": ["modat", "modat-enriched"],
},
)
Comment on lines +343 to +354
stix_domain = stix2.DomainName(
value=san_domain,
custom_properties={
"x_opencti_created_by_ref": self.author["id"],
"x_opencti_score": self.default_score,
"x_opencti_labels": [
"modat",
"modat-enriched",
"certificate-san",
],
},
)
Comment on lines +1 to +3
# Main dependencies needs to be installed
-r ../src/requirements.txt
pytest==8.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Contribution from the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(modat-enrichment): create the connector

4 participants