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

Delete old data automatically

Delete old OpenCTI knowledge, import files, workbenches and logs automatically with retention policies, and check what a policy will delete first.

OpenCTIFor administrators and platform engineers

A retention policy deletes data that has not changed for a given time: old knowledge that matches your filters, imported files, workbenches, and, in recent versions, history and activity logs. It keeps the platform lean and enforces your data retention rules. This page shows how to set up a policy safely.

Warning

Retention deletes for good. What a policy deletes does not go to the trash and cannot be restored. Always click Verify to see how many elements a policy would delete before you save it.

Before you start

  • Your role has the Manage customization capability.
  • The retention manager is running. It is on by default (retention_manager:enabled in the configuration reference); when it is off, the page says so and no policy runs.

What a policy can delete

The Scope of a policy says what it deletes. The Apply on column of the list shows the filters of a knowledge policy, or what a policy without filters covers: Everything for a knowledge policy, Global files (the Files contained in Data/Import), All workbenches, Knowledge history logs or Activity logs.

Warning

A knowledge policy that reads Everything has no filters: it deletes every entity and relationship of the platform, reports included, that has not been updated for its maximum retention. Check the Apply on column of every knowledge policy.

ScopeDeletesFilters
KnowledgeEntities and relationships that match the filters and have not been updated for the maximum retentionYes
FileFiles in Data, then Import uploaded longer ago than the maximum retention, once their upload and every import from them are completeNo
WorkbenchWorkbenches not updated for the maximum retention, global ones and those attached to an entityNo

Two policies come with the platform and run from the start: Global files retention and All workbenches retention, both set to 30 days. Change their duration if you keep imported files or workbenches longer.

The retention manager never deletes an individual that stands for a user, the platform main organization, or an organization that still has members or administrators: such objects are skipped and drop out of the Remaining count.

Create a knowledge policy

  1. Open Settings, then Customization, then Retention policies and click Create Retention Policy. The Create a retention policy panel opens.

  2. Give the policy a Name that says what it deletes, for example "Indicators older than a year".

  3. Choose the Unit (minutes, hours or days) and the Maximum retention: an object not updated for that long is deleted. The default is 31 days.

  4. Add filters to target the objects to delete, for example an entity type and a label. Without filters, the policy applies to every entity and relationship of the platform and reads Everything in the list.

  5. Click Verify. A message tells you how many elements the policy would delete now.

  6. Adjust the filters until the count is what you expect, then click Create. Create stays disabled until you verify.

    OpenCTI 7.260309.0-lts.8
OpenCTI 7.260309.0-lts.8
ExamplePurge scanner indicators after a year

The Example Scanner Feed creates thousands of indicators a week, all labelled scanner. Decay revokes them within days, but revoked indicators still fill the search engine. Example CERT keeps them one year for investigations, then deletes them. Every other indicator, and every report, stays.

  • Name: Scanner indicators older than a year
  • Unit: days
  • Maximum retention: 365
  • Filters, combined with AND:
Entity type = Indicator
AND Label = scanner

Click Verify before Create: the message counts the scanner indicators not updated for a year. Compare it with the number of indicators labelled scanner in Observations, then Indicators: a count above it means a filter is missing. Once created, the policy deletes in batches at each run, and the Remaining column falls to 0. An indicator that the feed sends again is updated, which restarts its year.

Activate, pause or change a policy

Open the menu of a policy in the list:

  • Update changes its name, duration and filters. Click Verify again before Update, which stays disabled until you do.
  • Delete removes the policy.

The list shows, for each policy, the Last execution and the Remaining count of elements still to delete. The retention manager deletes in batches, so a policy that matches many elements catches up over several runs.

Tune the retention manager

The retention manager runs on one node of a cluster at a time. At each run, it takes every active policy in turn and deletes up to one batch of what the policy matches.

KeyEnvironment variableDefaultEffect
retention_manager:enabledRETENTION_MANAGER__ENABLEDtrueTurns the retention manager on or off. Off, no policy runs
retention_manager:intervalRETENTION_MANAGER__INTERVAL30000Pause between the end of a run and the start of the next, in milliseconds
retention_manager:batch_sizeRETENTION_MANAGER__BATCH_SIZE1500Maximum number of elements one policy deletes in one run
retention_manager:max_deletion_concurrencyRETENTION_MANAGER__MAX_DELETION_CONCURRENCY2Number of elements deleted in parallel

A new policy on a large knowledge base can match millions of elements: with the defaults, it deletes at most 1,500 elements per run, with a 30-second pause between runs, so fewer than 180,000 an hour. Raise batch_size or max_deletion_concurrency to catch up faster, at the cost of more load on the search engine. The Remaining column shows how much is left.

What's next

NextOverview
OpenCTI
Cyber threat intelligence as a knowledge graph: ingest, analyze, automate, share.

Published

Overview