Skip to content

Pre-hardening IOC identity writes before Event Injection (follow-up to Discussion #1236) #1240

@tanmayjoddar

Description

@tanmayjoddar

Following the discussion in #1236, I am opening this issue as an implementation tracker.

Context

  • Current deployment is mostly single-worker:
  • So current practical severity is relatively low.
  • However, this is a good point to harden IOC identity handling before Event Injection / multi-source ingestion.

Scope of this issue

  1. Add DB-level uniqueness for IOC identity (preferred key: ("name", "type")).
  2. Add migration/merge path for pre-existing duplicate IOC rows (if any).
  3. Make IOC write path concurrency-safe (e.g., atomic upsert or transaction-safe handling).
  4. Add a regression test covering concurrent writes for same IOC identity.

Why now

This keeps ingestion behavior stable as concurrency grows, without over-rotating severity for current single-worker topology.

Acceptance criteria

  • IOC identity uniqueness is enforced at DB level.
  • Duplicate IOC rows are merged safely during migration.
  • Concurrent writes do not create duplicate IOC identity rows.
  • Regression test added for concurrent same-key writes.

Related references

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpythonPull requests that update Python code

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions