You are reading the documentation of OpenCTI 7.260309 LTS · 7.260309.0-lts.8, supported until 2027-04.Latest is 7.261119.0 →
How-to guide

Harden the deployment

Close the shared services of the XTM stack to the network, protect the health keys, limit who gets an OpenCRQ account, and tighten the OpenCTI settings, from rate limiting to sessions and logs.

OpenCTIOpenCRQAll modulesFor platform engineers

The XTM stack starts with settings that make a first deployment easy, not with the strictest ones. This page lists what to tighten before production: the shared services the Docker deployment publishes, the health keys, who can create an account in XTM One, and the security settings of OpenCTI, each with its key, its default and the value to choose.

OUTSIDE THE HOSTHOSTOPENCTISHARED SERVICESUsers and clientsOver HTTPSExternal integrationsConnect to RabbitMQReverse proxyTLSHost firewallRestricts 5672, 15672 and 9000OpenCTIRate limit, GraphQL limits, sessions, logsElasticsearch9200, no authentication: unpublishedRedis6379, no password: unpublishedRabbitMQ5672 and 15672, password of .envS3 storage9000, password of .env
  1. Users and clients → Reverse proxy: HTTPS
  2. Reverse proxy → OpenCTI: X-Forwarded-For
  3. OpenCTI → Elasticsearch: Docker network
  4. OpenCTI → Redis: Docker network
  5. External integrations → Host firewall: if you have some
  6. Host firewall → RabbitMQ: user and password
Only the reverse proxy faces users, Elasticsearch and Redis are closed to the network, RabbitMQ and S3 storage keep their passwords, and OpenCTI limits what each client sends

Before you start

In xtm-docker, the platforms take their settings from docker-compose.yml. Put your changes in docker-compose.override.yml, as Change the stack without editing docker-compose.yml describes, then apply them with docker compose up -d.

Close Elasticsearch and Redis to the network

xtm-docker publishes the ports of the shared services on every interface of the host. Two of them have no authentication: Elasticsearch, on port 9200, runs with xpack.security.enabled=false, and Redis, on port 6379, has no password. Anyone who reaches these ports reads and changes all the data. The platforms reach them on the Docker network, so the published ports are not needed.

  1. Remove the published ports in docker-compose.override.yml. If the file already has ports for these services, replace them. The !reset tag needs Docker Compose 2.24 or later.

    services:
      elasticsearch:
        ports: !reset []
      redis:
        ports: !reset []
    
  2. Recreate the two services.

    docker compose up -d elasticsearch redis
    
    Check that it worked
    docker compose ps --format '{{.Service}} {{.Ports}}' | grep -E '^(elasticsearch|redis) '
    

    No line shows a 0.0.0.0: mapping.

RabbitMQ (5672, and 15672 for its management interface) and S3 storage (9000) are protected by the user and password of .env. Integrations that run outside the host connect to RabbitMQ: if you have none, restrict these ports with the firewall of the host.

Protect the health keys

The health endpoints answer only with their key. See Check that the platforms are healthy.

  • OpenCTI refuses every call while its key is empty or ChangeMe. Keep a random OPENCTI_HEALTHCHECK_ACCESS_KEY, and do not set it to public on a network you do not trust.
  • OpenAEV accepts its default key, ChangeMe, and xtm-docker falls back to it when OPENAEV_HEALTHCHECK_KEY is missing from .env. Set a random value.

Limit who gets an OpenCRQ account

OpenCRQ signs its users in through XTM One, and gives an account to any XTM One user at their first sign-in, even one who is a member of no tenant: they then read You don't have access to OpenCRQ yet until an administrator adds them. Who can sign in to OpenCRQ is therefore who can get an XTM One account.

In XTM One, keep Local Registration off, or limit new accounts to your domains with Allowed email domains, and do the same for the On-the-fly user creation of each single sign-on method. See Decide who gets an account in XTM One.

Tighten OpenCTI

The settings below are keys of the OpenCTI configuration. Each one has an environment variable: the key in capitals, with __ between its levels, such as APP__SESSION_TIMEOUT for app:session_timeout. Give a list as a JSON array.

services:
  opencti:
    environment:
      - APP__SESSION_TIMEOUT=900000
      - 'APP__RATE_PROTECTION__IP_SKIP_RANGES=["10.0.0.0/8"]'

Rate limiting

OpenCTI limits the number of HTTP requests each client can send in a time window, GraphQL included, before any session handling. A client over the limit gets 429 Too Many Requests until the window ends. Use it when nothing in front of the platform limits the rate already.

A client is an IP address.

KeyDefaultWhat it does
app:rate_protection:max_requests10000Requests a client may send in the window. 0 refuses every request: it does not turn the limiter off. To exempt clients, use the skip lists
app:rate_protection:time_window1Length of the window, in seconds. Below 1, one second
app:rate_protection:ip_skip_list[]IP addresses never limited, as exact addresses

Behind a reverse proxy, OpenCTI limits each client by the address in the proxy's X-Forwarded-For header only when it trusts the proxy. Loopback, link-local and private addresses are trusted.

GraphQL query limits

