Skip to content

MISP: align Report created/published timestamps with event publication time#6489

Closed
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-timestamp-issue
Closed

MISP: align Report created/published timestamps with event publication time#6489
Copilot wants to merge 3 commits into
masterfrom
copilot/fix-timestamp-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

MISP-ingested reports could show an OpenCTI "original creation date" earlier than the source report publication. This came from deriving report creation metadata from Event.date instead of the actual publication timestamp.

  • Timestamp source correction (Report metadata)

    • Updated EventConverter.create_report() to prefer Event.publish_timestamp for Report.created and Report.published when available (> 0).
    • This aligns OpenCTI report creation metadata with MISP event publication time.
  • Safe fallback behavior

    • When publish_timestamp is missing/zero, fallback remains Event.date.
    • Fallback now handles both naive and timezone-aware ISO dates without losing timezone semantics.
  • Regression coverage

    • Added focused tests for:
      • publish-timestamp-first behavior
      • fallback-to-date behavior
      • preserving modified from Event.timestamp
if event.Event.publish_timestamp and int(event.Event.publish_timestamp) > 0:
    created_at = datetime.fromtimestamp(int(event.Event.publish_timestamp), tz=timezone.utc)
else:
    event_date = datetime.fromisoformat(event.Event.date)
    created_at = (
        event_date.astimezone(tz=timezone.utc)
        if event_date.tzinfo
        else event_date.replace(tzinfo=timezone.utc)
    )

Copilot AI linked an issue May 21, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 21, 2026 22:01
Copilot AI changed the title [WIP] Fix timestamp issue with MISP connector MISP: align Report created/published timestamps with event publication time May 21, 2026
Copilot AI requested a review from SamuelHassine May 21, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timestamp issue

2 participants