Skip to content

AtlasInsideCorp/UTMStackCloudWazuhApi

 
 

Repository files navigation

Wazuh API in Go

Build Status


Wazuh REST API library

https://documentation.wazuh.com/current/user-manual/api/reference.html

Install

$ go get -u github.com/AtlasInsideCorp/UTMStackCloudWazuhApi

Usage

package main

import (
	"flag"
	"fmt"
	"os"

	"github.com/AtlasInsideCorp/UTMStackCloudWazuhApi"
)

func main() {
	flag.Parse()
	args := flag.Args()

	endpoint := args[0]
	user := args[1]
	pass := args[2]

	client, err := wazuh.New(endpoint, wazuh.WithBasicAuth(user, pass))

	agents, err := client.GetAllAgents()
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	fmt.Printf("%-20v%-20v\n", "ID", "NAME")
	for _, agent := range *agents {
		if agent.Status == "Active" {
			fmt.Printf("%-20v%-20v\n", agent.ID, agent.Name)
		}
	}
}

see example

Contributing

You are more than welcome to contribute to this project.
Fork and make a Pull Request, or create an Issue if you see any problem.

About

Wazuh REST API in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.9%
  • Makefile 0.1%