otx

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

otx

AlienVault OTX (Open Threat Exchange) threat-intelligence lookups for the gollem LLM agent framework.

github.com/gollem-dev/tools/otx

Tools

Name Description
otx_ipv4 Search IPv4 indicator from OTX.
otx_ipv6 Search IPv6 indicator from OTX.
otx_domain Search domain indicator from OTX.
otx_hostname Search hostname indicator from OTX.
otx_file_hash Search file hash indicator from OTX.

Usage

ts, err := otx.New("your-api-key")
if err != nil {
	return err
}
if err := ts.Ping(ctx); err != nil { // optional preflight
	return err
}

Options

Option Default
WithBaseURL(string) https://otx.alienvault.com/api/v1
WithHTTPClient(*http.Client) http.DefaultClient
WithLogger(*slog.Logger) slog.Default()

Testing

Mock tests run unconditionally. The live-service test runs only when TEST_OTX_API_KEY is set:

TEST_OTX_API_KEY=... go test ./...

Documentation

Overview

Package otx provides a gollem.ToolSet for AlienVault OTX threat intelligence lookups (IPv4/IPv6/domain/hostname/file hash).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*ToolSet)

Option configures a ToolSet.

func WithBaseURL

func WithBaseURL(baseURL string) Option

WithBaseURL overrides the OTX API base URL.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient overrides the HTTP client used for requests.

func WithLogger

func WithLogger(logger *slog.Logger) Option

WithLogger sets the logger. A nil logger keeps the default (slog.Default()).

type ToolSet

type ToolSet struct {
	// contains filtered or unexported fields
}

ToolSet implements gollem.ToolSet for AlienVault OTX. Fields are unexported; configure via Option.

func New

func New(apiKey string, opts ...Option) (*ToolSet, error)

New constructs the ToolSet. apiKey is required; pass optional configuration via opts. It only validates static configuration — use Ping to verify connectivity and credentials.

func (*ToolSet) Ping

func (t *ToolSet) Ping(ctx context.Context) error

Ping verifies connectivity and credentials by querying a well-known IPv4 indicator.

func (*ToolSet) Run

func (t *ToolSet) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)

Run executes the named OTX lookup.

func (*ToolSet) Specs

func (t *ToolSet) Specs(ctx context.Context) ([]gollem.ToolSpec, error)

Specs returns the OTX tool specifications.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL