Skip to content

fix(compose): run the connectors with service accounts (#624) - #623

Merged
Archidoit merged 4 commits into
masterfrom
fix/connectors-service-accounts
Nov 24, 2026
Merged

Archidoit merged 4 commits into
masterfrom
fix/connectors-service-accounts

Conversation

@Archidoit

@Archidoit Archidoit commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Proposed changes

  • Since the User is not a service account ingestion health check, the connectors running with the admin token show as Degraded.
  • Import and analysis connectors (import-file-stix, import-document, import-file-yara, analysis, import-external-reference): add CONNECTOR_AUTO_CREATE_SERVICE_ACCOUNT=true, with CONNECTOR_AUTO_CREATE_SERVICE_ACCOUNT_CONFIDENCE_LEVEL=100 (the confidence they had with the admin token). Each connector creates its own [C] <name> service account in the Connectors group at start-up, then runs with it: fixed out of the box.
  • Export connectors (export-file-stix, export-file-csv, export-file-txt): they impersonate the user requesting the export, which needs the "Bypass all capabilities" capability that the Connectors group lacks, so their service account cannot be created automatically. They now read CONNECTOR_EXPORT_FILE_*_TOKEN, the token of a service account in a group with that capability (such as Administrators), and fall back to the admin token when it is not set.
  • Same changes in docker-compose.yml and docker-compose.opensearch.yml.
  • .env.sample documents the three new variables, how to create the accounts, and the dependency on the Connectors group.
  • Same change as fix(compose): run the OpenCTI connectors with service accounts (#73) FiligranHQ/xtm-docker#74.

Related issue

closes #624

Since the "User is not a service account" ingestion health check, the
connectors running with the admin token show as degraded.

- Import and analysis connectors create their own service account
  (CONNECTOR_AUTO_CREATE_SERVICE_ACCOUNT=true).
- Export connectors impersonate the user requesting the export and need
  a service account with bypass: they take a dedicated token
  (CONNECTOR_EXPORT_FILE_*_TOKEN), and fall back to the admin token
  when it is not set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 10:04
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Nov 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The runtime authorization change requires validation against deployed connector images, but the checkout lacks connector implementations and an integration harness to verify import and analysis permissions, confidence ceilings, and export impersonation.

No open issues 🎉

What changed in this PR

Updates both Compose deployments to support connector service accounts, addressing degraded ingestion health checks caused by using the admin account.

Changes:

  • Enables automatic service-account creation for five import and analysis connectors.
  • Adds dedicated token settings for STIX, CSV, and TXT export connectors, retaining the admin-token fallback.
  • Documents export service-account setup and required bypass permissions.
File Description
docker-compose.yml Configures service-account creation and export-token overrides.
docker-compose.opensearch.yml Applies the same connector settings to the OpenSearch deployment.
.env.sample Adds three export-token variables and account-setup instructions.

Review effort: Balanced

@Archidoit Archidoit self-assigned this Nov 23, 2026
@Archidoit Archidoit changed the title fix(compose): run the connectors with service accounts fix(compose): run the connectors with service accounts (#624) Nov 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't aware of this export connector specificity. Thanks :)

…nectors

The import and analysis connectors create their own service account,
with the pycti default max_confidence of 50 when the level is not set.
They ran with the admin token before, so at 100: set 100 explicitly,
as connector-opencti does.

The level applies when no user asks for the work, such as enrichment
(ImportExternalReference) and analysis (ImportDocumentAnalysis): a file
import started by a user still runs with that user's confidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Archidoit

Copy link
Copy Markdown
Member Author

Fixed in 1625857: the five connectors now set CONNECTOR_AUTO_CREATE_SERVICE_ACCOUNT_CONFIDENCE_LEVEL=100, which keeps the confidence they had with the admin token, as connector-opencti does.
The level only applies when no user asks for the work. A file import sends the requesting user as applicant (file-storage.ts), and the worker writes the bundle as that user, with that user's confidence. Enrichment and analysis send no applicant (stixCoreObject.js), so ImportExternalReference and ImportDocumentAnalysis write with the service account's confidence. At 50, they could no longer update entities above 50.

pycti creates the service account of a connector only when a group named
exactly "Connectors" exists. When it was renamed or deleted, the connector
silently keeps OPENCTI_ADMIN_TOKEN and its ingestion health shows "User is
not a service account" again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Archidoit
Archidoit merged commit 651e5ee into master Nov 24, 2026
5 checks passed
@Archidoit
Archidoit deleted the fix/connectors-service-accounts branch November 24, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(compose): connectors run with the admin token and show as degraded

3 participants