Building a custom OpenCTI connector

A custom OpenCTI connector brings an internal or niche threat source into the platform when no official integration exists. This page explains the connector types, the build path and the ongoing cost of ownership.

On this page

When a custom OpenCTI connector is the right build

A custom connector is the right build when your team has an import, enrichment, export or stream need and no published connector covers the source or tool. Before you commit, check the Filigran-published connectors in the OpenCTI connectors repository, then confirm whether an existing connector can be configured to meet the need. If the source is internal, niche or a tool with no official integration, the work moves into your own code, which you will own, test and maintain.

OpenCTI's architecture explains what that code has to do. The platform (its web interface and GraphQL API) does not write data directly from external sources. Connectors send work as messages through RabbitMQ, and Python workers consume those messages to perform the asynchronous writes into the platform. Connectors therefore sit at the edge of the system: they read from your source, convert what they read into STIX objects, and hand them to the platform in a predictable way. A connector is not a plugin inside the platform, so it can be deployed, upgraded and removed without changing the core installation.

Because the connector is code your organization owns, the maintenance burden is yours from the first day. Each connector needs a source owner, a run schedule, error handling for a source that changes or goes offline, and a plan for OpenCTI release changes. Confirm the connector API details, including the base class, configuration keys, required environment variables and the message types it emits, against the official connector template before you design around them. If the source is a commercial feed or internal system with access restrictions, also confirm the credentials, rate limits and data-handling terms with its owner.

Which connector type fits the source

An import connector reads from a source outside OpenCTI and creates new STIX objects in the platform, such as reports, indicators, malware and threat actors. The data direction is inward: the connector reads the source and writes bundles that OpenCTI ingests. Typical internal sources include a case management system where analysts record confirmed indicators, a sharing portal run by your own CERT, or a vendor feed that has no official integration. Choose this role when the question is how intelligence gets into OpenCTI.

  • Direction: the source is read and new objects are created.
  • Typical internal source: a case or ticketing system, or a scheduled export from a tool that has no official connector.
  • Output: STIX 2.1 bundles containing objects and the relationships between them.
  • Scheduling: the connector polls or runs on a timer, so tracking what was already imported matters.
  • Ownership: your team owns the mapping from source fields to STIX objects and the decisions about duplicates.

Before you name the connector type, check the role list in the OpenCTI deployment overview. Then confirm whether your source can return incremental changes, because that decides how the import state is stored.

How to build the connector from the official template

This sequence takes a connector from a confirmed target version and role to a bundle of STIX 2.1 objects that you can see in the OpenCTI interface. Each step ends with a check, so a problem surfaces at the step that caused it rather than at go-live.

  1. Confirm the target version and connector role

    Before writing code, record the OpenCTI version your platform runs and the role the connector will play: external import, internal enrichment, stream consumer or another type. Check the version against the release list and the product life cycle page, because the connector's expected environment variables and API calls depend on it. Ask the platform owner to confirm the version in writing so the build targets the same release that will run in production. Done when the version and role are written into the connector's design note and the platform owner has signed off on both.

  2. Start from the official connector template

    Clone the connector template from the OpenCTI GitHub repository into a new project under your own source control, and rename the package, container name and connector identifier to match your source. Keep the template's folder layout, configuration loader and logging setup so that later upgrades to the template remain a manageable diff. Record the template commit you started from. Done when the project builds locally with the template's default code and the new name appears in the logs of a test run.

  3. Configure the environment and platform registration

    Set the connector's configuration through environment variables: the platform URL, a dedicated connector token from a service account, the connector identifier, the scope it declares and the polling or scheduling settings. Use a service account with the narrowest marking and capability set the connector needs, and keep the token in a secrets store rather than in the image. Start the connector and confirm that it registers with the platform and appears in the connector management view with a healthy status. Done when the connector shows as registered and active, and the platform log records no authentication errors.

  4. Connect to the source and fetch records

    Replace the template's sample data path with a client for your source, such as an API, database query, file share or feed. Handle authentication, pagination and rate limits in the fetch layer and persist a cursor or last-seen marker so a restart resumes where it stopped instead of re-reading the whole source. Log the number of records fetched per run. Done when a test run returns a known set of records from the source and the cursor advances as expected on a second run.

  5. Map source records to STIX 2.1 objects

    Map each source field to a STIX 2.1 object type and property, using the STIX 2.1 specification as the reference. Generate deterministic identifiers from stable source keys so re-imports update existing objects instead of creating duplicates, and set created and modified timestamps from the source where it provides them. Attach relationships and object markings explicitly, and decide which fields you will drop rather than guessing at their meaning. Validate each generated object against the STIX 2.1 schema with an off-the-shelf validator in your test suite. Done when a sample of records produces objects that pass schema validation and two runs over the same input produce identical identifiers.

  6. Send objects as STIX bundles to the platform

    Group the generated objects into STIX 2.1 bundles and send them through the connector's work queue using the helper functions in the template, so that the platform's workers write the data asynchronously. Set a work name and a sensible bundle size, and check the platform's work status for each send. Include a clear error path that marks a failed work item with the error message instead of silently dropping the bundle. Done when a test run produces a work item that completes successfully in the platform's work view with no errors recorded.

  7. Verify objects in the platform

    Open the platform and confirm that the expected objects appear, with the right types, markings, relationships and timestamps. Search for a few known records by name or identifier, then run a second import of the same source data and confirm that the object count does not grow and that updated fields change on the existing objects. Test an edge case such as a missing optional field or a record that changes. Done when the spot checks match the source, the re-import is idempotent and the results are recorded in the test notes for the handover.

  8. Package, test and hand over for maintenance

    Build a container image from the project, pin the base image and library versions, and store the connector's test suite, mapping notes and configuration reference alongside the code. Schedule a review each time the target OpenCTI version changes, and rerun the verification steps against the new release in a non-production platform first. Name an owner for the connector and document how it is started, monitored and rolled back. Done when the image deploys from the pipeline into a test environment, the verification steps pass there and the handover document is accepted by the owner.

