Documentation
¶
Index ¶
- Constants
- Variables
- type ALARConfig
- type Attack
- type AttackCounter
- type AttackStatistics
- type AttackStatisticsItem
- type AttackTimeRange
- type AttackVector
- type AttackVolume
- type AttackVolumeStatistics
- type DRTAccess
- type EmergencyContact
- type Handler
- func (h *Handler) ChaosOperations() []string
- func (h *Handler) ChaosRegions() []string
- func (h *Handler) ChaosServiceName() string
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Snapshot(ctx context.Context) []byte
- type InMemoryBackend
- func (b *InMemoryBackend) AccountID() string
- func (b *InMemoryBackend) AddAttackInternal(attackID, resourceARN string) *Attack
- func (b *InMemoryBackend) AddProtectionGroupInternal(id, aggregation, pattern string) *ProtectionGroup
- func (b *InMemoryBackend) AddProtectionInternal(name, resourceARN string) *Protection
- func (b *InMemoryBackend) AddSubscriptionInternal()
- func (b *InMemoryBackend) AssociateDRTLogBucket(bucket string) error
- func (b *InMemoryBackend) AssociateDRTRole(roleARN string) error
- func (b *InMemoryBackend) AssociateHealthCheck(protectionID, healthCheckARN string) error
- func (b *InMemoryBackend) AssociateProactiveEngagementDetails(contacts []EmergencyContact) error
- func (b *InMemoryBackend) CreateProtection(name, resourceARN string, tags map[string]string) (*Protection, error)
- func (b *InMemoryBackend) CreateProtectionGroup(id, aggregation, pattern, resourceType string, members []string) (*ProtectionGroup, error)
- func (b *InMemoryBackend) CreateSubscription() error
- func (b *InMemoryBackend) DeleteProtection(protectionID string) error
- func (b *InMemoryBackend) DeleteProtectionGroup(protectionGroupID string) error
- func (b *InMemoryBackend) DeleteSubscription() error
- func (b *InMemoryBackend) DescribeAttack(attackID string) (*Attack, error)
- func (b *InMemoryBackend) DescribeAttackStatistics() *AttackStatistics
- func (b *InMemoryBackend) DescribeDRTAccess() *DRTAccess
- func (b *InMemoryBackend) DescribeEmergencyContactSettings() []EmergencyContact
- func (b *InMemoryBackend) DescribeProtection(protectionID, resourceARN string) (*Protection, error)
- func (b *InMemoryBackend) DescribeProtectionGroup(id string) (*ProtectionGroup, error)
- func (b *InMemoryBackend) DescribeSubscription() (*Subscription, error)
- func (b *InMemoryBackend) DisableApplicationLayerAutomaticResponse(resourceARN string) error
- func (b *InMemoryBackend) DisableProactiveEngagement() error
- func (b *InMemoryBackend) DisassociateDRTLogBucket(bucket string) error
- func (b *InMemoryBackend) DisassociateDRTRole() error
- func (b *InMemoryBackend) DisassociateHealthCheck(protectionID, healthCheckARN string) error
- func (b *InMemoryBackend) EnableApplicationLayerAutomaticResponse(resourceARN, action string) error
- func (b *InMemoryBackend) EnableProactiveEngagement() error
- func (b *InMemoryBackend) GetALARConfig(resourceARN string) *ALARConfig
- func (b *InMemoryBackend) GetProactiveEngagementStatus() string
- func (b *InMemoryBackend) GetSubscriptionState() string
- func (b *InMemoryBackend) ListAttacks(resourceARNs []string, startTime, endTime int64) []*Attack
- func (b *InMemoryBackend) ListProtectionGroups() []*ProtectionGroup
- func (b *InMemoryBackend) ListProtections() []*Protection
- func (b *InMemoryBackend) ListResourcesInProtectionGroup(protectionGroupID string) ([]string, error)
- func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
- func (b *InMemoryBackend) Region() string
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) SimulateAttack(resourceARN string, attackVectorTypes []string) (*Attack, error)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
- func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
- func (b *InMemoryBackend) UpdateApplicationLayerAutomaticResponse(resourceARN, action string) error
- func (b *InMemoryBackend) UpdateEmergencyContactSettings(contacts []EmergencyContact) error
- func (b *InMemoryBackend) UpdateProtectionGroup(id, aggregation, pattern, resourceType string, members []string) error
- func (b *InMemoryBackend) UpdateSubscription(autoRenew string) error
- type Mitigation
- type Protection
- type ProtectionGroup
- type Provider
- type StorageBackend
- type Subscription
Constants ¶
const ( AggregationSum = "SUM" AggregationMean = "MEAN" AggregationMax = "MAX" )
Aggregation values for protection groups.
const ( PatternAll = "ALL" PatternArbitrary = "ARBITRARY" PatternByResourceType = "BY_RESOURCE_TYPE" )
Pattern values for protection groups.
const ( AutoRenewEnabled = "ENABLED" AutoRenewDisabled = "DISABLED" )
AutoRenew values for subscriptions.
const ( ResourceTypeCloudFrontDistribution = "CLOUDFRONT_DISTRIBUTION" ResourceTypeRoute53HostedZone = "ROUTE_53_HOSTED_ZONE" ResourceTypeApplicationLoadBalancer = "APPLICATION_LOAD_BALANCER" ResourceTypeClassicLoadBalancer = "CLASSIC_LOAD_BALANCER" ResourceTypeElasticIPAllocation = "ELASTIC_IP_ALLOCATION" ResourceTypeGlobalAccelerator = "GLOBAL_ACCELERATOR" )
ResourceType values for Shield Advanced protected resources.
const ( ProactiveEngagementEnabled = "ENABLED" ProactiveEngagementDisabled = "DISABLED" ProactiveEngagementPending = "PENDING" )
ProactiveEngagementStatus values.
Variables ¶
var ( // ErrProtectionNotFound is returned when a protection does not exist. ErrProtectionNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrProtectionAlreadyExists is returned when a protection for the resource already exists. ErrProtectionAlreadyExists = awserr.New("ResourceAlreadyExistsException", awserr.ErrConflict) // ErrSubscriptionAlreadyExists is returned when a Shield Advanced subscription already exists. ErrSubscriptionAlreadyExists = awserr.New("ResourceAlreadyExistsException", awserr.ErrConflict) // ErrSubscriptionNotFound is returned when no subscription exists. ErrSubscriptionNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrSubscriptionRequired is returned when an operation requires an active Shield Advanced subscription. ErrSubscriptionRequired = awserr.New("InvalidOperationException: subscription required", awserr.ErrConflict) // ErrProtectionGroupNotFound is returned when a protection group does not exist. ErrProtectionGroupNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrProtectionGroupAlreadyExists is returned when a protection group with the same ID already exists. ErrProtectionGroupAlreadyExists = awserr.New("ResourceAlreadyExistsException", awserr.ErrConflict) // ErrAttackNotFound is returned when an attack does not exist. ErrAttackNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound) // ErrValidation is returned when input validation fails. ErrValidation = awserr.New("InvalidParameterException", awserr.ErrInvalidParameter) )
var ErrNilAppContext = errors.New("shield: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
Functions ¶
This section is empty.
Types ¶
type ALARConfig ¶
type ALARConfig struct {
// ResourceARN identifies the protected resource this ALAR configuration
// applies to. It is tagged json:"-" because ALARConfig has no natural
// identity field of its own -- it was only ever reached via the external
// map[string]*ALARConfig key. The alarConfigs Table's keyFn derives its
// key from this field (see store_setup.go), and persistence.go's
// alarConfigDTO carries it as a real JSON field so Snapshot/Restore
// round-trips correctly.
ResourceARN string `json:"-"`
// Action is either "BLOCK" or "COUNT".
Action string `json:"action"`
Enabled bool `json:"enabled"`
}
ALARConfig holds Application Layer Automatic Response configuration for a protection.
type Attack ¶
type Attack struct {
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
AttackID string `json:"attackId"`
ResourceARN string `json:"resourceArn"`
AttackVectors []AttackVector `json:"attackVectors,omitempty"`
AttackCounters []AttackCounter `json:"attackCounters,omitempty"`
Mitigations []Mitigation `json:"mitigations,omitempty"`
}
Attack represents a Shield Advanced attack event.
type AttackCounter ¶
type AttackStatistics ¶
type AttackStatistics struct {
DataItems []AttackStatisticsItem `json:"dataItems"`
TimeRange AttackTimeRange `json:"timeRange"`
}
AttackStatistics represents Shield Advanced attack statistics.
type AttackStatisticsItem ¶
type AttackStatisticsItem struct {
AttackVolume *AttackVolume `json:"AttackVolume,omitempty"`
AttackCount int64 `json:"AttackCount"`
}
AttackStatisticsItem is a single item in attack statistics.
type AttackTimeRange ¶
type AttackTimeRange struct {
FromInclusive int64 `json:"fromInclusive"`
ToExclusive int64 `json:"toExclusive"`
}
AttackTimeRange represents a time range for attack statistics.
type AttackVector ¶
type AttackVector struct {
VectorType string `json:"VectorType"`
}
AttackVector represents a type of attack traffic seen during an attack.
type AttackVolume ¶
type AttackVolume struct {
BitsPerSecond *AttackVolumeStatistics `json:"BitsPerSecond,omitempty"`
PacketsPerSecond *AttackVolumeStatistics `json:"PacketsPerSecond,omitempty"`
RequestsPerSecond *AttackVolumeStatistics `json:"RequestsPerSecond,omitempty"`
}
AttackVolume represents volume metrics in attack statistics.
type AttackVolumeStatistics ¶
type AttackVolumeStatistics struct {
Max float64 `json:"Max"`
}
AttackVolumeStatistics is a single volume metric.
type DRTAccess ¶
type DRTAccess struct {
RoleArn string `json:"roleArn"`
LogBucketList []string `json:"logBucketList"`
}
DRTAccess holds DRT log bucket and role configuration.
type EmergencyContact ¶
type EmergencyContact struct {
EmailAddress string `json:"emailAddress"`
PhoneNumber string `json:"phoneNumber,omitempty"`
ContactNotes string `json:"contactNotes,omitempty"`
}
EmergencyContact represents an emergency contact for proactive engagement.
type Handler ¶
type Handler struct {
Backend StorageBackend
}
Handler is the HTTP handler for the AWS Shield Advanced API.
func NewHandler ¶
func NewHandler(backend StorageBackend) *Handler
NewHandler creates a new Shield handler.
func (*Handler) ChaosOperations ¶
ChaosOperations returns all operations that can be fault-injected.
func (*Handler) ChaosRegions ¶
ChaosRegions returns all regions this handler handles.
func (*Handler) ChaosServiceName ¶
ChaosServiceName returns the lowercase AWS service name for fault rule matching.
func (*Handler) ExtractOperation ¶
ExtractOperation extracts the operation name from the X-Amz-Target header.
func (*Handler) ExtractResource ¶
ExtractResource extracts the resource identifier from the request.
func (*Handler) GetSupportedOperations ¶
GetSupportedOperations returns the list of supported Shield operations.
func (*Handler) Handler ¶
func (h *Handler) Handler() echo.HandlerFunc
Handler returns the Echo handler function for Shield requests.
func (*Handler) MatchPriority ¶
MatchPriority returns the routing priority.
func (*Handler) Reset ¶
func (h *Handler) Reset()
Reset clears all handler state by delegating to the backend.
func (*Handler) RouteMatcher ¶
RouteMatcher returns a function that matches Shield API requests. Requests are identified by the X-Amz-Target header prefix "AWSShield_20160616.".
type InMemoryBackend ¶
type InMemoryBackend struct {
// contains filtered or unexported fields
}
InMemoryBackend is an in-memory store for Shield Advanced resources.
protections, protectionGroups, and attacks are *store.Table[T] (see store_setup.go), with the former one-to-one ARN/name reverse-lookup maps replaced by companion *store.Index values on protections. alarConfigs is also a *store.Table[ALARConfig] but is not registered on registry -- see store_setup.go's file doc comment.
func NewInMemoryBackend ¶
func NewInMemoryBackend(accountID, region string) *InMemoryBackend
NewInMemoryBackend creates a new in-memory Shield backend.
func (*InMemoryBackend) AccountID ¶
func (b *InMemoryBackend) AccountID() string
AccountID returns the AWS account ID this backend is configured for.
func (*InMemoryBackend) AddAttackInternal ¶
func (b *InMemoryBackend) AddAttackInternal(attackID, resourceARN string) *Attack
AddAttackInternal creates an attack record directly (for tests).
func (*InMemoryBackend) AddProtectionGroupInternal ¶
func (b *InMemoryBackend) AddProtectionGroupInternal(id, aggregation, pattern string) *ProtectionGroup
AddProtectionGroupInternal creates a protection group directly (for tests).
func (*InMemoryBackend) AddProtectionInternal ¶
func (b *InMemoryBackend) AddProtectionInternal(name, resourceARN string) *Protection
AddProtectionInternal creates a protection directly (for tests).
func (*InMemoryBackend) AddSubscriptionInternal ¶
func (b *InMemoryBackend) AddSubscriptionInternal()
AddSubscriptionInternal creates a subscription directly (for tests).
func (*InMemoryBackend) AssociateDRTLogBucket ¶
func (b *InMemoryBackend) AssociateDRTLogBucket(bucket string) error
AssociateDRTLogBucket associates an S3 log bucket with the DRT.
func (*InMemoryBackend) AssociateDRTRole ¶
func (b *InMemoryBackend) AssociateDRTRole(roleARN string) error
AssociateDRTRole associates an IAM role with the DRT.
func (*InMemoryBackend) AssociateHealthCheck ¶
func (b *InMemoryBackend) AssociateHealthCheck(protectionID, healthCheckARN string) error
AssociateHealthCheck associates a Route 53 health check with a protection.
func (*InMemoryBackend) AssociateProactiveEngagementDetails ¶
func (b *InMemoryBackend) AssociateProactiveEngagementDetails(contacts []EmergencyContact) error
AssociateProactiveEngagementDetails stores emergency contact details for proactive engagement. Sets status to PENDING when transitioning from DISABLED or empty.
func (*InMemoryBackend) CreateProtection ¶
func (b *InMemoryBackend) CreateProtection(name, resourceARN string, tags map[string]string) (*Protection, error)
CreateProtection creates a new Shield protection for the given resource ARN.
func (*InMemoryBackend) CreateProtectionGroup ¶
func (b *InMemoryBackend) CreateProtectionGroup( id, aggregation, pattern, resourceType string, members []string, ) (*ProtectionGroup, error)
CreateProtectionGroup creates a new Shield Advanced protection group.
func (*InMemoryBackend) CreateSubscription ¶
func (b *InMemoryBackend) CreateSubscription() error
CreateSubscription enables Shield Advanced. Returns an error if already subscribed.
func (*InMemoryBackend) DeleteProtection ¶
func (b *InMemoryBackend) DeleteProtection(protectionID string) error
DeleteProtection deletes a protection by ID.
func (*InMemoryBackend) DeleteProtectionGroup ¶
func (b *InMemoryBackend) DeleteProtectionGroup(protectionGroupID string) error
DeleteProtectionGroup removes a Shield Advanced protection group.
func (*InMemoryBackend) DeleteSubscription ¶
func (b *InMemoryBackend) DeleteSubscription() error
DeleteSubscription cancels the active Shield Advanced subscription.
func (*InMemoryBackend) DescribeAttack ¶
func (b *InMemoryBackend) DescribeAttack(attackID string) (*Attack, error)
DescribeAttack returns the details of a specific attack.
func (*InMemoryBackend) DescribeAttackStatistics ¶
func (b *InMemoryBackend) DescribeAttackStatistics() *AttackStatistics
DescribeAttackStatistics returns summary statistics about attacks, bucketed by month.
func (*InMemoryBackend) DescribeDRTAccess ¶
func (b *InMemoryBackend) DescribeDRTAccess() *DRTAccess
DescribeDRTAccess returns the current DRT access configuration.
func (*InMemoryBackend) DescribeEmergencyContactSettings ¶
func (b *InMemoryBackend) DescribeEmergencyContactSettings() []EmergencyContact
DescribeEmergencyContactSettings returns the current emergency contacts.
func (*InMemoryBackend) DescribeProtection ¶
func (b *InMemoryBackend) DescribeProtection(protectionID, resourceARN string) (*Protection, error)
DescribeProtection returns a protection by ID or resource ARN.
func (*InMemoryBackend) DescribeProtectionGroup ¶
func (b *InMemoryBackend) DescribeProtectionGroup(id string) (*ProtectionGroup, error)
DescribeProtectionGroup returns a single protection group by ID.
func (*InMemoryBackend) DescribeSubscription ¶
func (b *InMemoryBackend) DescribeSubscription() (*Subscription, error)
DescribeSubscription returns the current Shield Advanced subscription.
func (*InMemoryBackend) DisableApplicationLayerAutomaticResponse ¶
func (b *InMemoryBackend) DisableApplicationLayerAutomaticResponse(resourceARN string) error
DisableApplicationLayerAutomaticResponse disables ALAR for the given resource ARN.
func (*InMemoryBackend) DisableProactiveEngagement ¶
func (b *InMemoryBackend) DisableProactiveEngagement() error
DisableProactiveEngagement disables proactive engagement for the subscription.
func (*InMemoryBackend) DisassociateDRTLogBucket ¶
func (b *InMemoryBackend) DisassociateDRTLogBucket(bucket string) error
DisassociateDRTLogBucket removes an S3 log bucket from the DRT.
func (*InMemoryBackend) DisassociateDRTRole ¶
func (b *InMemoryBackend) DisassociateDRTRole() error
DisassociateDRTRole removes the IAM role association from the DRT. Idempotent per AWS.
func (*InMemoryBackend) DisassociateHealthCheck ¶
func (b *InMemoryBackend) DisassociateHealthCheck(protectionID, healthCheckARN string) error
DisassociateHealthCheck removes a Route 53 health check from a protection.
func (*InMemoryBackend) EnableApplicationLayerAutomaticResponse ¶
func (b *InMemoryBackend) EnableApplicationLayerAutomaticResponse(resourceARN, action string) error
EnableApplicationLayerAutomaticResponse enables ALAR for the given resource ARN. action must be "BLOCK" or "COUNT".
func (*InMemoryBackend) EnableProactiveEngagement ¶
func (b *InMemoryBackend) EnableProactiveEngagement() error
EnableProactiveEngagement enables proactive engagement for the subscription. Requires at least one emergency contact to be configured.
func (*InMemoryBackend) GetALARConfig ¶
func (b *InMemoryBackend) GetALARConfig(resourceARN string) *ALARConfig
GetALARConfig returns the ALAR config for a resource ARN, or nil if none.
func (*InMemoryBackend) GetProactiveEngagementStatus ¶
func (b *InMemoryBackend) GetProactiveEngagementStatus() string
GetProactiveEngagementStatus returns the current proactive engagement status.
func (*InMemoryBackend) GetSubscriptionState ¶
func (b *InMemoryBackend) GetSubscriptionState() string
GetSubscriptionState returns ACTIVE or INACTIVE.
func (*InMemoryBackend) ListAttacks ¶
func (b *InMemoryBackend) ListAttacks(resourceARNs []string, startTime, endTime int64) []*Attack
ListAttacks returns all attacks, optionally filtered by resource ARNs (match any). start and end are optional Unix epoch seconds (0 = not filtered).
func (*InMemoryBackend) ListProtectionGroups ¶
func (b *InMemoryBackend) ListProtectionGroups() []*ProtectionGroup
ListProtectionGroups returns all protection groups sorted by ID. Clones are built under RLock; sorting happens after the lock is released.
func (*InMemoryBackend) ListProtections ¶
func (b *InMemoryBackend) ListProtections() []*Protection
ListProtections returns all protections sorted by name. Clones are built under RLock; sorting happens after the lock is released.
func (*InMemoryBackend) ListResourcesInProtectionGroup ¶
func (b *InMemoryBackend) ListResourcesInProtectionGroup(protectionGroupID string) ([]string, error)
ListResourcesInProtectionGroup returns the member ARNs for a protection group. For Pattern=ALL returns all protections; for Pattern=BY_RESOURCE_TYPE derives members by resource type.
func (*InMemoryBackend) ListTagsForResource ¶
func (b *InMemoryBackend) ListTagsForResource(resourceARN string) (map[string]string, error)
ListTagsForResource returns the tags for a protection.
func (*InMemoryBackend) Region ¶
func (b *InMemoryBackend) Region() string
Region returns the AWS region this backend is configured for.
func (*InMemoryBackend) Reset ¶
func (b *InMemoryBackend) Reset()
Reset clears all Shield protections and subscription state atomically.
func (*InMemoryBackend) Restore ¶
func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
Restore loads backend state from a JSON snapshot.
func (*InMemoryBackend) SimulateAttack ¶
func (b *InMemoryBackend) SimulateAttack(resourceARN string, attackVectorTypes []string) (*Attack, error)
SimulateAttack creates a synthetic attack record reachable via the API. attackVectorTypes may be empty; defaults to SYN_FLOOD if omitted.
func (*InMemoryBackend) Snapshot ¶
func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
Snapshot serialises the backend state to JSON.
func (*InMemoryBackend) TagResource ¶
func (b *InMemoryBackend) TagResource(resourceARN string, tags map[string]string) error
TagResource adds tags to a protection, keyed by Shield protection ARN or resource ARN. Requires an active subscription. Enforces 50-tag cap and key/value length limits.
func (*InMemoryBackend) UntagResource ¶
func (b *InMemoryBackend) UntagResource(resourceARN string, tagKeys []string) error
UntagResource removes tags from a protection.
func (*InMemoryBackend) UpdateApplicationLayerAutomaticResponse ¶
func (b *InMemoryBackend) UpdateApplicationLayerAutomaticResponse(resourceARN, action string) error
UpdateApplicationLayerAutomaticResponse updates the ALAR action for a resource ARN.
func (*InMemoryBackend) UpdateEmergencyContactSettings ¶
func (b *InMemoryBackend) UpdateEmergencyContactSettings(contacts []EmergencyContact) error
UpdateEmergencyContactSettings replaces the emergency contact list. Enforces: max 10 contacts, non-empty EmailAddress required.
func (*InMemoryBackend) UpdateProtectionGroup ¶
func (b *InMemoryBackend) UpdateProtectionGroup( id, aggregation, pattern, resourceType string, members []string, ) error
UpdateProtectionGroup updates the aggregation, pattern, resource type, and members of a group.
func (*InMemoryBackend) UpdateSubscription ¶
func (b *InMemoryBackend) UpdateSubscription(autoRenew string) error
UpdateSubscription updates the auto-renew setting of the active subscription.
type Mitigation ¶
type Mitigation struct {
MitigationName string `json:"MitigationName"`
}
Mitigation represents a mitigation applied during an attack.
type Protection ¶
type Protection struct {
CreationTime time.Time `json:"creationTime"`
Tags map[string]string `json:"tags,omitempty"`
ID string `json:"id"`
ProtectionArn string `json:"protectionArn"`
Name string `json:"name"`
ResourceARN string `json:"resourceARN"`
HealthCheckIDs []string `json:"healthCheckIds,omitempty"`
}
Protection represents an AWS Shield Advanced protection.
type ProtectionGroup ¶
type ProtectionGroup struct {
CreationTime time.Time `json:"creationTime"`
ID string `json:"id"`
ProtectionGroupArn string `json:"protectionGroupArn"`
Aggregation string `json:"aggregation"`
Pattern string `json:"pattern"`
ResourceType string `json:"resourceType,omitempty"`
Members []string `json:"members"`
}
ProtectionGroup represents a Shield Advanced protection group.
type Provider ¶
type Provider struct{}
Provider implements service.Provider for AWS Shield Advanced.
func (*Provider) Init ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init initializes the Shield service backend and handler.
type StorageBackend ¶
type StorageBackend interface {
CreateSubscription() error
DeleteSubscription() error
UpdateSubscription(autoRenew string) error
DescribeSubscription() (*Subscription, error)
GetSubscriptionState() string
CreateProtection(name, resourceARN string, tags map[string]string) (*Protection, error)
DescribeProtection(protectionID, resourceARN string) (*Protection, error)
DeleteProtection(protectionID string) error
ListProtections() []*Protection
AssociateHealthCheck(protectionID, healthCheckARN string) error
DisassociateHealthCheck(protectionID, healthCheckARN string) error
TagResource(resourceARN string, tags map[string]string) error
ListTagsForResource(resourceARN string) (map[string]string, error)
UntagResource(resourceARN string, tagKeys []string) error
AssociateDRTLogBucket(bucket string) error
DisassociateDRTLogBucket(bucket string) error
AssociateDRTRole(roleARN string) error
DisassociateDRTRole() error
DescribeDRTAccess() *DRTAccess
AssociateProactiveEngagementDetails(contacts []EmergencyContact) error
UpdateEmergencyContactSettings(contacts []EmergencyContact) error
DescribeEmergencyContactSettings() []EmergencyContact
EnableProactiveEngagement() error
DisableProactiveEngagement() error
CreateProtectionGroup(id, aggregation, pattern, resourceType string, members []string) (*ProtectionGroup, error)
DescribeProtectionGroup(id string) (*ProtectionGroup, error)
ListProtectionGroups() []*ProtectionGroup
UpdateProtectionGroup(id, aggregation, pattern, resourceType string, members []string) error
DeleteProtectionGroup(protectionGroupID string) error
ListAttacks(resourceARNs []string, startTime, endTime int64) []*Attack
DescribeAttack(attackID string) (*Attack, error)
DescribeAttackStatistics() *AttackStatistics
SimulateAttack(resourceARN string, attackVectorTypes []string) (*Attack, error)
EnableApplicationLayerAutomaticResponse(resourceARN, action string) error
DisableApplicationLayerAutomaticResponse(resourceARN string) error
UpdateApplicationLayerAutomaticResponse(resourceARN, action string) error
ListResourcesInProtectionGroup(protectionGroupID string) ([]string, error)
GetProactiveEngagementStatus() string
GetALARConfig(resourceARN string) *ALARConfig
AccountID() string
Region() string
Reset()
Snapshot(ctx context.Context) []byte
Restore(ctx context.Context, data []byte) error
}
StorageBackend is the interface for Shield Advanced storage operations.
Source Files
¶
- application_layer_automatic_response.go
- attacks.go
- drt.go
- emergency_contacts.go
- errors.go
- handler.go
- handler_application_layer_automatic_response.go
- handler_attacks.go
- handler_drt.go
- handler_emergency_contacts.go
- handler_health_checks.go
- handler_proactive_engagement.go
- handler_protection_groups.go
- handler_protections.go
- handler_subscription.go
- handler_tags.go
- health_checks.go
- interfaces.go
- models.go
- persistence.go
- proactive_engagement.go
- protection_groups.go
- protections.go
- provider.go
- store.go
- store_setup.go
- subscription.go
- tags.go