intel

package
v0.0.0-...-0f8d102 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package intel provides a client to interact with the Intel API.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAssetDoesNotExist is returned by the [Client] when there is no info
	// about the asset in the Security Graph.
	ErrAssetDoesNotExist = errors.New("asset does not exist in the Security Graph")
)

Functions

This section is empty.

Types

type BlastRadiusRequest

type BlastRadiusRequest struct {
	AssetIdentifier string `json:"asset_identifier" validate:"required" urlquery:"asset_identifier"`
	AssetType       string `json:"asset_type" validate:"required" urlquery:"asset_type"`
}

BlastRadiusRequest defines the parameters required by the blast radius endpoint.

type BlastRadiusResponse

type BlastRadiusResponse struct {
	// Score contains the blast radius score for a given asset.
	Score float64 `json:"score"`
	// Metadata contains information about how a blast radius was calculated.
	Metadata string `json:"metadata"`
}

BlastRadiusResponse defines the output of a blast radius calculation.

type Client

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

Client allows to communicates with Intel API exposed by the Security Graph.

func NewClient

func NewClient(baseURL string, insecure bool) (*Client, error)

NewClient returns an Client that uses the given config parameters.

func (*Client) BlastRadius

func (i *Client) BlastRadius(req BlastRadiusRequest) (BlastRadiusResponse, error)

BlastRadius calls the blast radius endpoint of the Intel API using the given parameters.

type Config

type Config struct {
	IntelAPI    string `mapstructure:"intel_api"`
	InsecureTLS string `mapstructure:"insecure_tls"`
}

Config defines the config parameters needed by an [IntelAPIClient].

type HTTPStatusError

type HTTPStatusError struct {
	Status int    `json:"-"`
	Msg    string `json:"msg"`
}

HTTPStatusError is returned by the method [IntelAPIClient.BlastRadius] when it receives a response with a status code different to 200.

func (HTTPStatusError) Error

func (h HTTPStatusError) Error() string

Jump to

Keyboard shortcuts

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