hunts

package
v0.20241209.1115630 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2023-12-01-preview/hunts Documentation

The hunts SDK allows for interaction with Azure Resource Manager securityinsights (API Version 2023-12-01-preview).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2023-12-01-preview/hunts"

Client Initialization

client := hunts.NewHuntsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: HuntsClient.CreateOrUpdate

ctx := context.TODO()
id := hunts.NewHuntID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "huntId")

payload := hunts.Hunt{
	// ...
}


read, err := client.CreateOrUpdate(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: HuntsClient.Delete

ctx := context.TODO()
id := hunts.NewHuntID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "huntId")

read, err := client.Delete(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: HuntsClient.Get

ctx := context.TODO()
id := hunts.NewHuntID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName", "huntId")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: HuntsClient.List

ctx := context.TODO()
id := hunts.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceName")

// alternatively `client.List(ctx, id, hunts.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, hunts.DefaultListOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForAttackTactic

func PossibleValuesForAttackTactic() []string

func PossibleValuesForHypothesisStatus

func PossibleValuesForHypothesisStatus() []string

func PossibleValuesForOwnerType

func PossibleValuesForOwnerType() []string

func PossibleValuesForStatus

func PossibleValuesForStatus() []string

func ValidateHuntID

func ValidateHuntID(input interface{}, key string) (warnings []string, errors []error)

ValidateHuntID checks that 'input' can be parsed as a Hunt ID

func ValidateWorkspaceID

func ValidateWorkspaceID(input interface{}, key string) (warnings []string, errors []error)

ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID

Types

type AttackTactic

type AttackTactic string
const (
	AttackTacticCollection              AttackTactic = "Collection"
	AttackTacticCommandAndControl       AttackTactic = "CommandAndControl"
	AttackTacticCredentialAccess        AttackTactic = "CredentialAccess"
	AttackTacticDefenseEvasion          AttackTactic = "DefenseEvasion"
	AttackTacticDiscovery               AttackTactic = "Discovery"
	AttackTacticExecution               AttackTactic = "Execution"
	AttackTacticExfiltration            AttackTactic = "Exfiltration"
	AttackTacticImpact                  AttackTactic = "Impact"
	AttackTacticImpairProcessControl    AttackTactic = "ImpairProcessControl"
	AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction"
	AttackTacticInitialAccess           AttackTactic = "InitialAccess"
	AttackTacticLateralMovement         AttackTactic = "LateralMovement"
	AttackTacticPersistence             AttackTactic = "Persistence"
	AttackTacticPreAttack               AttackTactic = "PreAttack"
	AttackTacticPrivilegeEscalation     AttackTactic = "PrivilegeEscalation"
	AttackTacticReconnaissance          AttackTactic = "Reconnaissance"
	AttackTacticResourceDevelopment     AttackTactic = "ResourceDevelopment"
)

func (*AttackTactic) UnmarshalJSON

func (s *AttackTactic) UnmarshalJSON(bytes []byte) error

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Hunt
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Hunt
}

type Hunt