Producing valid STIX 2.1 bundles from a niche source

The core of a custom connector is translation: every field your source produces has to become a STIX object, a relationship between objects, a marking that controls who can see it, and an identifier that lets OpenCTI recognize the same thing on the next run. OpenCTI's knowledge schema is built on the STIX 2 standards, so the connector is not writing rows into a private table. It is emitting STIX 2.1 bundles that the platform parses, deduplicates and merges. Decide the mapping on paper before writing code: for each source field, name the target STIX object type, the property it fills, and whether the value is an identifier, a descriptive attribute or a link to another object. Fields with no clear target should be dropped or kept in a documented custom property, not guessed into the wrong type.

Most failed connectors fail in the same four ways. Required properties go missing, so a bundle that looks plausible is rejected or silently partial. Identifiers are unstable, for example generated from a timestamp or a counter, so every run creates duplicates instead of updating existing entities. Timestamps are written in the wrong format or without a time zone, which corrupts ordering and first-seen or last-seen logic. And over-broad creation emits an observable, indicator and malware object for every line in a feed when the source only supports a weaker claim. Derive identifiers from stable source keys, emit timestamps in the format the STIX specification defines, and create only the objects the source actually supports. Confirm the exact required properties for each object type against the STIX 2.1 documentation rather than relying on memory.

Validate every bundle with a STIX validator before it reaches the platform, and make validation a gate in the connector's test run, not a manual step. Then run a small sample set, perhaps a few dozen records chosen to include edge cases such as empty fields, duplicates and unusual characters, and inspect the result in the OpenCTI interface. Run the sample twice to confirm that identifiers are stable and that the second run updates rather than duplicates. Ask your team to record which fields map to which objects, because that mapping becomes the reference for later changes to the source format. Only then should the connector process the full source.

What drives the effort and cost of a custom connector

A custom connector's cost comes from a handful of components that interact: how the source behaves, how much data moves, how faithfully it maps to STIX, and how the connector is tested and kept running. Most of these are one-time build work, but several recur every time the source or OpenCTI changes.

Source API quality and documentation

A source with a stable, versioned API and accurate documentation shortens discovery and mapping. Undocumented fields, inconsistent pagination and silent schema changes add investigation time that is paid once during the build and again whenever the vendor changes behavior. Ask the team to name the source API version, the documented change policy, and whether a sandbox or test tenant is available for development.

Volume and rate limits

The number of records per run and the request ceiling set how the connector schedules work, batches reads and resumes after throttling. A connector that fetches an entire feed on every run costs more to build correctly and more to operate than one that tracks a cursor or timestamp. Ask for documented quotas, expected daily record counts, and how the proposal handles retries and backoff.

Mapping complexity across STIX object types

Each source field must become a STIX 2.1 object, relationship or marking, and the depth of that mapping drives most of the build effort. A feed that yields only indicators is simpler than one that produces malware, threat actors, campaigns, locations and linked reports. Ask for a field-by-field mapping document and the list of STIX object types in scope before estimating.

Deduplication and update logic

