Environment:7onez Cti expert MISP API
| Knowledge Sources | |
|---|---|
| Domains | OSINT, Threat_Intel_Sharing |
| Last Updated | 2026-10-28 14:00 GMT |
Overview
Environment with `MISP_URL` and `MISP_KEY` credentials for two-step gated MISP event push and publish via the IntelShare client.
Description
This environment provides the credentials for the IntelShare MISP client (`sh_misp.py`). The client implements a two-step dissemination workflow: Push (stage — reversible: creates the event as unpublished on the MISP instance) and Publish (irreversible: publishes the event for sharing). Both steps are gated behind analyst confirmation and the `hooks/actionguard.py` PreToolUse hook. The export builder (`sh_export.py`) constructs the MISP event from the case KB offline, then `sh_misp.py` handles the network interaction. The MISP auth key is sent as the `Authorization` header.
= Usage
Use this environment for MISP event dissemination — pushing and publishing case findings to a MISP threat-intel platform. It is the mandatory prerequisite for `SH_Misp_Push` and `SH_Misp_Publish`. Without these credentials, the export builder still produces the MISP event JSON offline (the `sh_export.py` path), but network push/publish is skipped.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Any (stdlib Python) | Same as Python_Stdlib |
| Hardware | Any CPU | API calls only |
| Disk | Negligible | API responses stored in case data |
Dependencies
System Packages
- `python3` >= 3.10
Python Packages
None beyond the stdlib (uses urllib for API calls).
Credentials
The following environment variables must be set in `.env` (chmod 600):
- `MISP_URL`: Base URL of the MISP instance (e.g. `https://misp.your-org.example`). Alias: `MISP_BASE_URL`.
- `MISP_KEY`: MISP API authentication key. Aliases: `MISP_API_KEY`, `MISP_AUTHKEY`.
- `MISP_VERIFY_TLS` (optional): Controls TLS certificate verification (default: verify).
- `MISP_ORG` (optional): Organisation name for the User-Agent header.
- `MISP_USER_AGENT` (optional): Custom User-Agent string.
Quick Install
printf 'MISP_URL=https://misp.your-org.example\nMISP_KEY=<your API key>\n' >> .env && chmod 600 .env
Code Evidence
URL and key resolution, from `intel_engine/IntelShare/tools/sh_misp.py:102-106`:
return (_secret("MISP_URL", "MISP_BASE_URL") or "").rstrip("/")
...
return _secret("MISP_KEY", "MISP_API_KEY", "MISP_AUTHKEY") or ""
Setup hint on missing credentials, from `intel_engine/IntelShare/tools/sh_misp.py:213`:
out["how"] = ("export MISP_URL=https://misp.your-org.example and MISP_KEY=<your API key> "
TLS verification control, from `intel_engine/IntelShare/tools/sh_misp.py:116`:
v = (os.environ.get("MISP_VERIFY_TLS") or "").strip().lower()
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `403 Forbidden` | Invalid or expired API key | Regenerate the key in MISP UI; update `MISP_KEY` in `.env` |
| `Connection refused` | MISP_URL wrong or unreachable | Verify the URL; check network/proxy; set `MISP_VERIFY_TLS=0` only for self-signed certs |
| Push succeeds, publish fails | Key lacks publish permission | Grant `perm_publish` to the API key's role in MISP |
Compatibility Notes
- Two-step dissemination: Push (stage) is reversible — the event exists but is unpublished. Publish is irreversible. Both are gated by analyst confirmation and the `actionguard.py` hook.
- Offline export without credentials: `sh_export.py` builds the MISP event JSON from the case KB with no network — only push/publish require the API.
- TLS verification: On by default. Set `MISP_VERIFY_TLS=0` only for self-signed certificates in trusted environments.