Prevent silent API drift against MISP core

オープン
#1,522 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
api

調査の方向性

Read pymisp/api.py around fetch_all_feeds() and compare its HTTP method with the upstream MISP endpoint change described in the issue. Then review tests/test_api.py and the existing CI workflow to assess the proposed contract checks and offline coverage. Done means PyMISP has a maintainable automated guard that catches API method or path drift; the issue leaves the choice of safeguard open.

索引モデルが issue の本文から書いたものです。

説明

Summary

PyMISP.fetch_all_feeds() (feeds/fetchFromAllFeeds) remained on GET after MISP/MISP commit 50106c9a01 (2026-08-25, shipped in MISP v2.5.46 on 2026-09-10) restricted fetchFromFeed, fetchFromAllFeeds, cacheFeeds, enable, and disable to POST via $this->request->allowMethod(['post']).

How this drift occurred:

  1. I added fetch_all_feeds() to PyMISP on 2026-07-24 (PR #1460, 0097c78) using GET, matching the adjacent feed methods at the time.
  2. On 2026-09-02, commit d91f77f (chg: [http method] changed for multiple endpoints) updated fetch_feed, cache_*_feeds, server_pull, and server_push to POST, but accidentally skipped fetch_all_feeds right between fetch_feed and cache_all_feeds.
  3. In tests/testlive_comprehensive.py (test_feeds), fetch_all_feeds() (and fetch_feed()) are commented out to avoid pulling full external OSINT feeds during live CI runs, and there were no offline unit tests asserting HTTP methods for feed endpoints. Consequently, the HTTP 405 Method Not Allowed error went undetected in CI.
Why this is a reliability problem

PyMISP is the primary programmatic interface for MISP automation—used in cron jobs, SOAR integrations, and threat-intelligence ingestion pipelines.

  • Broken methods ship undetected: Any endpoint in pymisp/api.py that cannot be safely exercised in testlive_comprehensive.py (destructive operations, heavy bulk fetches, sync triggers) currently has no automated guard against upstream MISP changes.
  • Unpredictable compatibility across MISP versions: Users upgrading MISP (e.g. to 2.5.46+) experience sudden failures in official PyMISP methods even when running the latest PyMISP release.
  • High maintenance burden: Auditing pymisp/api.py manually against MISP/MISP commits after each MISP release is error-prone and unsustainable as both codebases evolve (including MISP 2.5 and 3.0).
Proposed long-term directions

Rather than only fixing individual drifted endpoints reactively, PyMISP would benefit from structural safeguards:

  1. Automated API contract check in CI: Validate the (HTTP method, endpoint path) pairs used in pymisp/api.py against MISP's OpenAPI specification (or a controller-derived manifest generated by MISP/MISP) so any mismatch fails CI automatically.
  2. Offline unit test coverage for non-live-testable endpoints: Expand tests/test_api.py to assert HTTP verbs, URL paths, and payload shapes for endpoints that are intentionally skipped or commented out in tests/testlive_comprehensive.py (such as fetch_all_feeds, fetch_feed, sync triggers, and destructive admin actions).
  3. Scheduled drift check against MISP develop / latest release: Run a periodic workflow comparing PyMISP's implemented endpoints against upstream MISP so breaking changes are caught before a MISP release ships rather than months afterward.

Related MISP issue: MISP/MISP#11325

主要言語
Python
スター
496
フォーク
292
平均マージ
2日 23時間
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MISP/PyMISP のほかの issue

MISP/PyMISP の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。