Make a manual workflow repeatable
Start by testing one known query or write. An automation job should specify its filters, validate what was stored or returned, and tell you when results differ from expectations. Use these examples against the local lab.
Use a dedicated Auth key
Use a dedicated account with only the permissions its task needs. Add an expiry and source IP restrictions where supported, keep the key in a protected store, and revoke it when no longer required. Pass it in the Authorization header.
read -rs MISP_KEY && export MISP_KEY
curl -s -H "Authorization: $MISP_KEY" -H "Accept: application/json" \
http://localhost:18081/servers/getVersionConfirm the expected version. Keep the value out of source, saved shell commands, shared terminal logs, and output. Remove the shell variable with unset MISP_KEY after use.
Search Events and Attributes with restSearch
Use /events/restSearch when you need Event context and /attributes/restSearch when you need individual indicators. Explicit filters make the selection easier to reproduce.
curl -s -H "Authorization: $MISP_KEY" -H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"returnFormat":"text","type":"ip-dst","to_ids":1,"published":1,"last":"30d","enforceWarninglist":1}' \
http://localhost:18081/attributes/restSearchThis example asks for detection-marked destination IPs from published data within a relative time window, with Warninglist enforcement. Date and list settings can legitimately exclude the fixture. Compare both a known positive and a known excluded value before feeding an export to another system. Check the correct endpoint and output format in the official OpenAPI reference.
Query with PyMISP
The lab can run pymisp-check.py using the library inside the core container. This avoids installing a separate client on the host. The script checks a query, orders paginated results consistently, and records one Sighting per run.
docker compose exec -T misp-core python3 < pymisp-check.pyPASS PyMISP 3.0.0 connected: MISP 2.5.53
PASS get_event by UUID: SecTools Lab — 釣魚事件建模練習(虛構) (4 attributes, 1 object)
PASS search attributes(ip-dst, to_ids, published, tlp:clear): 2 hit(s)
PASS stable pagination (order=Event.id ASC): pages = [2, 2, 2, 0], no overlap
PASS sighting recorded on 192.0.2.10: total sightings = 1
Keep page size and sorting stable, and compare IDs across pages. If data changes mid-query, use a fixed window or account for overlap and gaps.
Check the response and the resulting state
| Signal | What to inspect |
|---|---|
| 401 or 403 | Auth key, account role, allowed IPs, expiry, and target organization. |
| 404 or empty output | Path, UUID, request scope, and filters. Visibility rules can hide records. |
| HTTP 200 with a failed write | Inspect application fields such as saved and errors. Read the object back. |
| 5xx or timeout | Inspect service health, workers, and logs. Check the original request’s outcome before retrying a write. |
Record the status, target endpoint, and fixture ID. Keep credentials out of diagnostic logs. Retry temporary failures with bounds and verify the eventual state.
Use stable UUIDs for repeatable writes
Give one logical observation one stable identity. Query the UUID before creating an Event or Object. After a retry, read back the target and confirm whether the desired state already exists. The lab’s repeated verification checks that rerunning the case leaves one Event and reuses the Object.
Your reading progress is saved in this browser.
This browser blocked storage. Reloading may clear this session’s progress.