securityhub

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 20 Imported by: 0

README

Security Hub

Parity grade: A · SDK aws-sdk-go-v2/service/securityhub@v1.75.0 · last audited 2026-07-25 (1659d616)

Coverage

Metric Value
Operations audited 116 (115 ok, 1 partial)
Feature families 2 (2 ok)
Known gaps 4
Deferred items 0
Resource leaks clean
Known gaps
  • ListMembers(onlyAssociated=true) can never return members: filters on MemberStatus=="Enabled", but nothing transitions a member to Enabled because member-invitation acceptance is a cross-account action this single-account in-memory backend doesn't model (the member's own account would call AcceptInvitation against ITS OWN backend instance, not the administrator's). Not attempted this pass -- architectural, not a bug-fix-sized change; would need a multi-backend cross-account simulation this service doesn't have.
  • GetFindingsV2 Filters.CompositeFilters only evaluates StringFilters and NumberFilters, and only for the field-name subset in ocsfStringFieldMap/ocsfNumberFieldMap (findings_v2.go) that has a direct scalar ASFF equivalent. DateFilters, MapFilters, IpFilters, BooleanFilters, NestedCompositeFilters, and any OcsfStringField/OcsfNumberField outside the mapped subset (e.g. class_name, which has no scalar ASFF equivalent -- the closest analog, Types, is a string array) are accepted on the wire but not evaluated, matching (not exceeding) the 'basic subset' precedent V1 GetFindings/matchesFindingFilters already established. Full coverage needs a complete OCSF field taxonomy crosswalk (~70 string fields, ~15 number fields alone) -- out of scope for this pass.
  • BatchUpdateFindingsV2 MetadataUids-based finding identification can never resolve (always ResourceNotFoundException): this backend has no OCSF ingestion path that would ever hand a real client a metadata.uid to reference back. Only FindingIdentifiers (CloudAccountUid/FindingInfoUid/MetadataProductUid, mapped onto AwsAccountId/Id/ProductArn) can resolve a finding.
  • (parity-4) CSPM Connector health ConnectorStatus can never leave UNKNOWN, and EnablementStatus can never reach ENABLED: unlike Connectors V2 (which has a dedicated RegisterConnectorV2 to complete an out-of-band OAuth handshake), the real CreateConnector/GetConnector/UpdateConnector/DeleteConnector/ListConnectors surface has NO companion 'complete authorization' operation at all -- establishing connectivity to the Azure account requires a purely external, provider-side step (granting the AWSConfigConnectorArn role access in the Azure portal) that this mock has no API-observable signal for. Auto-advancing a connector to CONNECTED/ENABLED without any real client action causing it would be a fabricated transition, so CreateConnector leaves it at PENDING_ENABLEMENT/UNKNOWN and UpdateConnector leaves it at PENDING_UPDATE permanently. Not attempted this pass -- architectural (no out-of-band signal exists to model), not a bug-fix-sized change.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHubNotEnabled    = errors.New("SecurityHub is not enabled")
	ErrHubAlreadyExists = errors.New("SecurityHub is already enabled")
	ErrNotFound         = errors.New("not found")
	ErrInvalidInput     = errors.New("invalid input")
	ErrAlreadyExists    = errors.New("resource already exists")
)
View Source
var ErrNilAppContext = errors.New("securityhub: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type ActionTarget

type ActionTarget struct {
	ActionTargetArn string `json:"ActionTargetArn"`
	Name            string `json:"Name"`
	Description     string `json:"Description"`
}

ActionTarget represents a custom action target.

type AdminAccount

type AdminAccount struct {
	AccountId          string `json:"AccountId"`    //nolint:revive,staticcheck // existing issue.
	InvitationId       string `json:"InvitationId"` //nolint:revive,staticcheck // existing issue.
	InvitedAt          string `json:"InvitedAt"`
	RelationshipStatus string `json:"RelationshipStatus"`
}

AdminAccount represents the administrator account relationship.

type AggregatorV2

type AggregatorV2 struct {
	AggregatorV2Arn   string   `json:"AggregatorV2Arn"`
	AggregationRegion string   `json:"AggregationRegion"`
	RegionLinkingMode string   `json:"RegionLinkingMode"`
	CreatedAt         string   `json:"CreatedAt"`
	UpdatedAt         string   `json:"UpdatedAt"`
	Regions           []string `json:"Regions"`
}

AggregatorV2 represents a Security Hub V2 cross-region aggregator.

type AutomationRule

type AutomationRule struct {
	Criteria    map[string]any   `json:"Criteria"`
	RuleArn     string           `json:"RuleArn"`
	RuleStatus  string           `json:"RuleStatus"`
	RuleName    string           `json:"RuleName"`
	Description string           `json:"Description"`
	CreatedAt   string           `json:"CreatedAt"`
	UpdatedAt   string           `json:"UpdatedAt"`
	CreatedBy   string           `json:"CreatedBy"`
	Actions     []map[string]any `json:"Actions"`
	RuleOrder   int32            `json:"RuleOrder"`
	IsTerminal  bool             `json:"IsTerminal"`
}

AutomationRule is the full rule returned by BatchGetAutomationRules.

type AutomationRuleMetadata

type AutomationRuleMetadata struct {
	RuleArn     string
	RuleStatus  string
	RuleName    string
	Description string
	CreatedAt   string
	UpdatedAt   string
	CreatedBy   string
	RuleOrder   int32
	IsTerminal  bool
}

AutomationRuleMetadata is the summary view returned by ListAutomationRules.

type AutomationRuleV2

type AutomationRuleV2 struct {
	Identifier  string           `json:"Identifier"`
	RuleArn     string           `json:"RuleArn"`
	RuleName    string           `json:"RuleName"`
	RuleStatus  string           `json:"RuleStatus"`
	Description string           `json:"Description"`
	CreatedAt   string           `json:"CreatedAt"`
	UpdatedAt   string           `json:"UpdatedAt"`
	Criteria    map[string]any   `json:"Criteria"`
	Actions     []map[string]any `json:"Actions"`
	RuleOrder   float64          `json:"RuleOrder"`
	IsTerminal  bool             `json:"IsTerminal"`
}

AutomationRuleV2 represents a Security Hub V2 automation rule.

type ConfigurationPolicy

type ConfigurationPolicy struct {
	ConfigurationPolicy map[string]any    `json:"ConfigurationPolicy"`
	Tags                map[string]string `json:"Tags"`
	Arn                 string            `json:"Arn"`
	Id                  string            `json:"Id"` //nolint:revive,staticcheck // existing issue.
	Name                string            `json:"Name"`
	Description         string            `json:"Description"`
	CreatedAt           string            `json:"CreatedAt"`
	UpdatedAt           string            `json:"UpdatedAt"`
}

ConfigurationPolicy represents a Security Hub central configuration policy.

type ConfigurationPolicyAssociation

type ConfigurationPolicyAssociation struct {
	ConfigurationPolicyId    string `json:"ConfigurationPolicyId"` //nolint:revive,staticcheck // existing issue.
	TargetId                 string `json:"TargetId"`              //nolint:revive,staticcheck // existing issue.
	TargetType               string `json:"TargetType"`
	AssociationType          string `json:"AssociationType"`
	UpdatedAt                string `json:"UpdatedAt"`
	AssociationStatus        string `json:"AssociationStatus"`
	AssociationStatusMessage string `json:"AssociationStatusMessage"`
}

ConfigurationPolicyAssociation represents an association between a policy and a target.

type ConnectorV2

type ConnectorV2 struct {
	Provider        map[string]any    `json:"Provider"`
	Tags            map[string]string `json:"Tags"`
	ConnectorId     string            `json:"ConnectorId"` //nolint:revive,staticcheck // existing issue.
	ConnectorArn    string            `json:"ConnectorArn"`
	Name            string            `json:"Name"`
	Description     string            `json:"Description"`
	CreatedAt       string            `json:"CreatedAt"`
	UpdatedAt       string            `json:"UpdatedAt"`
	ConnectorStatus string            `json:"ConnectorStatus"`
}

ConnectorV2 represents a Security Hub V2 connector.

type CspmConnector added in v1.2.0

type CspmConnector struct {
	Provider         map[string]any    `json:"Provider"`
	Tags             map[string]string `json:"Tags"`
	ConnectorId      string            `json:"ConnectorId"` //nolint:revive,staticcheck // existing issue.
	ConnectorArn     string            `json:"ConnectorArn"`
	Name             string            `json:"Name"`
	Description      string            `json:"Description"`
	CreatedAt        string            `json:"CreatedAt"`
	LastUpdatedAt    string            `json:"LastUpdatedAt"`
	CreatedBy        string            `json:"CreatedBy"`
	EnablementStatus string            `json:"EnablementStatus"`
	// ConnectorStatus/HealthMessage/HealthCheckedAt make up the connector's
	// health check (types.CspmHealthCheck) -- kept as flat fields here rather
	// than a nested struct since nothing else needs to address them as a unit.
	ConnectorStatus string `json:"ConnectorStatus"`
	HealthMessage   string `json:"HealthMessage"`
	HealthCheckedAt string `json:"HealthCheckedAt"`
	ProviderName    string `json:"ProviderName"`
}

CspmConnector represents a Security Hub CSPM connector to a third-party cloud provider (currently Azure only, per the real API's CspmProviderConfiguration/CspmProviderDetail unions -- see connectors.go). Provider holds the raw tagged-union wire value (e.g. {"Azure": {AWSConfigConnectorArn, AzureRegions, ScopeConfiguration}}) exactly as sent/returned on the wire, so Get/List responses can echo it back without re-deriving the union shape.

type FindingAggregator

type FindingAggregator struct {
	FindingAggregatorArn     string   `json:"FindingAggregatorArn"`
	FindingAggregationRegion string   `json:"FindingAggregationRegion"`
	RegionLinkingMode        string   `json:"RegionLinkingMode"`
	Regions                  []string `json:"Regions"`
}

FindingAggregator represents a Security Hub finding aggregator for cross-region aggregation.

type Handler

type Handler struct {
	Backend StorageBackend
}

Handler handles SecurityHub HTTP requests.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler constructs a new Handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns the operations for chaos engineering.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns the regions for chaos engineering.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the service name for chaos engineering.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation classifies the request into an operation name.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns the resource identifier from the request.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns every operation name this handler routes.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset resets the backend.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches SecurityHub requests by path. For /findings and /tags paths, uses the Authorization header to disambiguate from other services (e.g. Macie2) that share those path prefixes.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type Hub

type Hub struct {
	HubArn                  string `json:"HubArn"`
	SubscribedAt            string `json:"SubscribedAt"`
	AutoEnableStandards     string `json:"AutoEnableStandards"`
	ControlFindingGenerator string `json:"ControlFindingGenerator"`
	AutoEnableControls      bool   `json:"AutoEnableControls"`
}

Hub represents the SecurityHub configuration.

type HubV2

type HubV2 struct {
	Features  map[string]*HubV2Feature `json:"Features"`
	HubV2Arn  string                   `json:"HubV2Arn"`
	CreatedAt string                   `json:"CreatedAt"`
	UpdatedAt string                   `json:"UpdatedAt"`
}

HubV2 represents the Security Hub V2 configuration.

type HubV2Feature added in v1.2.0

type HubV2Feature struct {
	FeatureStatus string `json:"FeatureStatus"`
	UpdatedAt     string `json:"UpdatedAt"`
}

HubV2Feature represents one opt-in Security Hub V2 feature's enablement status (see EnableSecurityHubFeatureV2/DisableSecurityHubFeatureV2), mirroring the real SDK's types.FeatureDetail{FeatureStatus, UpdatedAt}.

type InMemoryBackend

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

InMemoryBackend is the in-memory implementation of StorageBackend.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory backend.

func (*InMemoryBackend) AcceptAdministratorInvitation

func (b *InMemoryBackend) AcceptAdministratorInvitation(administratorID, invitationID string) error

func (*InMemoryBackend) AcceptInvitation

func (b *InMemoryBackend) AcceptInvitation(masterID, invitationID string) error

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

func (*InMemoryBackend) BatchDeleteAutomationRules

func (b *InMemoryBackend) BatchDeleteAutomationRules(automationRulesArns []string) ([]string, []map[string]any)

func (*InMemoryBackend) BatchDisableStandards

func (b *InMemoryBackend) BatchDisableStandards(
	subscriptionArns []string,
) ([]*StandardsSubscription, []map[string]any)

func (*InMemoryBackend) BatchEnableStandards

func (b *InMemoryBackend) BatchEnableStandards(requests []map[string]any) ([]*StandardsSubscription, []map[string]any)

func (*InMemoryBackend) BatchGetAutomationRules

func (b *InMemoryBackend) BatchGetAutomationRules(automationRulesArns []string) ([]*AutomationRule, []map[string]any)

func (*InMemoryBackend) BatchGetConfigurationPolicyAssociations

func (b *InMemoryBackend) BatchGetConfigurationPolicyAssociations(
	requests []map[string]any,
) ([]*ConfigurationPolicyAssociation, []map[string]any)

func (*InMemoryBackend) BatchGetSecurityControls

func (b *InMemoryBackend) BatchGetSecurityControls(securityControlIDs []string) ([]*SecurityControl, []map[string]any)

func (*InMemoryBackend) BatchGetStandardsControlAssociations

func (b *InMemoryBackend) BatchGetStandardsControlAssociations(
	requests []map[string]any,
) ([]*StandardsControlAssociation, []map[string]any)

func (*InMemoryBackend) BatchUpdateAutomationRules

func (b *InMemoryBackend) BatchUpdateAutomationRules(updates []map[string]any) ([]string, []map[string]any)

func (*InMemoryBackend) BatchUpdateFindings

func (b *InMemoryBackend) BatchUpdateFindings(
	findingIdentifiers []map[string]any,
	updates map[string]any,
) ([]map[string]any, []map[string]any)

func (*InMemoryBackend) BatchUpdateFindingsV2

func (b *InMemoryBackend) BatchUpdateFindingsV2(
	findingIdentifiers []map[string]any,
	metadataUids []string,
	updates map[string]any,
) ([]map[string]any, []map[string]any)

BatchUpdateFindingsV2 updates findings identified either by findingIdentifiers (types.OcsfFindingIdentifier: CloudAccountUid + FindingInfoUid + MetadataProductUid) or metadataUids (a finding's metadata.uid). This backend maps CloudAccountUid/FindingInfoUid/ MetadataProductUid onto the AwsAccountId/Id/ProductArn of the same ASFF-shaped store BatchImportFindings populates -- there is no separate V2 ingestion operation in the real API, so this is the only way BatchUpdateFindingsV2 can resolve a finding in this mock.

metadataUids can never resolve: this backend has no OCSF ingestion path that would ever hand a caller a metadata.uid to reference, so every metadataUids entry is reported unprocessed (ResourceNotFoundException).

func (*InMemoryBackend) BatchUpdateStandardsControlAssociations

func (b *InMemoryBackend) BatchUpdateStandardsControlAssociations(updates []map[string]any) ([]map[string]any, error)

func (*InMemoryBackend) CreateActionTarget

func (b *InMemoryBackend) CreateActionTarget(name, description, id string) (string, error)

func (*InMemoryBackend) CreateAggregatorV2

func (b *InMemoryBackend) CreateAggregatorV2(regionLinkingMode string, regions []string) (*AggregatorV2, error)

func (*InMemoryBackend) CreateAutomationRule

func (b *InMemoryBackend) CreateAutomationRule(rule map[string]any) (string, string)

func (*InMemoryBackend) CreateAutomationRuleV2

func (b *InMemoryBackend) CreateAutomationRuleV2(
	ruleName, ruleStatus, description string,
	criteria map[string]any,
	actions []map[string]any,
	ruleOrder float64,
	isTerminal bool,
	tags map[string]string,
) (*AutomationRuleV2, error)

func (*InMemoryBackend) CreateConfigurationPolicy

func (b *InMemoryBackend) CreateConfigurationPolicy(
	name, description string,
	policy map[string]any,
	tags map[string]string,
) (*ConfigurationPolicy, error)

func (*InMemoryBackend) CreateConnector added in v1.2.0

func (b *InMemoryBackend) CreateConnector(
	name, description string,
	provider map[string]any,
	tags map[string]string,
) (*CspmConnector, error)

CreateConnector creates a CSPM connector to a third-party cloud provider (currently Azure only -- the real CspmProviderConfiguration union has a single Azure member).

Unlike Connectors V2 (which has a dedicated RegisterConnectorV2 operation to complete an out-of-band OAuth-style handshake), the real CreateConnector surface has NO companion "complete authorization" operation at all. Establishing connectivity to the provider account requires a purely external, provider-side step (e.g. granting the AWSConfigConnectorArn role access in the Azure portal) that this mock has no API-observable signal for. A newly created connector is therefore left at EnablementStatus=PENDING_ENABLEMENT with health ConnectorStatus=UNKNOWN permanently -- it is never auto-advanced to CONNECTED/ENABLED, since doing so would fabricate a transition no real client-visible action caused. See PARITY.md for the documented gap this leaves (GetConnector/ListConnectors can never observe a CONNECTED connector against this backend).

func (*InMemoryBackend) CreateConnectorV2

func (b *InMemoryBackend) CreateConnectorV2(
	name, description string,
	provider map[string]any,
	tags map[string]string,
) (*ConnectorV2, error)

func (*InMemoryBackend) CreateFindingAggregator

func (b *InMemoryBackend) CreateFindingAggregator(
	regionLinkingMode string,
	regions []string,
) (*FindingAggregator, error)

func (*InMemoryBackend) CreateInsight

func (b *InMemoryBackend) CreateInsight(name, groupByAttribute string, filters map[string]any) (string, error)

func (*InMemoryBackend) CreateMembers

func (b *InMemoryBackend) CreateMembers(accounts []map[string]any) ([]*Member, []map[string]any)

func (*InMemoryBackend) CreateTicketV2

func (b *InMemoryBackend) CreateTicketV2(
	ticketConfig map[string]any,
	tags map[string]string,
) (*TicketV2, error)

func (*InMemoryBackend) DeclineInvitations

func (b *InMemoryBackend) DeclineInvitations(accountIDs []string) ([]map[string]any, []map[string]any)

func (*InMemoryBackend) DeleteActionTarget

func (b *InMemoryBackend) DeleteActionTarget(actionTargetArn string) (string, error)

func (*InMemoryBackend) DeleteAggregatorV2

func (b *InMemoryBackend) DeleteAggregatorV2(arn string) error

func (*InMemoryBackend) DeleteAutomationRuleV2

func (b *InMemoryBackend) DeleteAutomationRuleV2(identifier string) error

func (*InMemoryBackend) DeleteConfigurationPolicy

func (b *InMemoryBackend) DeleteConfigurationPolicy(identifier string) error

func (*InMemoryBackend) DeleteConnector added in v1.2.0

func (b *InMemoryBackend) DeleteConnector(connectorID string) (string, error)

DeleteConnector removes a connector. The real DeleteConnectorOutput reports the connector's EnablementStatus (PENDING_DELETION -- AWS may take time to tear down the provider-side connection) rather than confirming full removal. This mock has no background worker to model that async deletion window, so the record is removed immediately, but the response still reports PENDING_DELETION for wire fidelity with the real (eventually consistent) API.

func (*InMemoryBackend) DeleteConnectorV2

func (b *InMemoryBackend) DeleteConnectorV2(connectorID string) error

func (*InMemoryBackend) DeleteFindingAggregator

func (b *InMemoryBackend) DeleteFindingAggregator(arn string) error

func (*InMemoryBackend) DeleteInsight

func (b *InMemoryBackend) DeleteInsight(insightArn string) (string, error)

func (*InMemoryBackend) DeleteInvitations

func (b *InMemoryBackend) DeleteInvitations(accountIDs []string) ([]map[string]any, []map[string]any)

func (*InMemoryBackend) DeleteMembers

func (b *InMemoryBackend) DeleteMembers(accountIDs []string) ([]string, []map[string]any)

func (*InMemoryBackend) DescribeActionTargets

func (b *InMemoryBackend) DescribeActionTargets(
	actionTargetArns []string,
	nextToken string,
	maxResults int,
) ([]*ActionTarget, string)

func (*InMemoryBackend) DescribeHub

func (b *InMemoryBackend) DescribeHub() (*Hub, error)

func (*InMemoryBackend) DescribeOrganizationConfiguration

func (b *InMemoryBackend) DescribeOrganizationConfiguration() *OrgConfig

func (*InMemoryBackend) DescribeProducts

func (b *InMemoryBackend) DescribeProducts(productArn, nextToken string, maxResults int) ([]*Product, string)

func (*InMemoryBackend) DescribeProductsV2

func (b *InMemoryBackend) DescribeProductsV2(nextToken string, maxResults int) ([]*Product, string)

func (*InMemoryBackend) DescribeSecurityHubV2

func (b *InMemoryBackend) DescribeSecurityHubV2() (*HubV2, error)

func (*InMemoryBackend) DescribeStandards

func (b *InMemoryBackend) DescribeStandards(nextToken string, maxResults int) ([]*Standard, string)

func (*InMemoryBackend) DescribeStandardsControls

func (b *InMemoryBackend) DescribeStandardsControls(
	subscriptionArn, nextToken string,
	maxResults int,
) ([]*StandardsControl, string)

func (*InMemoryBackend) DisableHub

func (b *InMemoryBackend) DisableHub() error

func (*InMemoryBackend) DisableImportFindingsForProduct

func (b *InMemoryBackend) DisableImportFindingsForProduct(productSubscriptionArn string) error

func (*InMemoryBackend) DisableOrganizationAdminAccount

func (b *InMemoryBackend) DisableOrganizationAdminAccount(accountID string) error

func (*InMemoryBackend) DisableSecurityHubFeatureV2 added in v1.2.0

func (b *InMemoryBackend) DisableSecurityHubFeatureV2(featureName string) error

DisableSecurityHubFeatureV2 disables an opt-in Security Hub V2 feature. Mirrors EnableSecurityHubFeatureV2's gating and idempotency: requires SecurityHub V2 to be enabled, and disabling an already-DISABLED (or never enabled) feature is a no-op success rather than an error, per the real API's documented "no changes are made" guarantee.

func (*InMemoryBackend) DisableSecurityHubV2

func (b *InMemoryBackend) DisableSecurityHubV2() error

func (*InMemoryBackend) DisassociateFromAdministratorAccount

func (b *InMemoryBackend) DisassociateFromAdministratorAccount() error

func (*InMemoryBackend) DisassociateFromMasterAccount

func (b *InMemoryBackend) DisassociateFromMasterAccount() error

func (*InMemoryBackend) DisassociateMembers

func (b *InMemoryBackend) DisassociateMembers(accountIDs []string) error

func (*InMemoryBackend) EnableHub

func (b *InMemoryBackend) EnableHub(enableDefaultStandards bool, tags map[string]string) error

func (*InMemoryBackend) EnableImportFindingsForProduct

func (b *InMemoryBackend) EnableImportFindingsForProduct(productArn string) (string, error)

func (*InMemoryBackend) EnableOrganizationAdminAccount

func (b *InMemoryBackend) EnableOrganizationAdminAccount(accountID string) error

func (*InMemoryBackend) EnableSecurityHubFeatureV2 added in v1.2.0

func (b *InMemoryBackend) EnableSecurityHubFeatureV2(featureName string) error

EnableSecurityHubFeatureV2 enables an opt-in Security Hub V2 feature (e.g. NETWORK_SCANNING) for the account/region. Per the real API's documented behavior that the service must be enabled before a feature can be enabled, this requires SecurityHub V2 itself to already be enabled -- there is no standalone feature-enablement state independent of the V2 hub. The operation is idempotent: re-enabling an already-ENABLED feature is a silent no-op (no UpdatedAt bump), per the real API's documented "no changes are made" guarantee.

func (*InMemoryBackend) EnableSecurityHubV2

func (b *InMemoryBackend) EnableSecurityHubV2(tags map[string]string) error

func (*InMemoryBackend) GenerateRecommendedPolicyV2

func (b *InMemoryBackend) GenerateRecommendedPolicyV2(metadataUID string) (*RecommendedPolicyV2, error)

func (*InMemoryBackend) GetAdministratorAccount

func (b *InMemoryBackend) GetAdministratorAccount() (*AdminAccount, error)

func (*InMemoryBackend) GetAggregatorV2

func (b *InMemoryBackend) GetAggregatorV2(arn string) (*AggregatorV2, error)

func (*InMemoryBackend) GetAutomationRuleV2

func (b *InMemoryBackend) GetAutomationRuleV2(identifier string) (*AutomationRuleV2, error)

func (*InMemoryBackend) GetConfigurationPolicy

func (b *InMemoryBackend) GetConfigurationPolicy(identifier string) (*ConfigurationPolicy, error)

func (*InMemoryBackend) GetConfigurationPolicyAssociation

func (b *InMemoryBackend) GetConfigurationPolicyAssociation(
	targetID, targetType string,
) (*ConfigurationPolicyAssociation, error)

func (*InMemoryBackend) GetConnector added in v1.2.0

func (b *InMemoryBackend) GetConnector(connectorID string) (*CspmConnector, error)

GetConnector retrieves a connector by ID or ARN.

func (*InMemoryBackend) GetConnectorV2

func (b *InMemoryBackend) GetConnectorV2(connectorID string) (*ConnectorV2, error)

func (*InMemoryBackend) GetEnabledStandards

func (b *InMemoryBackend) GetEnabledStandards(
	subscriptionArns []string,
	nextToken string,
	maxResults int,
) ([]*StandardsSubscription, string)

func (*InMemoryBackend) GetFindingAggregator

func (b *InMemoryBackend) GetFindingAggregator(arn string) (*FindingAggregator, error)

func (*InMemoryBackend) GetFindingHistory

func (b *InMemoryBackend) GetFindingHistory(
	ident map[string]any,
	startTime, endTime string,
	nextToken string,
	maxResults int,
) ([]map[string]any, string)

func (*InMemoryBackend) GetFindingStatisticsV2

func (b *InMemoryBackend) GetFindingStatisticsV2(groupByAttributes []string) []map[string]any

func (*InMemoryBackend) GetFindings

func (b *InMemoryBackend) GetFindings(
	filters map[string]any,
	sortCriteria []map[string]any,
	nextToken string,
	maxResults int,
) ([]map[string]any, string)

func (*InMemoryBackend) GetFindingsTrendsV2

func (b *InMemoryBackend) GetFindingsTrendsV2(
	groupByAttribute string,
	startTime, endTime string,
) []map[string]any

func (*InMemoryBackend) GetFindingsV2

func (b *InMemoryBackend) GetFindingsV2(
	filters map[string]any,
	sortCriteria []map[string]any,
	nextToken string,
	maxResults int,
) ([]map[string]any, string)

func (*InMemoryBackend) GetInsightResults

func (b *InMemoryBackend) GetInsightResults(insightArn string) (*InsightResults, error)

func (*InMemoryBackend) GetInsights

func (b *InMemoryBackend) GetInsights(
	insightArns []string,
	nextToken string,
	maxResults int,
) ([]*Insight, string, error)

func (*InMemoryBackend) GetInvitationsCount

func (b *InMemoryBackend) GetInvitationsCount() int

func (*InMemoryBackend) GetMasterAccount

func (b *InMemoryBackend) GetMasterAccount() (*AdminAccount, error)

func (*InMemoryBackend) GetMembers

func (b *InMemoryBackend) GetMembers(accountIDs []string) ([]*Member, []map[string]any)

func (*InMemoryBackend) GetRecommendedPolicyV2

func (b *InMemoryBackend) GetRecommendedPolicyV2(metadataUID string) (*RecommendedPolicyV2, error)

func (*InMemoryBackend) GetResourcesStatisticsV2

func (b *InMemoryBackend) GetResourcesStatisticsV2(groupByAttributes []string) []map[string]any

func (*InMemoryBackend) GetResourcesTrendsV2

func (b *InMemoryBackend) GetResourcesTrendsV2(
	groupByAttribute string,
	startTime, endTime string,
) []map[string]any

func (*InMemoryBackend) GetResourcesV2

func (b *InMemoryBackend) GetResourcesV2(
	filters map[string]any,
	nextToken string,
	maxResults int,
) ([]map[string]any, string)

func (*InMemoryBackend) GetSecurityControlDefinition

func (b *InMemoryBackend) GetSecurityControlDefinition(securityControlID string) (*SecurityControlDefinition, error)

func (*InMemoryBackend) ImportFindings

func (b *InMemoryBackend) ImportFindings(findings []map[string]any) (int, int, []map[string]any)

func (*InMemoryBackend) InviteMembers

func (b *InMemoryBackend) InviteMembers(accountIDs []string) []map[string]any

func (*InMemoryBackend) ListAggregatorsV2

func (b *InMemoryBackend) ListAggregatorsV2(nextToken string, maxResults int) ([]*AggregatorV2, string)

func (*InMemoryBackend) ListAutomationRules

func (b *InMemoryBackend) ListAutomationRules(nextToken string, maxResults int) ([]*AutomationRuleMetadata, string)

func (*InMemoryBackend) ListAutomationRulesV2

func (b *InMemoryBackend) ListAutomationRulesV2(nextToken string, maxResults int) ([]*AutomationRuleV2, string)

func (*InMemoryBackend) ListConfigurationPolicies

func (b *InMemoryBackend) ListConfigurationPolicies(nextToken string, maxResults int) ([]*ConfigurationPolicy, string)

func (*InMemoryBackend) ListConfigurationPolicyAssociations

func (b *InMemoryBackend) ListConfigurationPolicyAssociations(
	filterPolicyID, filterType, nextToken string,
	maxResults int,
) ([]*ConfigurationPolicyAssociation, string)

func (*InMemoryBackend) ListConnectors added in v1.2.0

func (b *InMemoryBackend) ListConnectors(
	connectorStatus, enablementStatus, providerName, nextToken string,
	maxResults int,
) ([]*CspmConnector, string)

ListConnectors lists connectors, optionally filtered by connectivity status, enablement status, and/or provider name -- the same three filters the real ListConnectorsInput exposes as query parameters.

func (*InMemoryBackend) ListConnectorsV2

func (b *InMemoryBackend) ListConnectorsV2(nextToken string, maxResults int) ([]*ConnectorV2, string)

func (*InMemoryBackend) ListEnabledProductsForImport

func (b *InMemoryBackend) ListEnabledProductsForImport(nextToken string, maxResults int) ([]string, string)

func (*InMemoryBackend) ListFindingAggregators

func (b *InMemoryBackend) ListFindingAggregators(nextToken string, maxResults int) ([]*FindingAggregator, string)

func (*InMemoryBackend) ListInvitations

func (b *InMemoryBackend) ListInvitations(nextToken string, maxResults int) ([]*Invitation, string)

func (*InMemoryBackend) ListMembers

func (b *InMemoryBackend) ListMembers(onlyAssociated bool, nextToken string, maxResults int) ([]*Member, string)

func (*InMemoryBackend) ListOrganizationAdminAccounts

func (b *InMemoryBackend) ListOrganizationAdminAccounts(nextToken string, maxResults int) ([]*OrgAdminAccount, string)

func (*InMemoryBackend) ListSecurityControlDefinitions

func (b *InMemoryBackend) ListSecurityControlDefinitions(
	_, nextToken string,
	maxResults int,
) ([]*SecurityControlDefinition, string)

func (*InMemoryBackend) ListStandardsControlAssociations

func (b *InMemoryBackend) ListStandardsControlAssociations(
	securityControlID, nextToken string,
	maxResults int,
) ([]*StandardsControlAssociation, string)

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(resourceArn string) (map[string]string, error)

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

func (*InMemoryBackend) RegisterConnectorV2

func (b *InMemoryBackend) RegisterConnectorV2(connectorID string, provider map[string]any) (*ConnectorV2, error)

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

func (*InMemoryBackend) StartConfigurationPolicyAssociation

func (b *InMemoryBackend) StartConfigurationPolicyAssociation(
	configPolicyIdentifier, targetID, targetType string,
) (*ConfigurationPolicyAssociation, error)

func (*InMemoryBackend) StartConfigurationPolicyDisassociation

func (b *InMemoryBackend) StartConfigurationPolicyDisassociation(
	configPolicyIdentifier, targetID, targetType string,
) error

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(resourceArn string, tags map[string]string) error

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(resourceArn string, tagKeys []string) error

func (*InMemoryBackend) UpdateActionTarget

func (b *InMemoryBackend) UpdateActionTarget(actionTargetArn, name, description string) error

func (*InMemoryBackend) UpdateAggregatorV2

func (b *InMemoryBackend) UpdateAggregatorV2(arn, regionLinkingMode string, regions []string) (*AggregatorV2, error)

func (*InMemoryBackend) UpdateAutomationRuleV2

func (b *InMemoryBackend) UpdateAutomationRuleV2(
	identifier string,
	updates map[string]any,
) (*AutomationRuleV2, error)

func (*InMemoryBackend) UpdateConfigurationPolicy

func (b *InMemoryBackend) UpdateConfigurationPolicy(
	identifier, name, description string,
	policy map[string]any,
) (*ConfigurationPolicy, error)

func (*InMemoryBackend) UpdateConnector added in v1.2.0

func (b *InMemoryBackend) UpdateConnector(
	connectorID, description string,
	provider map[string]any,
) (*CspmConnector, error)

UpdateConnector updates a connector's description and/or provider scope configuration (AzureRegions/ScopeConfiguration -- the real AzureUpdateConfiguration shape has no AWSConfigConnectorArn field, so that value is always preserved from the original CreateConnector call, merged with the new fields rather than replaced wholesale).

A configuration change requires re-validation against the provider, so the connector's EnablementStatus moves to PENDING_UPDATE. As with CreateConnector, there is no out-of-band signal this mock can observe to advance it back to ENABLED, so it is left at PENDING_UPDATE -- see CreateConnector's doc comment for the same honest-lifecycle rationale.

func (*InMemoryBackend) UpdateConnectorV2

func (b *InMemoryBackend) UpdateConnectorV2(
	connectorID, name, description string,
	provider map[string]any,
) (*ConnectorV2, error)

func (*InMemoryBackend) UpdateFindingAggregator

func (b *InMemoryBackend) UpdateFindingAggregator(
	arn, regionLinkingMode string,
	regions []string,
) (*FindingAggregator, error)

func (*InMemoryBackend) UpdateFindings

func (b *InMemoryBackend) UpdateFindings(filters map[string]any, note map[string]any, recordState string) error

func (*InMemoryBackend) UpdateHubConfiguration

func (b *InMemoryBackend) UpdateHubConfiguration(
	autoEnableControls *bool,
	autoEnableStandards *string,
	controlFindingGenerator *string,
) error

func (*InMemoryBackend) UpdateInsight

func (b *InMemoryBackend) UpdateInsight(insightArn, name, groupByAttribute string, filters map[string]any) error

func (*InMemoryBackend) UpdateOrganizationConfiguration

func (b *InMemoryBackend) UpdateOrganizationConfiguration(
	autoEnable bool,
	autoEnableStandards string,
	orgConfigType string,
) error

func (*InMemoryBackend) UpdateSecurityControl

func (b *InMemoryBackend) UpdateSecurityControl(
	securityControlID string,
	parameters map[string]any,
	_ string,
) error

func (*InMemoryBackend) UpdateStandardsControl

func (b *InMemoryBackend) UpdateStandardsControl(controlArn, controlStatus, disabledReason string) error

type Insight

type Insight struct {
	Filters          map[string]any `json:"Filters"`
	InsightArn       string         `json:"InsightArn"`
	Name             string         `json:"Name"`
	GroupByAttribute string         `json:"GroupByAttribute"`
}

Insight represents a SecurityHub insight.

type InsightResults

type InsightResults struct {
	InsightArn       string
	GroupByAttribute string
	ResultValues     []map[string]any
}

InsightResults holds GetInsightResults response data.

type Invitation

type Invitation struct {
	AccountId    string `json:"AccountId"`    //nolint:revive,staticcheck // existing issue.
	InvitationId string `json:"InvitationId"` //nolint:revive,staticcheck // existing issue.
	InvitedAt    string `json:"InvitedAt"`
	MemberStatus string `json:"MemberStatus"`
}

Invitation represents a pending invitation.

type Member

type Member struct {
	AccountId       string `json:"AccountId"`       //nolint:revive,staticcheck // existing issue.
	AdministratorId string `json:"AdministratorId"` //nolint:revive,staticcheck // existing issue.
	MasterId        string `json:"MasterId"`        // deprecated alias //nolint:revive,staticcheck // existing issue.
	Email           string `json:"Email"`
	MemberStatus    string `json:"MemberStatus"`
	InvitedAt       string `json:"InvitedAt"`
	UpdatedAt       string `json:"UpdatedAt"`
}

Member represents a Security Hub member account.

type OrgAdminAccount

type OrgAdminAccount struct {
	AccountId string `json:"AccountId"` //nolint:revive,staticcheck // existing issue.
	Status    string `json:"Status"`
}

OrgAdminAccount represents an organization admin account.

type OrgConfig

type OrgConfig struct {
	AutoEnableStandards           string `json:"AutoEnableStandards"`
	OrganizationConfigurationType string `json:"OrganizationConfigurationType"`
	AutoEnable                    bool   `json:"AutoEnable"`
	MemberAccountLimitReached     bool   `json:"MemberAccountLimitReached"`
}

OrgConfig represents the organization configuration.

type Product

type Product struct {
	ProductArn                        string
	ProductName                       string
	CompanyName                       string
	Description                       string
	MarketplaceURL                    string
	ActivationURL                     string
	ProductSubscriptionResourcePolicy string
	Categories                        []string
	IntegrationTypes                  []string
}

Product represents an integration product.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS SecurityHub.

func (*Provider) Init

Init initializes the SecurityHub service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type RecommendedPolicyV2

type RecommendedPolicyV2 struct {
	MetadataUid    string `json:"MetadataUid"` //nolint:revive,staticcheck // existing issue.
	Policy         string `json:"Policy"`
	GenerationTime string `json:"GenerationTime"`
}

RecommendedPolicyV2 represents a recommended IAM policy.

type SecurityControl

type SecurityControl struct {
	SecurityControlID     string
	SecurityControlArn    string
	Title                 string
	Description           string
	RemediationURL        string
	SeverityRating        string
	SecurityControlStatus string
	UpdateStatus          string
	Parameters            map[string]any
	LastUpdateReason      string
}

SecurityControl represents the current state of a security control.

type SecurityControlDefinition

type SecurityControlDefinition struct {
	ParameterDefinitions      map[string]any
	SecurityControlID         string
	Title                     string
	Description               string
	RemediationURL            string
	SeverityRating            string
	CurrentRegionAvailability string
	CustomizableProperties    []string
}

SecurityControlDefinition represents a security control definition.

type Standard

type Standard struct {
	StandardsManagedBy map[string]any
	StandardsArn       string
	Name               string
	Description        string
	EnabledByDefault   bool
}

Standard represents an available standard.

type StandardsControl

type StandardsControl struct {
	StandardsControlArn    string   `json:"StandardsControlArn"`
	ControlStatus          string   `json:"ControlStatus"`
	DisabledReason         string   `json:"DisabledReason"`
	ControlStatusUpdatedAt string   `json:"ControlStatusUpdatedAt"`
	ControlID              string   `json:"ControlId"`
	Title                  string   `json:"Title"`
	Description            string   `json:"Description"`
	RemediationURL         string   `json:"RemediationUrl"`
	SeverityRating         string   `json:"SeverityRating"`
	RelatedRequirements    []string `json:"RelatedRequirements"`
}

StandardsControl represents a control in an enabled standard.

type StandardsControlAssociation

type StandardsControlAssociation struct {
	SecurityControlID           string
	StandardsArn                string
	AssociationStatus           string
	RelatedRequirements         []string
	UpdatedAt                   string
	UpdatedReason               string
	StandardsControlTitle       string
	StandardsControlDescription string
	StandardsControlArns        []string
}

StandardsControlAssociation represents association between security control and standard.

type StandardsSubscription

type StandardsSubscription struct {
	StandardsInput           map[string]string `json:"StandardsInput"`
	StatusReason             map[string]any    `json:"StatusReason"`
	StandardsSubscriptionArn string            `json:"StandardsSubscriptionArn"`
	StandardsArn             string            `json:"StandardsArn"`
	StandardsStatus          string            `json:"StandardsStatus"`
}

StandardsSubscription represents an enabled standard.

type StorageBackend

type StorageBackend interface {
	// Hub management
	EnableHub(enableDefaultStandards bool, tags map[string]string) error
	DisableHub() error
	DescribeHub() (*Hub, error)
	UpdateHubConfiguration(autoEnableControls *bool, autoEnableStandards *string, controlFindingGenerator *string) error

	// Findings
	ImportFindings(findings []map[string]any) (int, int, []map[string]any)
	GetFindings(
		filters map[string]any,
		sortCriteria []map[string]any,
		nextToken string,
		maxResults int,
	) ([]map[string]any, string)
	UpdateFindings(filters map[string]any, note map[string]any, recordState string) error
	BatchUpdateFindings(
		findingIdentifiers []map[string]any,
		updates map[string]any,
	) ([]map[string]any, []map[string]any)
	GetFindingHistory(
		findingIdentifier map[string]any,
		startTime, endTime string,
		nextToken string,
		maxResults int,
	) ([]map[string]any, string)

	// Insights
	CreateInsight(name, groupByAttribute string, filters map[string]any) (string, error)
	GetInsights(insightArns []string, nextToken string, maxResults int) ([]*Insight, string, error)
	UpdateInsight(insightArn, name, groupByAttribute string, filters map[string]any) error
	DeleteInsight(insightArn string) (string, error)
	GetInsightResults(insightArn string) (*InsightResults, error)

	// Standards
	BatchEnableStandards(requests []map[string]any) ([]*StandardsSubscription, []map[string]any)
	BatchDisableStandards(subscriptionArns []string) ([]*StandardsSubscription, []map[string]any)
	GetEnabledStandards(subscriptionArns []string, nextToken string, maxResults int) ([]*StandardsSubscription, string)
	DescribeStandards(nextToken string, maxResults int) ([]*Standard, string)
	DescribeStandardsControls(subscriptionArn, nextToken string, maxResults int) ([]*StandardsControl, string)
	UpdateStandardsControl(controlArn, controlStatus, disabledReason string) error
	ListStandardsControlAssociations(
		securityControlID, nextToken string,
		maxResults int,
	) ([]*StandardsControlAssociation, string)
	BatchGetStandardsControlAssociations(requests []map[string]any) ([]*StandardsControlAssociation, []map[string]any)
	BatchUpdateStandardsControlAssociations(updates []map[string]any) ([]map[string]any, error)

	// Action Targets
	CreateActionTarget(name, description, id string) (string, error)
	DescribeActionTargets(actionTargetArns []string, nextToken string, maxResults int) ([]*ActionTarget, string)
	UpdateActionTarget(actionTargetArn, name, description string) error
	DeleteActionTarget(actionTargetArn string) (string, error)

	// Products
	DescribeProducts(productArn, nextToken string, maxResults int) ([]*Product, string)
	EnableImportFindingsForProduct(productArn string) (string, error)
	DisableImportFindingsForProduct(productSubscriptionArn string) error
	ListEnabledProductsForImport(nextToken string, maxResults int) ([]string, string)

	// Security Controls
	GetSecurityControlDefinition(securityControlID string) (*SecurityControlDefinition, error)
	ListSecurityControlDefinitions(
		standardsArn, nextToken string,
		maxResults int,
	) ([]*SecurityControlDefinition, string)
	BatchGetSecurityControls(securityControlIDs []string) ([]*SecurityControl, []map[string]any)
	UpdateSecurityControl(securityControlID string, parameters map[string]any, lastUpdateReason string) error

	// Automation Rules
	CreateAutomationRule(rule map[string]any) (string, string)
	ListAutomationRules(nextToken string, maxResults int) ([]*AutomationRuleMetadata, string)
	BatchGetAutomationRules(automationRulesArns []string) ([]*AutomationRule, []map[string]any)
	BatchDeleteAutomationRules(automationRulesArns []string) ([]string, []map[string]any)
	BatchUpdateAutomationRules(updates []map[string]any) ([]string, []map[string]any)

	// Tags
	TagResource(resourceArn string, tags map[string]string) error
	UntagResource(resourceArn string, tagKeys []string) error
	ListTagsForResource(resourceArn string) (map[string]string, error)

	// Members
	CreateMembers(accounts []map[string]any) ([]*Member, []map[string]any)
	DeleteMembers(accountIDs []string) ([]string, []map[string]any)
	GetMembers(accountIDs []string) ([]*Member, []map[string]any)
	InviteMembers(accountIDs []string) []map[string]any
	ListMembers(onlyAssociated bool, nextToken string, maxResults int) ([]*Member, string)
	DisassociateMembers(accountIDs []string) error

	// Invitations / Admin
	AcceptAdministratorInvitation(administratorID, invitationID string) error
	AcceptInvitation(masterID, invitationID string) error
	DeclineInvitations(accountIDs []string) ([]map[string]any, []map[string]any)
	DeleteInvitations(accountIDs []string) ([]map[string]any, []map[string]any)
	GetInvitationsCount() int
	ListInvitations(nextToken string, maxResults int) ([]*Invitation, string)
	GetAdministratorAccount() (*AdminAccount, error)
	GetMasterAccount() (*AdminAccount, error)
	DisassociateFromAdministratorAccount() error
	DisassociateFromMasterAccount() error

	// Organization
	DescribeOrganizationConfiguration() *OrgConfig
	UpdateOrganizationConfiguration(autoEnable bool, autoEnableStandards string, orgConfigType string) error
	EnableOrganizationAdminAccount(accountID string) error
	DisableOrganizationAdminAccount(accountID string) error
	ListOrganizationAdminAccounts(nextToken string, maxResults int) ([]*OrgAdminAccount, string)

	// Finding Aggregator
	CreateFindingAggregator(regionLinkingMode string, regions []string) (*FindingAggregator, error)
	GetFindingAggregator(arn string) (*FindingAggregator, error)
	ListFindingAggregators(nextToken string, maxResults int) ([]*FindingAggregator, string)
	UpdateFindingAggregator(arn, regionLinkingMode string, regions []string) (*FindingAggregator, error)
	DeleteFindingAggregator(arn string) error

	// Configuration Policy
	CreateConfigurationPolicy(
		name, description string,
		policy map[string]any,
		tags map[string]string,
	) (*ConfigurationPolicy, error)
	GetConfigurationPolicy(identifier string) (*ConfigurationPolicy, error)
	UpdateConfigurationPolicy(identifier, name, description string, policy map[string]any) (*ConfigurationPolicy, error)
	DeleteConfigurationPolicy(identifier string) error
	ListConfigurationPolicies(nextToken string, maxResults int) ([]*ConfigurationPolicy, string)
	StartConfigurationPolicyAssociation(
		configPolicyIdentifier, targetID, targetType string,
	) (*ConfigurationPolicyAssociation, error)
	StartConfigurationPolicyDisassociation(configPolicyIdentifier, targetID, targetType string) error
	GetConfigurationPolicyAssociation(targetID, targetType string) (*ConfigurationPolicyAssociation, error)
	ListConfigurationPolicyAssociations(
		filterPolicyID, filterType, nextToken string,
		maxResults int,
	) ([]*ConfigurationPolicyAssociation, string)
	BatchGetConfigurationPolicyAssociations(
		requests []map[string]any,
	) ([]*ConfigurationPolicyAssociation, []map[string]any)

	// Hub V2
	EnableSecurityHubV2(tags map[string]string) error
	DisableSecurityHubV2() error
	DescribeSecurityHubV2() (*HubV2, error)
	EnableSecurityHubFeatureV2(featureName string) error
	DisableSecurityHubFeatureV2(featureName string) error

	// CSPM Connectors (third-party cloud provider connectors, distinct from
	// Connectors V2's ticketing-system connectors)
	CreateConnector(name, description string, provider map[string]any, tags map[string]string) (*CspmConnector, error)
	GetConnector(connectorID string) (*CspmConnector, error)
	UpdateConnector(connectorID, description string, provider map[string]any) (*CspmConnector, error)
	DeleteConnector(connectorID string) (string, error)
	ListConnectors(
		connectorStatus, enablementStatus, providerName, nextToken string,
		maxResults int,
	) ([]*CspmConnector, string)

	// Aggregator V2
	CreateAggregatorV2(regionLinkingMode string, regions []string) (*AggregatorV2, error)
	GetAggregatorV2(arn string) (*AggregatorV2, error)
	ListAggregatorsV2(nextToken string, maxResults int) ([]*AggregatorV2, string)
	UpdateAggregatorV2(arn, regionLinkingMode string, regions []string) (*AggregatorV2, error)
	DeleteAggregatorV2(arn string) error

	// Automation Rules V2
	CreateAutomationRuleV2(
		ruleName, ruleStatus, description string,
		criteria map[string]any,
		actions []map[string]any,
		ruleOrder float64,
		isTerminal bool,
		tags map[string]string,
	) (*AutomationRuleV2, error)
	GetAutomationRuleV2(identifier string) (*AutomationRuleV2, error)
	ListAutomationRulesV2(nextToken string, maxResults int) ([]*AutomationRuleV2, string)
	UpdateAutomationRuleV2(identifier string, updates map[string]any) (*AutomationRuleV2, error)
	DeleteAutomationRuleV2(identifier string) error

	// Connectors V2
	CreateConnectorV2(name, description string, provider map[string]any, tags map[string]string) (*ConnectorV2, error)
	GetConnectorV2(connectorID string) (*ConnectorV2, error)
	ListConnectorsV2(nextToken string, maxResults int) ([]*ConnectorV2, string)
	UpdateConnectorV2(connectorID, name, description string, provider map[string]any) (*ConnectorV2, error)
	DeleteConnectorV2(connectorID string) error
	RegisterConnectorV2(connectorID string, provider map[string]any) (*ConnectorV2, error)

	// Tickets V2
	CreateTicketV2(ticketConfig map[string]any, tags map[string]string) (*TicketV2, error)

	// Findings V2
	GetFindingsV2(
		filters map[string]any,
		sortCriteria []map[string]any,
		nextToken string,
		maxResults int,
	) ([]map[string]any, string)
	BatchUpdateFindingsV2(
		findingIdentifiers []map[string]any,
		metadataUids []string,
		updates map[string]any,
	) ([]map[string]any, []map[string]any)
	GetFindingStatisticsV2(groupByAttributes []string) []map[string]any
	GetFindingsTrendsV2(groupByAttribute string, startTime, endTime string) []map[string]any

	// Resources V2
	GetResourcesV2(filters map[string]any, nextToken string, maxResults int) ([]map[string]any, string)
	GetResourcesStatisticsV2(groupByAttributes []string) []map[string]any
	GetResourcesTrendsV2(groupByAttribute string, startTime, endTime string) []map[string]any

	// Products V2
	DescribeProductsV2(nextToken string, maxResults int) ([]*Product, string)

	// Recommended Policy V2
	GenerateRecommendedPolicyV2(metadataUID string) (*RecommendedPolicyV2, error)
	GetRecommendedPolicyV2(metadataUID string) (*RecommendedPolicyV2, error)

	// Metadata
	AccountID() string
	Region() string
	Reset()
	Snapshot(ctx context.Context) []byte
	Restore(ctx context.Context, data []byte) error
}

StorageBackend is the interface for SecurityHub storage operations.

type TicketV2

type TicketV2 struct {
	TicketConfigurationArn string `json:"TicketConfigurationArn"`
	CreatedAt              string `json:"CreatedAt"`
}

TicketV2 represents a Security Hub V2 ticket configuration.

Jump to

Keyboard shortcuts

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