Repeated records, changed records and deleted records each need a defined outcome in OpenCTI. Stable identifiers, deterministic STIX IDs and clear rules for revoking or updating objects determine whether the connector creates duplicates over time. This work is one-time design followed by recurring verification in production. Ask how the proposal keys objects, how updates are versioned, and how retractions are represented.

Authentication to the source

API keys, OAuth flows, client certificates and mutual TLS each carry different setup and rotation work. Credentials must be stored in the connector configuration without being logged, and rotation may require a restart or redeployment. Ask who issues and rotates credentials, how expiry is detected, and whether the source supports service accounts scoped to read-only access.

Test and packaging work

Testing against captured source data, validating bundles and packaging the connector for the platform's container deployment are recurring costs once the connector is live. Each OpenCTI upgrade and each source change can break validation, so the test suite and container build need owners. Ask what test fixtures are delivered, how the connector is versioned, and who maintains it after handover.

Packaging and hosting options and when each fits

This table compares three ways to run a custom connector inside your own infrastructure: next to the platform, as a separate long-running service, or as a scheduled job for pull-based sources. Read each row against the source's behavior, such as whether it pushes events or must be polled, and how often your team expects changes. The main takeaway is that the hosting choice follows the source's update pattern and your team's operating model more than the connector code itself.

OptionWhen it fitsOperational trade-offsWhat to confirm
Container alongside the platformSmall internal connector that talks to the platform on the same network and shares its deployment pipelineConnector restarts and upgrades are tied to platform change windows; resource limits can compete with platform workersThe platform's compose or Helm values file accepts the connector image, and resource limits are set for it
Separate service in KubernetesConnector that must scale, restart independently, or follow your cluster's logging and secrets standardsNeeds a Deployment, secrets handling and network policy written by your platform team; more moving parts to monitorYour cluster policy allows the image registry and egress to the platform and the source system
Separate service in DockerConnector on a host your team already runs Docker on, with a single owner and no clusterHost patching and restart policy become the connector's availability model; little built-in schedulingRestart policy, log collection and host backup coverage are defined for the container
Scheduled job for pull-based sourcesSource only offers periodic exports or an API you query, with no push or streamGaps appear if a run fails silently; overlapping runs can duplicate data unless the connector tracks stateThe job stores a last-run marker, and alerts fire when a run fails or produces no new data
Long-running pollerSource has an API with frequent changes and the connector must keep its own cursor between pollsContinuous load on the source API; needs backoff and rate-limit handling to avoid lockoutsThe source's rate limits and the poll interval agreed with the source owner
Air-gapped or restricted networkSource and platform sit in a segment with no outbound internet accessImages and Python dependencies must be mirrored in, which adds a release step for every connector updateInternal registry and package mirror are available, and the update procedure is written down
Image built from the official templateConnector follows the template's layout and is rebuilt each time the platform's connector library changesRequires rebuilding and retesting when you move to a newer platform releaseThe base image tag matches the platform version you run, as stated in the connector's documentation

How to test and maintain a connector across OpenCTI releases

A connector is only as trustworthy as its last test against the platform version it runs on, so test it in a non-production OpenCTI instance that matches the release you will run in production. Pin the same image tag for the platform, its workers and the connector's pycti dependency, then run a full import from your internal or niche source. Confirm that the first run creates the expected STIX objects with the right markings and author identities, and that entities are not duplicated. Then run the connector a second time against unchanged source data. The second run should update existing objects or do nothing at all. If it creates new duplicates, the deterministic IDs or the external references in your bundles are wrong, and that must be fixed before go-live.

During the bulk import, watch the RabbitMQ queues and the Python workers that consume them, since the connector's writes arrive asynchronously. Test with a realistic volume from your source, not a handful of sample records, and watch whether the queue backlog drains or keeps growing. Set the connector's batch size and pacing from those observations rather than guessing. Check the platform's own logs and the connector logs for rejected bundles, because a bundle can be accepted by the connector yet fail validation later in the pipeline.

Maintenance is a recurring cost. OpenCTI publishes non-LTS releases from daily to weekly, and LTS lines arrive every six months, so plan a re-test cycle after each platform upgrade you adopt, not only when the connector breaks. Confirm compatibility for each target version in the OpenCTI releases page and its release notes before you upgrade. Keep the connector's pycti version aligned with the platform, and record which platform versions the connector has been tested against. Ask the connector owner, whether an internal team or a partner, to name who runs this re-test and how long it is scheduled to take.

Security risks in connector code and credentials