type Hunt struct {
	Etag       *string                `json:"etag,omitempty"`
	Id         *string                `json:"id,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties *HuntProperties        `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type HuntId

type HuntId struct {
	SubscriptionId    string
	ResourceGroupName string
	WorkspaceName     string
	HuntId            string
}

HuntId is a struct representing the Resource ID for a Hunt

func NewHuntID

func NewHuntID(subscriptionId string, resourceGroupName string, workspaceName string, huntId string) HuntId

NewHuntID returns a new HuntId struct

func ParseHuntID

func ParseHuntID(input string) (*HuntId, error)

ParseHuntID parses 'input' into a HuntId

func ParseHuntIDInsensitively

func ParseHuntIDInsensitively(input string) (*HuntId, error)

ParseHuntIDInsensitively parses 'input' case-insensitively into a HuntId note: this method should only be used for API response data and not user input

func (*HuntId) FromParseResult

func (id *HuntId) FromParseResult(input resourceids.ParseResult) error

func (HuntId) ID

func (id HuntId) ID() string

ID returns the formatted Hunt ID

func (HuntId) Segments

func (id HuntId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Hunt ID

func (HuntId) String

func (id HuntId) String() string

String returns a human-readable description of this Hunt ID

type HuntOperationPredicate

type HuntOperationPredicate struct {
	Etag *string
	Id   *string
	Name *string
	Type *string
}

func (HuntOperationPredicate) Matches

func (p HuntOperationPredicate) Matches(input Hunt) bool

type HuntOwner

type HuntOwner struct {
	AssignedTo        *string    `json:"assignedTo,omitempty"`
	Email             *string    `json:"email,omitempty"`
	ObjectId          *string    `json:"objectId,omitempty"`
	OwnerType         *OwnerType `json:"ownerType,omitempty"`
	UserPrincipalName *string    `json:"userPrincipalName,omitempty"`
}

type HuntProperties

type HuntProperties struct {
	AttackTactics    *[]AttackTactic   `json:"attackTactics,omitempty"`
	AttackTechniques *[]string         `json:"attackTechniques,omitempty"`
	Description      string            `json:"description"`
	DisplayName      string            `json:"displayName"`
	HypothesisStatus *HypothesisStatus `json:"hypothesisStatus,omitempty"`
	Labels           *[]string         `json:"labels,omitempty"`
	Owner            *HuntOwner        `json:"owner,omitempty"`
	Status           *Status           `json:"status,omitempty"`
}

type HuntsClient

type HuntsClient struct {
	Client *resourcemanager.Client
}

func NewHuntsClientWithBaseURI

func NewHuntsClientWithBaseURI(sdkApi sdkEnv.Api) (*HuntsClient, error)

func (HuntsClient) CreateOrUpdate

func (c HuntsClient) CreateOrUpdate(ctx context.Context, id HuntId, input Hunt) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (HuntsClient) Delete

func (c HuntsClient) Delete(ctx context.Context, id HuntId) (result DeleteOperationResponse, err error)

Delete ...

func (HuntsClient) Get

func (c HuntsClient) Get(ctx context.Context, id HuntId) (result GetOperationResponse, err error)

Get ...

func (HuntsClient) List

List ...

func (HuntsClient) ListComplete

ListComplete retrieves all the results into a single object

func (HuntsClient) ListCompleteMatchingPredicate

func (c HuntsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate HuntOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type HypothesisStatus

type HypothesisStatus string
const (
	HypothesisStatusInvalidated HypothesisStatus = "Invalidated"
	HypothesisStatusUnknown     HypothesisStatus = "Unknown"
	HypothesisStatusValidated   HypothesisStatus = "Validated"
)

func (*HypothesisStatus) UnmarshalJSON

func (s *HypothesisStatus) UnmarshalJSON(bytes []byte) error

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Hunt
}

type ListCustomPager

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationOptions

type ListOperationOptions struct {
	Filter  *string
	Orderby *string
	Top     *int64
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Hunt
}

type OwnerType

type OwnerType string
const (
	OwnerTypeGroup   OwnerType = "Group"
	OwnerTypeUnknown OwnerType = "Unknown"
	OwnerTypeUser    OwnerType = "User"
)

func (*OwnerType) UnmarshalJSON

func (s *OwnerType) UnmarshalJSON(bytes []byte) error

type Status

type Status string
const (
	StatusActive   Status = "Active"
	StatusApproved Status = "Approved"
	StatusBacklog  Status = "Backlog"
	StatusClosed   Status = "Closed"
	StatusNew      Status = "New"
)

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(bytes []byte) error

type WorkspaceId

type WorkspaceId struct {
	SubscriptionId    string
	ResourceGroupName string
	WorkspaceName     string
}

WorkspaceId is a struct representing the Resource ID for a Workspace

func NewWorkspaceID

func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId

NewWorkspaceID returns a new WorkspaceId struct

func ParseWorkspaceID

func ParseWorkspaceID(input string) (*WorkspaceId, error)

ParseWorkspaceID parses 'input' into a WorkspaceId

func ParseWorkspaceIDInsensitively

func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error)

ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId note: this method should only be used for API response data and not user input

func (*WorkspaceId) FromParseResult

func (id *WorkspaceId) FromParseResult(input resourceids.ParseResult) error

func (WorkspaceId) ID

func (id WorkspaceId) ID() string

ID returns the formatted Workspace ID

func (WorkspaceId) Segments

func (id WorkspaceId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Workspace ID

func (WorkspaceId) String

func (id WorkspaceId) String() string

String returns a human-readable description of this Workspace ID

Jump to

Keyboard shortcuts

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