The rate limiter counts HTTP requests, but one GraphQL request can hold many operations. OpenCTI checks each GraphQL document before it runs it, with two protections.

The batching protection is always on. It limits how many times one request calls the same query or mutation through aliases, a way to guess passwords or overload the platform in a single HTTP request. The login mutation is always limited to one call.

KeyDefaultWhat it does
app:graphql:batching_protection:query_default2Calls of the same query in one request
app:graphql:batching_protection:query_subtypes4Calls of the subTypes query, which the interface sends several times
app:graphql:batching_protection:mutation_default1Calls of the same mutation in one request

The armor protection is off by default: app:graphql:armor_protection:disabled is true. Once on, it refuses a document that goes over one of its limits, and stops suggesting field names in the error of a wrong query: these suggestions help an attacker map the API.

KeyDefaultWhat it does
app:graphql:armor_protection:disabledtrueSet to false to turn the armor protection on
app:graphql:armor_protection:max_depth20Nesting depth of a document
app:graphql:armor_protection:max_directives20Directives in a document
app:graphql:armor_protection:max_tokens100000GraphQL tokens in a document
app:graphql:armor_protection:cost_limit50000000Computed cost of a document
app:graphql:armor_protection:block_field_suggestiontrueHides the field suggestions

In this version, app:graphql:armor_protection:cost_limit defaults to 3000000.

Turn it on in a staging platform first, and check that the screens and the integrations you use still work: a limit set too low refuses their queries.

- APP__GRAPHQL__ARMOR_PROTECTION__DISABLED=false
- APP__GRAPHQL__ARMOR_PROTECTION__MAX_DEPTH=20
- APP__GRAPHQL__ARMOR_PROTECTION__BLOCK_FIELD_SUGGESTION=true

Requests and uploads

app:request_timeout closes a connection that stays idle this many milliseconds. The default, 1200000, is 20 minutes. Keep the timeout of your reverse proxy consistent with it, or long requests fail at the proxy first.

This version does not limit the size or the number of uploaded files: limit the size of request bodies on your reverse proxy.

Encryption key

OpenCTI derives its encryption keys from app:encryption_key (APP__ENCRYPTION_KEY): 32 bytes or more, in base64, generated with openssl rand -base64 32. They protect the secrets it stores in its database, such as those of the authentication providers and of the managed connectors. OpenCTI does not start without it, and cannot read these secrets with another key: keep it in your secret store with the backups.

app:crypto:master_seed (APP__CRYPTO__MASTER_SEED) is the former name of this key, read only when app:encryption_key is not set. If your configuration still uses it, move its value to app:encryption_key.

HTTPS served by OpenCTI

Behind a reverse proxy, OpenCTI does not need certificates. When it serves HTTPS itself, as Serve HTTPS from a platform describes, three more keys apply. app:https_cert:passphrase decrypts an encrypted private key. With certificate authentication turned on, OpenCTI asks clients for a certificate, checks it against the authorities listed in app:https_cert:ca, paths or PEM contents, and refuses a client whose certificate does not match while app:https_cert:reject_unauthorized is true, the default.

Sessions

app:session_timeout ends a session after this many milliseconds. The default, 1200000, is 20 minutes: set it to what your security policy requires. See Cookies.

Public dashboards

By default, no other website can embed a public dashboard. To allow some, list them in app:public_dashboard_authorized_domains, as the sources of a Content Security Policy frame-ancestors directive, separated by spaces, such as https://intranet.example.com. Leave it empty to keep embedding forbidden.

In 7.260811 LTS: Insecure HTTP resources

Logs

KeyDefaultWhat it does
app:app_logs:logs_redacted_inputspassword, secret, token, api_tokens, authentication_value, enterprise_licenseGraphQL input fields whose value is hidden in the logs. Add the fields of your own sensitive data, and keep the default ones
app:audit_logs:trace_request_headersuser-agent, x-forwarded-forHTTP headers written to the audit logs with each event
app:app_logs:extended_error_messagefalseAdds the input data to error logs, and the GraphQL query and its variables to the logs of API calls. Keep it false: the logs would then hold sensitive data
app:performance_loggerfalseLogs every API call with its duration and size. Keep it false outside a performance analysis: it writes a lot of logs

See Troubleshoot the XTM stack for the other log settings.

GraphQL playground

app:graphql:playground:enabled is true by default and serves the GraphQL playground of the API.

Set it to false if your users do not need it. Without the playground, the GraphQL schema reference still documents every query and mutation.

app:graphql:playground:force_disabled_introspection is true by default: OpenCTI refuses introspection queries, which return the whole schema, even with the playground on. Set it to false to let signed-in users introspect the API, as some GraphQL tools require. Without the playground, or with the interface turned off, introspection stays refused.

Artifact archives

OpenCTI stores potentially malicious files, the artifacts, in encrypted ZIP archives. The password of these archives is app:artifact_zip_password, infected by default, the usual value for malware samples. Change it if your policy requires another one.

What's next

NextManage Elasticsearch indices
Deploy
Install, configure, secure, scale and upgrade the platform.

Published

Overview
Run the XTM platform locally
OverviewDeploy with an AI agent