A connector sits between an external source and a platform that holds shared intelligence, so it carries two kinds of exposure: the secrets it uses to reach each system, and the content it writes into the knowledge graph. The cards below cover the controls that keep both contained, and what to confirm in your own environment before the connector goes live.

Protect source and platform tokens

A connector holds the API key for the source feed and the platform connector token that lets it write to OpenCTI. Keep both out of the repository and the container image, inject them at runtime from your secrets manager or orchestrator, and rotate them on a schedule you write down. Confirm who can read the environment variables of the running container, since anyone with that access can usually read both tokens.

Scope service identities narrowly

Create a dedicated platform user for each connector so its writes are attributable and its permissions can be limited to the groups and marking levels it needs. A connector that imports one feed should not be able to edit unrelated reports or delete entities. Confirm the connector's account cannot change platform settings, manage users, or read data segregated to other organizations.

Validate source content before ingestion

External feeds can contain malformed fields, unexpected object types, oversized payloads or hostile strings. Parse every record against the STIX 2.1 object rules, reject or quarantine what fails, and cap sizes and batch counts so one bad file cannot stall the workers. Confirm the connector never passes raw source text into a query, a shell command or a file path without escaping.

Mark and segregate shared intelligence

Connector output inherits the marking definitions you assign, such as TLP levels or custom statements, and those markings decide who can see each record. Set markings in the connector configuration rather than trusting the source, and check what happens to records that arrive with no marking. Where your organization segregates data by team or partner, confirm that the connector writes into the correct segregation boundary, which depends on the Enterprise Edition features you hold.

Pin base images and dependencies

A connector built from a public base image and a list of Python packages inherits every upstream flaw in those layers. Pin image digests and dependency versions, scan the built image before each deployment, and rebuild when the base receives security fixes. Confirm which OpenCTI and pycti versions your connector targets, since a mismatch can break writes silently.

Keep indicators out of logs

Connector logs often record each object created, including the indicator values, file hashes or internal hostnames it handled. Those values can be sensitive for the source or for your own investigations. Decide which fields are logged, mask or hash the rest, and set retention for log storage. Confirm that debug logging is off in production and that log access follows the same restrictions as the data itself.

Questions teams ask before building a connector

What does a custom OpenCTI connector cost to build and run?

The cost is mostly the engineering time to understand the source, map its data to STIX 2.1 objects, write and test the connector, and package it for your deployment. Build cost is one-time, but running the connector recurs: someone must watch its logs, rotate its credentials, and update it when the source API changes or OpenCTI moves to a new release. Costs rise with the number of source data types, the complexity of the source's authentication and pagination, the volume of records, and how many environments the connector must run in. Ask any partner for a quote that separates discovery, build, testing, packaging, handover and a separate line for ongoing support, and ask which of these items recur.

How long does a custom connector take to build?

The timeline depends mainly on how well the source is documented and how much of its data must map into OpenCTI. A source with a stable, documented API and a small set of object types moves quickly, while a source that needs custom parsing, has rate limits, or delivers data in inconsistent formats takes longer. Other drivers are the number of connector types involved, the review your change process requires, and the time to get a test instance and credentials. Ask for a timeline that lists these dependencies, and check whether it includes a retest after the first OpenCTI upgrade your team plans to make.

What must our team provide before a connector build starts?

A connector build needs four things from your side. First, access to the source with a service account or API key that has the scope the connector needs. Second, sample data that represents real records, including edge cases such as missing fields and duplicates, so the mapping is tested against reality. Third, a test OpenCTI instance that matches your planned version, so results are not measured against a platform you will not run. Fourth, named owners who can approve the data mapping, decide how marking definitions and confidence levels are applied, and accept the connector into production. Confirm these inputs in the written scope so delays are not hidden inside the build estimate.

Can an internal team build an OpenCTI connector without outside help?

Yes, if the team has a developer comfortable with Python, the STIX 2.1 data model, and container packaging, and if the source is well documented. The official connector template gives a working structure, so the work is mostly the source-specific parts. Teams often struggle with idempotent imports, error handling for partial failures, and keeping bundles valid as the schema evolves. Decide early who will own the connector after launch, because a connector built by one engineer becomes a risk when that person moves on. A partner can be useful for a review of the mapping, a security check of credentials handling, or a fixed-scope build with handover.

How is a custom connector maintained across OpenCTI upgrades?

