Skip to content

Xumeiquer/go4th

Repository files navigation

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 = "https://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) - Will not be implemented
  • 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

ko-fi

About

Go4th is a Golang port of TheHive4py

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages