shield

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attack

type Attack struct {
	AttackId       string
	ResourceArn    string
	StartTime      time.Time
	EndTime        *time.Time
	AttackVectors  []AttackVector
	AttackCounters []SummarizedCounter
	Mitigations    []Mitigation
}

Attack holds attack detail information.

type AttackStatistics

type AttackStatistics struct {
	FromInclusive time.Time
	ToExclusive   time.Time
	DataItems     []map[string]any
}

AttackStatistics holds aggregated attack statistics.

type AttackVector

type AttackVector struct {
	VectorType string
}

AttackVector describes a type of attack.

type DRTAccess

type DRTAccess struct {
	RoleArn       string
	LogBucketList []string
}

DRTAccess holds DRT (DDoS Response Team) access information.

type Limit

type Limit struct {
	Type string
	Max  int64
}

Limit holds a Shield limit.

type Mitigation

type Mitigation struct {
	MitigationName string
}

Mitigation describes a mitigation action.

type Protection

type Protection struct {
	Id                                        string
	Name                                      string
	ResourceArn                               string
	ProtectionArn                             string
	HealthCheckIds                            []string
	ApplicationLayerAutoResponseConfiguration map[string]any
	Tags                                      []Tag
}

Protection holds a Shield protection.

type ProtectionGroup

type ProtectionGroup struct {
	ProtectionGroupId  string
	Aggregation        string
	Pattern            string
	ResourceType       string
	Members            []string
	ProtectionGroupArn string
	Tags               []Tag
}

ProtectionGroup holds a protection group definition.

type ShieldService

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

ShieldService is the cloudmock implementation of the AWS Shield API.

func New

func New(accountID, region string) *ShieldService

New returns a new ShieldService for the given AWS account ID and region.

func (*ShieldService) Actions

func (s *ShieldService) Actions() []service.Action

Actions returns the list of Shield API actions supported by this service.

func (*ShieldService) HandleRequest

func (s *ShieldService) HandleRequest(ctx *service.RequestContext) (*service.Response, error)

HandleRequest routes an incoming Shield request to the appropriate handler.

func (*ShieldService) HealthCheck

func (s *ShieldService) HealthCheck() error

HealthCheck always returns nil.

func (*ShieldService) Name

func (s *ShieldService) Name() string

Name returns the AWS service name used for routing.

type Store

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

Store is the in-memory store for Shield resources.

func NewStore

func NewStore(accountID, region string) *Store

NewStore creates an empty Shield Store.

func (*Store) AssociateHealthCheck

func (s *Store) AssociateHealthCheck(protectionID, healthCheckArn string) *service.AWSError

AssociateHealthCheck associates a Route 53 health check with a protection.

func (*Store) CreateProtection

func (s *Store) CreateProtection(name, resourceArn string, tags []Tag) (*Protection, *service.AWSError)

CreateProtection creates a new protection.

func (*Store) CreateProtectionGroup

func (s *Store) CreateProtectionGroup(id, aggregation, pattern, resourceType string, members []string, tags []Tag) (*ProtectionGroup, *service.AWSError)

CreateProtectionGroup creates a new protection group.

func (*Store) CreateSubscription

func (s *Store) CreateSubscription() (*Subscription, *service.AWSError)

CreateSubscription creates a Shield Advanced subscription.

func (*Store) DeleteProtection

func (s *Store) DeleteProtection(id string) *service.AWSError

DeleteProtection removes a protection.

func (*Store) DeleteProtectionGroup

func (s *Store) DeleteProtectionGroup(id string) *service.AWSError

DeleteProtectionGroup removes a protection group.

func (*Store) DescribeAttackStatistics

func (s *Store) DescribeAttackStatistics() AttackStatistics

DescribeAttackStatistics returns attack statistics (mock data).

func (*Store) DescribeDRTAccess

func (s *Store) DescribeDRTAccess() DRTAccess

DescribeDRTAccess returns the DRT access configuration.

func (*Store) DisableApplicationLayerAutomaticResponse

func (s *Store) DisableApplicationLayerAutomaticResponse(resourceArn string) *service.AWSError

DisableApplicationLayerAutomaticResponse disables automatic response for a resource.

func (*Store) DisassociateHealthCheck

func (s *Store) DisassociateHealthCheck(protectionID, healthCheckArn string) *service.AWSError

DisassociateHealthCheck removes a Route 53 health check from a protection.

func (*Store) EnableApplicationLayerAutomaticResponse

func (s *Store) EnableApplicationLayerAutomaticResponse(resourceArn string, action map[string]any) *service.AWSError

EnableApplicationLayerAutomaticResponse enables automatic response for a resource.

func (*Store) GetAttack

func (s *Store) GetAttack(attackId string) (*Attack, *service.AWSError)

GetAttack returns an attack by ID.

func (*Store) GetProtection

func (s *Store) GetProtection(id string) (*Protection, *service.AWSError)

GetProtection returns a protection by ID.

func (*Store) GetProtectionGroup

func (s *Store) GetProtectionGroup(id string) (*ProtectionGroup, *service.AWSError)

GetProtectionGroup returns a protection group.

func (*Store) GetSubscription

func (s *Store) GetSubscription() (*Subscription, *service.AWSError)

GetSubscription returns the subscription.

func (*Store) ListAttacks

func (s *Store) ListAttacks() []*Attack

ListAttacks returns all attacks.

func (*Store) ListProtectionGroups

func (s *Store) ListProtectionGroups() []*ProtectionGroup

ListProtectionGroups returns all protection groups.

func (*Store) ListProtections

func (s *Store) ListProtections() []*Protection

ListProtections returns all protections.

func (*Store) ListTagsForResource

func (s *Store) ListTagsForResource(arn string) ([]Tag, *service.AWSError)

ListTagsForResource returns tags for a resource.

func (*Store) TagResource

func (s *Store) TagResource(arn string, tags []Tag) *service.AWSError

TagResource adds tags to a resource.

func (*Store) UntagResource

func (s *Store) UntagResource(arn string, tagKeys []string) *service.AWSError

UntagResource removes tags from a resource.

func (*Store) UpdateProtectionGroup

func (s *Store) UpdateProtectionGroup(id, aggregation, pattern, resourceType string, members []string) *service.AWSError

UpdateProtectionGroup updates a protection group.

func (*Store) UpdateSubscription

func (s *Store) UpdateSubscription(autoRenew string) *service.AWSError

UpdateSubscription updates the subscription auto-renew setting.

type Subscription

type Subscription struct {
	StartTime                 time.Time
	EndTime                   time.Time
	TimeCommitmentInSeconds   int64
	AutoRenew                 string
	Limits                    []Limit
	ProactiveEngagementStatus string
	SubscriptionState         string
	SubscriptionArn           string
}

Subscription holds a Shield Advanced subscription.

type SummarizedCounter

type SummarizedCounter struct {
	Name    string
	Max     float64
	Average float64
	Sum     float64
	N       int
	Unit    string
}

SummarizedCounter holds attack counter data.

type Tag

type Tag struct {
	Key   string
	Value string
}

Tag represents a key-value tag.

Jump to

Keyboard shortcuts

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