Maintenance depends on how often OpenCTI changes the parts your connector uses. OpenCTI uses date-based version numbers, and non-LTS releases ship from daily to weekly, while LTS releases come every 6 months and each is supported for 1 year. A connector should be tested against the OpenCTI version you run before each upgrade, and against any new LTS line you plan to adopt. Also plan for changes in the source API, library updates, and credential rotation. Ask for a written maintenance process that names who runs regression tests, where the test results are stored, and how a broken connector is rolled back.

When should we use an official connector or a built-in ingester instead?

Use an official connector when the source already has one that covers the data you need, because it is maintained by the platform vendor and needs less of your code. Use the built-in ingesters for standard formats such as TAXII, CSV, JSON or RSS when the source publishes data in those forms, since no custom code is needed. Build a custom connector only when neither option fits, for example an internal system, a niche source, or a feed that needs a specific transformation. Check the official connector's documentation for the source and OpenCTI version it supports, and confirm whether any feature you need requires the Enterprise Edition license before you commit.

Does a custom connector create security or compliance risk?

It can. A connector holds credentials for the source and writes data into your threat intelligence platform, so its access should be scoped to what it needs. Review how credentials are stored and rotated, what the connector can read or change in OpenCTI, how marking definitions are applied to imported data, and whether sensitive source data is logged. Keep the connector's container image, dependencies and configuration under change control, so you can show a reviewer what runs and who approved it. Your compliance team should confirm which requirements apply to your sharing and retention obligations, since DeployOpen prepares evidence for assessments but does not issue audit reports or certifications.

How a custom connector moves data into OpenCTI

The flow starts at the internal source, which the connector container reads and converts into STIX 2.1 bundles. The connector then sends work through the OpenCTI platform API, where RabbitMQ queues it for Python workers that perform the asynchronous writes into the knowledge graph. Check the trust boundary: the connector needs outbound access to the platform only, and the source credentials should stay inside your network.

Data path from an internal source through the connector and platform workers into the knowledge graph.

How DeployOpen scopes a connector engagement

A written scope comes before any connector code is written. For a custom OpenCTI connector, that scope names the source system, the access method (API, file export, feed or message stream), the STIX 2.1 objects the connector will create or update, and the test plan that proves the output is valid before it reaches a production platform. DeployOpen agrees these items with your team first, because the mapping decisions (which source fields become observables, indicators, reports or identities, and how confidence and markings are set) drive most of the effort. The connector type you choose, such as an import, enrichment or stream connector, is also settled at this stage, since it determines how the connector is triggered and how it is packaged.

The connector is built and delivered inside your infrastructure. DeployOpen works in your container registry, your OpenCTI test instance and your CI pipeline, so the source credentials, the connector configuration and the generated bundles stay under your control. Deliverables are agreed in the same document as the scope: the connector source code, its container image or deployment manifest, the configuration reference, the test results against a non-production OpenCTI platform, and a short runbook covering how to start, stop and troubleshoot the connector. Confirm with your platform team which OpenCTI version your production instance runs, since the connector must be tested against that version and against the versions you plan to adopt next.

After handover, many teams want someone to keep the connector working as the source changes and as OpenCTI releases move forward. DeployOpen offers ongoing support as a retainer, which can cover source API changes, dependency updates, compatibility checks against new OpenCTI releases and investigation of ingestion errors. Ask for the retainer terms in writing, including what is covered, how requests are raised and who is responsible for approving changes to the mapping logic.

How DeployOpen delivers custom OpenCTI connectors

DeployOpen scopes, builds, tests and hands over custom OpenCTI connectors for internal and niche sources, inside infrastructure you control. Each engagement starts with a written scope that fixes the connector type, the source and the deliverables before any code is written.

How we scope

  • Confirm the source system, its access method and the data fields that must map to STIX 2.1 objects.
  • Agree the connector type and whether it imports, enriches or streams, before choosing the template.
  • Record the target OpenCTI version line and deployment model in the written scope before work starts.

How we build

  • Start from the official connector template and keep changes to the source adapter and mapping layer.
  • Produce STIX 2.1 bundles and check them against the schema and the markings your organization uses.
  • Test against a non-production OpenCTI instance with representative data, including duplicate and malformed records.

How we hand over

  • Package the connector with a container image, configuration reference and environment variable documentation.
  • Document the mapping rules, known limits, failure handling and the steps to restart or replay an import.
  • Walk your engineers through deployment, logs and the test suite so your team can run it independently.

How we support

  • Offer ongoing support, upgrades and testing against new OpenCTI releases as a retainer.
  • Review connector compatibility when your OpenCTI platform moves to a new release or LTS line.
  • Ask for the retainer scope in writing, including which source changes and version updates it covers.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.