Home

Awesome

Hive4go

Hive4go is a unofficial Golang API client for TheHive.

Based on https://github.com/CERT-BDF/TheHive4py

This is made based on my own needs, and might be missing some specific functionality. Create an issue if you want it to support missing functions.

Install

go get github.com/frikky/hive4go
import "github.com/frikky/hive4go"

Create case example

Set logindata, used for any interactive APIcall

verifyCert := false
login := thehive.CreateLogin("ip", "apikey", verifyCert)

Create case example

TLP, Severity := 3
flag := true
resp, err := login.CreateCase(
	"hive4go title", 						
	"hive4go desc", 						
	TLP, 									
	Severity, 								
	[]thehive.CaseTask{{Title: "task"}}, 	
	[]string{"tags"},						
	flag,									
)

This will return a case with the following structure.

type HiveCase struct {
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Tlp         int        `json:"tlp"`
	Severity    int        `json:"severity"`
	Tags        []string   `json:"tags"`
	Tasks       []CaseTask `json:"tasks"`
	Flag        bool       `json:"flag"`
	Raw         []byte     `json:"-"`
}

All return types (alerts, artifacts etc.) follow this type. If you want to handle it as raw json, use response.Raw.

In the works