Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Connector Configurations

Below is an exhaustive enumeration of all configurable parameters available, each accompanied by detailed explanations of their purposes, default behaviors, and usage guidelines to help you understand and utilize them effectively.

### Type: `object`

| Property | Type | Required | Possible values | Default | Description |
| -------- | ---- | -------- | --------------- | ------- | ----------- |
| OPENCTI_URL | `string` | ✅ | Format: [`uri`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | The base URL of the OpenCTI instance. |
| OPENCTI_TOKEN | `string` | ✅ | string | | The API token to connect to OpenCTI. |
| DOMAINTOOLS_API_USERNAME | `string` | ✅ | string | | The username required for the authentication on DomainTools API. |
| DOMAINTOOLS_API_KEY | `string` | ✅ | Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | The password required for the authentication on DomainTools API. |
| CONNECTOR_NAME | `string` | | string | `"Domaintools"` | The name of the connector. |
| CONNECTOR_SCOPE | `array` | | string | `["Domain-Name", "Ipv4-Addr"]` | The scope of the connector. |
| CONNECTOR_LOG_LEVEL | `string` | | `debug` `info` `warn` `warning` `error` | `"error"` | The minimum level of logs to display. |
| CONNECTOR_TYPE | `const` | | `INTERNAL_ENRICHMENT` | `"INTERNAL_ENRICHMENT"` | |
| CONNECTOR_AUTO | `boolean` | | boolean | `false` | Whether the connector should run automatically when an entity is created or updated. |
| DOMAINTOOLS_MAX_TLP | `string` | | string | `"TLP:AMBER"` | The maximal TLP of the observable being enriched. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://www.filigran.io/connectors/domaintools_config.schema.json",
"type": "object",
"properties": {
"OPENCTI_URL": {
"description": "The base URL of the OpenCTI instance.",
"format": "uri",
"maxLength": 2083,
"minLength": 1,
"type": "string"
},
"OPENCTI_TOKEN": {
"description": "The API token to connect to OpenCTI.",
"type": "string"
},
"CONNECTOR_NAME": {
"default": "Domaintools",
"description": "The name of the connector.",
"type": "string"
},
"CONNECTOR_SCOPE": {
"default": [
"Domain-Name",
"Ipv4-Addr"
],
"description": "The scope of the connector.",
"items": {
"type": "string"
},
"type": "array"
},
"CONNECTOR_LOG_LEVEL": {
"default": "error",
"description": "The minimum level of logs to display.",
"enum": [
"debug",
"info",
"warn",
"warning",
"error"
],
"type": "string"
},
"CONNECTOR_TYPE": {
"const": "INTERNAL_ENRICHMENT",
"default": "INTERNAL_ENRICHMENT",
"type": "string"
},
"CONNECTOR_AUTO": {
"default": false,
"description": "Whether the connector should run automatically when an entity is created or updated.",
"type": "boolean"
},
"DOMAINTOOLS_API_USERNAME": {
"description": "The username required for the authentication on DomainTools API.",
"type": "string"
},
"DOMAINTOOLS_API_KEY": {
"description": "The password required for the authentication on DomainTools API.",
"format": "password",
"type": "string",
"writeOnly": true
},
"DOMAINTOOLS_MAX_TLP": {
"default": "TLP:AMBER",
"description": "The maximal TLP of the observable being enriched.",
"type": "string"
}
},
"required": [
"OPENCTI_URL",
"OPENCTI_TOKEN",
"DOMAINTOOLS_API_USERNAME",
"DOMAINTOOLS_API_KEY"
],
"additionalProperties": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"support_version": ">=5.6.1",
"subscription_link": null,
"source_code": "https://github.com/OpenCTI-Platform/connectors/tree/master/internal-enrichment/domaintools",
"manager_supported": false,
"manager_supported": true,
"container_version": "rolling",
"container_image": "opencti/connector-domaintools",
"container_type": "INTERNAL_ENRICHMENT"
Expand Down
10 changes: 5 additions & 5 deletions internal-enrichment/domaintools/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: '3'
services:
connector-domaintools:
image: opencti/connector-domaintools:latest
environment:
- OPENCTI_URL=http://localhost
- OPENCTI_TOKEN=ChangeMe
- CONNECTOR_ID=ChangeMe
- CONNECTOR_NAME=DomainTools
- CONNECTOR_SCOPE=Domain-Name,Ipv4-Addr
- CONNECTOR_AUTO=false # Enable/disable auto-enrichment of observables
#- CONNECTOR_LOG_LEVEL=info
#- CONNECTOR_NAME=DomainTools
#- CONNECTOR_SCOPE=Domain-Name,Ipv4-Addr
#- CONNECTOR_AUTO=false # Enable/disable auto-enrichment of observables
- DOMAINTOOLS_API_USERNAME=ChangeMe
- DOMAINTOOLS_API_KEY=ChangeMe
- DOMAINTOOLS_MAX_TLP=TLP:AMBER
#- DOMAINTOOLS_MAX_TLP=TLP:AMBER
restart: always
11 changes: 5 additions & 6 deletions internal-enrichment/domaintools/src/config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ opencti:

connector:
id: 'ChangeMe'
name: 'DomainTools'
scope: 'Domain-Name,Ipv4-Addr'
auto: false # Enable/disable auto-enrichment of observables
confidence_level: 80 # From 0 (Unknown) to 100 (Fully trusted)
log_level: 'info'
#name: 'DomainTools'
#scope: 'Domain-Name,Ipv4-Addr'
#auto: false # Enable/disable auto-enrichment of observables
#log_level: 'info'

domaintools:
api_username: 'ChangeMe'
api_key: 'ChangeMe'
max_tlp: 'TLP:AMBER'
#max_tlp: 'TLP:AMBER'
6 changes: 3 additions & 3 deletions internal-enrichment/domaintools/src/connector/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""DomainTools connector module."""

from .core import DomainToolsConnector
from .connector import DomainToolsConnector
from .settings import ConnectorSettings

__all__ = ["DomainToolsConnector"]
__all__ = ["DomainToolsConnector", "ConnectorSettings"]
10 changes: 5 additions & 5 deletions internal-enrichment/domaintools/src/connector/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import stix2
import validators
from connectors_sdk.models import OrganizationAuthor
from pycti import STIX_EXT_OCTI_SCO, OpenCTIConnectorHelper, StixCoreRelationship

from .constants import EntityType
Expand All @@ -18,16 +19,16 @@ class DtBuilder:
"""

def __init__(
self, helper: OpenCTIConnectorHelper, author: stix2.Identity, stix_objects: []
self, helper: OpenCTIConnectorHelper, author: OrganizationAuthor, stix_objects
):
"""Initialize DtBuilder."""
self.helper = helper
self.author = author

# Use custom properties to set the author and the confidence level of the object.
self.extensions = {}
self.extensions[STIX_EXT_OCTI_SCO] = {"created_by_ref": author["id"]}
self.bundle = stix_objects + [self.author]
self.extensions[STIX_EXT_OCTI_SCO] = {"created_by_ref": author.id}
self.bundle = stix_objects + [self.author.to_stix2_object()]

def reset_score(self):
"""Reset the score used."""
Expand Down Expand Up @@ -263,8 +264,7 @@ def create_relationship(
Created relationship.
"""
kwargs = {
"created_by_ref": self.author,
"confidence": self.helper.connect_confidence_level,
"created_by_ref": self.author.id,
}
if description is not None:
kwargs["description"] = description
Expand Down
Loading