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
44 changes: 4 additions & 40 deletions internal-export-file/export-report-pdf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
- [Installation](#installation)
- [Requirements](#requirements)
- [Configuration variables](#configuration-variables)
- [OpenCTI environment variables](#opencti-environment-variables)
- [Base connector environment variables](#base-connector-environment-variables)
- [Connector specific environment variables](#connector-specific-environment-variables)
- [Deployment](#deployment)
- [Docker Deployment](#docker-deployment)
- [Manual Deployment](#manual-deployment)
Expand Down Expand Up @@ -49,47 +46,14 @@ The OpenCTI Export Report PDF connector allows exporting professional, branded P

- OpenCTI Platform >= 5.6.1
- **For Windows**: GTK Runtime Environment (see [Known issues](#known-issues))
- **For macOS**: you’ll have to install `cairo` and `libffi` (with Homebrew for example);

## Configuration variables

There are a number of configuration options, which are set either in `docker-compose.yml` (for Docker) or in `config.yml` (for manual deployment).
Find all the configuration variables available here: [Connector Configurations](./__metadata__/CONNECTOR_CONFIG_DOC.md)

### OpenCTI environment variables

Below are the parameters you'll need to set for OpenCTI:

| Parameter | config.yml `opencti` | Docker environment variable | Default | Mandatory | Description |
|---------------|----------------------|-----------------------------|---------|-----------|------------------------------------------------------|
| OpenCTI URL | `url` | `OPENCTI_URL` | / | Yes | The URL of the OpenCTI platform. |
| OpenCTI Token | `token` | `OPENCTI_TOKEN` | / | Yes | The default admin token set in the OpenCTI platform. |

### Base connector environment variables

Below are the parameters you'll need to set for running the connector properly:

| Parameter | config.yml `connector` | Docker environment variable | Default | Mandatory | Description |
|----------------|------------------------|-----------------------------|-----------------|-----------|----------------------------------------------------------------------------------------|
| Connector ID | `id` | `CONNECTOR_ID` | / | Yes | A unique `UUIDv4` identifier for this connector instance. |
| Connector Name | `name` | `CONNECTOR_NAME` | ExportReportPdf | No | Name of the connector. |
| Connector Scope| `scope` | `CONNECTOR_SCOPE` | application/pdf | Yes | The MIME type for PDF files. |
| Log Level | `log_level` | `CONNECTOR_LOG_LEVEL` | info | No | Determines the verbosity of the logs. Options are `debug`, `info`, `warn`, or `error`. |

### Connector specific environment variables

Below are the parameters specific to the Export Report PDF connector:

| Parameter | config.yml `export_report_pdf` | Docker environment variable | Default | Mandatory | Description |
|-----------------------|--------------------------------|-----------------------------------------|---------|-----------|-----------------------------------------------------------------|
| Primary Color | `primary_color` | `EXPORT_REPORT_PDF_PRIMARY_COLOR` | / | No | Primary color for the PDF (hex format, e.g., `#ff8c00`). |
| Secondary Color | `secondary_color` | `EXPORT_REPORT_PDF_SECONDARY_COLOR` | / | No | Secondary color for the PDF (hex format, e.g., `#000000`). |
| Company Address Line 1| `company_address_line_1` | `EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_1` | / | No | First line of company address (e.g., company name). |
| Company Address Line 2| `company_address_line_2` | `EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_2` | / | No | Second line of company address (e.g., street address). |
| Company Address Line 3| `company_address_line_3` | `EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_3` | / | No | Third line of company address (e.g., city, state, country). |
| Company Phone Number | `company_phone_number` | `EXPORT_REPORT_PDF_COMPANY_PHONE_NUMBER`| / | No | Company phone number for the PDF footer. |
| Company Email | `company_email` | `EXPORT_REPORT_PDF_COMPANY_EMAIL` | / | No | Company email for the PDF footer. |
| Company Website | `company_website` | `EXPORT_REPORT_PDF_COMPANY_WEBSITE` | / | No | Company website URL for the PDF footer. |
| Indicators Only | `indicators_only` | `EXPORT_REPORT_PDF_INDICATORS_ONLY` | false | No | If `true`, only include observables that have indicator status. |
| Defang URLs | `defang_urls` | `EXPORT_REPORT_PDF_DEFANG_URLS` | true | No | If `true`, replace `http` with `hxxp` in URL observables. |
_The `opencti` and `connector` options in the `docker-compose.yml` and `config.yml` are the same as for any other connector.
For more information regarding variables, please refer to [OpenCTI's documentation on connectors](https://docs.opencti.io/latest/deployment/connectors/)._

## Deployment

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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` | ✅ | Format: [`password`](https://json-schema.org/understanding-json-schema/reference/string#built-in-formats) | | The API token to connect to OpenCTI. |
| CONNECTOR_NAME | `string` | | string | `"ExportReportPdf"` | The name of the connector. |
| CONNECTOR_SCOPE | `array` | | string | `["application/pdf"]` | The scope of the connector, i.e. the MIME type of the exported files. |
| CONNECTOR_LOG_LEVEL | `string` | | `debug` `info` `warn` `warning` `error` | `"error"` | The minimum level of logs to display. |
| CONNECTOR_TYPE | `const` | | `INTERNAL_EXPORT_FILE` | `"INTERNAL_EXPORT_FILE"` | |
| EXPORT_REPORT_PDF_PRIMARY_COLOR | `string` | | string | `"#ff8c00"` | The primary color for the output PDF (hex format, e.g. '#ff8c00'). |
| EXPORT_REPORT_PDF_SECONDARY_COLOR | `string` | | string | `"#000000"` | The secondary color for the output PDF (hex format, e.g. '#000000'). |
| EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_1 | `string` | | string | `null` | The first line of your company address (e.g. company name). |
| EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_2 | `string` | | string | `null` | The second line of your company address (e.g. street address). |
| EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_3 | `string` | | string | `null` | The third line of your company address (e.g. city, state, country). |
| EXPORT_REPORT_PDF_COMPANY_PHONE_NUMBER | `string` | | string | `null` | The phone number of your company, displayed in the PDF footer. |
| EXPORT_REPORT_PDF_COMPANY_EMAIL | `string` | | string | `null` | The email of your company, displayed in the PDF footer. |
| EXPORT_REPORT_PDF_COMPANY_WEBSITE | `string` | | string | `null` | The website of your company, displayed in the PDF footer. |
| EXPORT_REPORT_PDF_INDICATORS_ONLY | `boolean` | | boolean | `false` | Whether or not to only include Observables that are Indicators in the report. |
| EXPORT_REPORT_PDF_DEFANG_URLS | `boolean` | | boolean | `false` | Whether or not to replace 'http' in Url observables with 'hxxp'. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://www.filigran.io/connectors/export-report-pdf_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.",
"format": "password",
"type": "string",
"writeOnly": true
},
"CONNECTOR_NAME": {
"default": "ExportReportPdf",
"description": "The name of the connector.",
"type": "string"
},
"CONNECTOR_SCOPE": {
"default": [
"application/pdf"
],
"description": "The scope of the connector, i.e. the MIME type of the exported files.",
"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_EXPORT_FILE",
"default": "INTERNAL_EXPORT_FILE",
"type": "string"
},
"EXPORT_REPORT_PDF_PRIMARY_COLOR": {
"default": "#ff8c00",
"description": "The primary color for the output PDF (hex format, e.g. '#ff8c00').",
"type": "string"
},
"EXPORT_REPORT_PDF_SECONDARY_COLOR": {
"default": "#000000",
"description": "The secondary color for the output PDF (hex format, e.g. '#000000').",
"type": "string"
},
"EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_1": {
"default": null,
"description": "The first line of your company address (e.g. company name).",
"type": "string"
},
"EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_2": {
"default": null,
"description": "The second line of your company address (e.g. street address).",
"type": "string"
},
"EXPORT_REPORT_PDF_COMPANY_ADDRESS_LINE_3": {
"default": null,
"description": "The third line of your company address (e.g. city, state, country).",
"type": "string"
},
"EXPORT_REPORT_PDF_COMPANY_PHONE_NUMBER": {
"default": null,
"description": "The phone number of your company, displayed in the PDF footer.",
"type": "string"
},
"EXPORT_REPORT_PDF_COMPANY_EMAIL": {
"default": null,
"description": "The email of your company, displayed in the PDF footer.",
"type": "string"
},
"EXPORT_REPORT_PDF_COMPANY_WEBSITE": {
"default": null,
"description": "The website of your company, displayed in the PDF footer.",
"type": "string"
},
"EXPORT_REPORT_PDF_INDICATORS_ONLY": {
"default": false,
"description": "Whether or not to only include Observables that are Indicators in the report.",
"type": "boolean"
},
"EXPORT_REPORT_PDF_DEFANG_URLS": {
"default": false,
"description": "Whether or not to replace 'http' in Url observables with 'hxxp'.",
"type": "boolean"
}
},
"required": [
"OPENCTI_URL",
"OPENCTI_TOKEN"
],
"additionalProperties": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"support_version": ">=5.6.1",
"subscription_link": null,
"source_code": "https://github.com/OpenCTI-Platform/connectors/tree/master/internal-export-file/export-report-pdf",
"manager_supported": false,
"manager_supported": true,
"container_version": "rolling",
"container_image": "opencti/connector-export-report-pdf",
"container_type": "INTERNAL_EXPORT_FILE"
Expand Down
3 changes: 3 additions & 0 deletions internal-export-file/export-report-pdf/src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from export_report_pdf.settings import ConnectorSettings

__all__ = ["ConnectorSettings"]
29 changes: 14 additions & 15 deletions internal-export-file/export-report-pdf/src/config.yml.sample
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
opencti:

Check warning on line 1 in internal-export-file/export-report-pdf/src/config.yml.sample

View workflow job for this annotation

GitHub Actions / Lint internal-export-file/export-report-pdf

VC104: config.yml.sample found at src/config.yml.sample (src/)
url: 'http://localhost'
token: 'ChangeMe'

connector:
type: 'INTERNAL_EXPORT_FILE'
id: 'ExportReportPdf'
name: 'ExportReportPdf'
scope: 'application/pdf'
log_level: 'info'
id: 'ChangeMe'
# name: 'ExportReportPdf'
# scope: 'application/pdf'
# log_level: 'error'

export_report_pdf:
primary_color: '#ff8c00' # The primary color for the output pdf
secondary_color: '#000000' # The secondary color for the output pdf
company_address_line_1: 'Example Name' # The first line of your company address
company_address_line_2: '123 Main Street'
company_address_line_3: 'Miami, FL 33101 USA'
company_phone_number: '888.888.8888' # The phone number of your company
company_email: 'intelligence_reports@example.com' # The email of your company
company_website: 'https://example.com' # The website of your company
indicators_only: false # Whether or not to only include Observables that are Indicators in the report
defang_urls: true # Replace http in Url observables with hxxp
# primary_color: '#ff8c00' # The primary color for the output pdf
# secondary_color: '#000000' # The secondary color for the output pdf
# company_address_line_1: 'Example Name' # The first line of your company address
# company_address_line_2: '123 Main Street'
# company_address_line_3: 'Miami, FL 33101 USA'
# company_phone_number: '888.888.8888' # The phone number of your company
# company_email: 'intelligence_reports@example.com' # The email of your company
# company_website: 'https://example.com' # The website of your company
# indicators_only: false # Whether or not to only include Observables that are Indicators in the report
# defang_urls: false # Replace http in Url observables with hxxp

This file was deleted.

Loading
Loading