Go4th is a Golang port of TheHive4py
Branch: dev
Clone or download
Latest commit 4db7b99 Feb 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
testData Added artifact model. Added Artifact Test Jan 30, 2019
.gitignore WIP Jan 27, 2019
.travis.yml Updated trvis to register coverage Feb 6, 2019
LICENSE Initial commit Jan 26, 2019
README.md Added coverage badge Feb 6, 2019
alerts.go
alerts_test.go Added more functions to set values in alets Feb 5, 2019
artifacts.go Added more endpoints Feb 2, 2019
artifacts_test.go Added more functions to set values in alets Feb 5, 2019
case.go Added more endpoints Feb 2, 2019
case_test.go added trustedSSL when creting a new API Feb 2, 2019
customfield.go Added more endpoints Feb 2, 2019
go.mod Added more endpoints Feb 2, 2019
go.sum Added more endpoints Feb 2, 2019
go4th.go Added more functions to set values in alets Feb 5, 2019
go4th_test.go Added Case API (not finished). Updated README. Improve and update test Jan 31, 2019
helpers.go Added more endpoints Feb 2, 2019
query.go Added more endpoints Feb 2, 2019
query_test.go Added more endpoints Feb 2, 2019
tasks.go Added more endpoints Feb 2, 2019

README.md

Go for The Hive


Go for The Hive is a Golang port of TheHive4py. This is an API client to communicate with TheHive.

Installation

go get github.com/Xumeiquer/go4th

Usage

Go 4 TheHive exposes the whole API through an API object.

package main

import (
  "os"

  "github.com/Xumeiquer/go4th"
)

var (
  thehive = "http://127.0.0.1:9000"
  apiKey  = "apiKey"
  trustSSL = true
)

func main() {
  api := go4th.NewAPI(thehive, apiKey, trustSSL)

  alerts, err := api.GetAlerts()
  if err != nil {
    fmt.Println("error while getting alerts")
    os.Exit(1)
  }

  for _, alert := range alerts {
    fmt.Printf("Got Alert %s with title %s\n", alert.ID, alert.Title)
  }
}

API implementation

Alert

  • List alerts
  • Find alerts
  • Update alerts in bulk
  • Compute stats on alerts
  • Create an alert
  • Get an alert
  • Update an alert
  • Delete an alert
  • Mark an alert as read
  • Mark an alert as unread
  • Create a case from an alert
  • Follow an alert
  • Unfollow an alert
  • Merge an alert in a case

Case

  • List cases
  • Find cases
  • Update cases in bulk
  • Compute stats on cases
  • Create a case
  • Get a case
  • Update a case
  • Remove a case
  • Get list of cases linked to this case
  • Merge two cases

Obervable

  • Find observables
  • Compute stats on observables
  • Create an observable
  • Get an observable
  • Remove an observable
  • Update an observable
  • Get list of similar observables
  • Update observables in bulk

Task

  • Find tasks in a case (deprecated)
  • Find tasks
  • Compute stats on tasks
  • Get a task
  • Update a task
  • Create a task

Log

  • Get logs of the task
  • Find logs in specified task
  • Find logs
  • Create a log
  • Update a log
  • Remove a log
  • Get a log

User

  • Logout
  • User login
  • Get current user
  • Find user
  • Create a user
  • Get a user
  • Delete a user
  • Update user details
  • Set password
  • Change password