Help us shape the future of Go! Take the 2026 Go Developer Survey

macie2

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 29 Imported by: 0

README

Macie

Parity grade: A · SDK aws-sdk-go-v2/service/macie2@v1.54.4 · last audited 2026-10-10 (22b4f068c)

Coverage

Metric Value
PARITY entries audited 81 (81 ok)
Feature families 2 (2 ok)
Known gaps none
Deferred items 0
Resource leaks clean

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotEnabled is returned when Macie is not enabled.
	ErrNotEnabled = awserr.New("Macie is not enabled for this account", awserr.ErrNotFound)
	// ErrAllowListNotFound is returned when an allow list does not exist.
	ErrAllowListNotFound = notFound("allow list")
	// ErrSessionAlreadyExists is returned when Macie is already enabled.
	ErrSessionAlreadyExists = awserr.New("Macie is already enabled for this account", awserr.ErrConflict)
	// ErrAllowListAlreadyExists is returned when an allow list already exists.
	ErrAllowListAlreadyExists = conflict("an allow list with this name already exists")
	// ErrAllowListInUse is returned when a DeleteAllowList request targets an
	// allow list that a non-terminal classification job still references,
	// and the request didn't set IgnoreJobChecks.
	ErrAllowListInUse = conflict("the allow list is used by an active classification job")
	// ErrCustomDataIDNotFound is returned when a custom data identifier does not exist.
	ErrCustomDataIDNotFound = notFound("custom data identifier")
	// ErrFindingsFilterNotFound is returned when a findings filter does not exist.
	ErrFindingsFilterNotFound = notFound("findings filter")
	// ErrFindingNotFound is returned when a finding does not exist.
	ErrFindingNotFound = notFound("finding")
	// ErrTaggedResourceNotFound is returned when a tag operation targets an unknown resource ARN.
	ErrTaggedResourceNotFound = notFound("resource")
	// ErrValidation is returned on invalid input.
	ErrValidation = awserr.New("The request contains invalid input", awserr.ErrInvalidParameter)
	// ErrRevealNotClassification is returned when GetSensitiveDataOccurrences
	// targets a finding whose category isn't CLASSIFICATION.
	ErrRevealNotClassification = awserr.New("The finding does not support revealing data", awserr.ErrInvalidParameter)
	// ErrRevealNotEnabled is returned when GetSensitiveDataOccurrences is
	// called while Macie or the reveal configuration isn't enabled.
	ErrRevealNotEnabled = awserr.New("Macie or reveal is not enabled", awserr.ErrInvalidParameter)
)
View Source
var (
	// ErrClassificationJobNotFound is returned when a classification job does not exist.
	ErrClassificationJobNotFound = notFound("classification job")
	// ErrMemberNotFound is returned when a member does not exist.
	ErrMemberNotFound = notFound("member")
	// ErrMemberAlreadyExists is returned when a member already exists.
	ErrMemberAlreadyExists = conflict("the member account already exists")
	// ErrInvitationNotFound is returned when an invitation does not exist.
	ErrInvitationNotFound = notFound("invitation")
	// ErrOrgAdminNotFound is returned when an org admin account does not exist.
	ErrOrgAdminNotFound = notFound("organization admin account")
	// ErrClassificationScopeNotFound is returned when a classification scope does not exist.
	ErrClassificationScopeNotFound = notFound("classification scope")
	// ErrSensitivityTemplateNotFound is returned when a sensitivity inspection template does not exist.
	ErrSensitivityTemplateNotFound = notFound("sensitivity inspection template")
	// ErrJobStatusTransition is returned when UpdateClassificationJob's requested
	// JobStatus isn't valid for the job's current status (api_op_UpdateClassificationJob.go).
	ErrJobStatusTransition = conflict("the requested status is not valid for the job's current status")
)
View Source
var ErrNilAppContext = errors.New("macie2: nil app context")

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

View Source
var ErrTokenReused = awserr.New("the client token was already used with different parameters", awserr.ErrConflict)

ErrTokenReused is a clientToken reused with different parameters.

Functions

This section is empty.

Types

type AdministratorAccount

type AdministratorAccount struct {
	AccountID          string    `json:"accountId"`
	InvitationID       string    `json:"invitationId"`
	InvitedAt          time.Time `json:"invitedAt"`
	RelationshipStatus string    `json:"relationshipStatus"`
}

AdministratorAccount represents the administrator account relationship.

type AffectedS3Bucket added in v1.2.0

type AffectedS3Bucket struct {
	Arn  string `json:"arn,omitempty"`
	Name string `json:"name,omitempty"`
}

AffectedS3Bucket is the bucket-level detail of ResourcesAffected.

type AffectedS3Object added in v1.2.0

type AffectedS3Object struct {
	BucketArn string `json:"bucketArn,omitempty"`
	Key       string `json:"key,omitempty"`
	Path      string `json:"path,omitempty"`
}

AffectedS3Object is the object-level detail of ResourcesAffected.

type AllowListCriteria

type AllowListCriteria struct {
	Regex       *string      `json:"regex,omitempty"`
	S3WordsList *S3WordsList `json:"s3WordsList,omitempty"`
}

AllowListCriteria holds criteria for an allow list.

type AllowListDetail

type AllowListDetail struct {
	CreatedAt   time.Time         `json:"createdAt"`
	UpdatedAt   time.Time         `json:"updatedAt"`
	Tags        map[string]string `json:"tags,omitempty"`
	Criteria    AllowListCriteria `json:"criteria"`
	Status      AllowListStatus   `json:"status"`
	Arn         string            `json:"arn"`
	Description string            `json:"description,omitempty"`
	ID          string            `json:"id"`
	Name        string            `json:"name"`
}

AllowListDetail is the full detail view of an allow list.

type AllowListStatus

type AllowListStatus struct {
	Code        string `json:"code"`
	Description string `json:"description,omitempty"`
}

AllowListStatus describes the status of an allow list.

type AllowListSummary

type AllowListSummary struct {
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
	Arn         string    `json:"arn"`
	Description string    `json:"description,omitempty"`
	ID          string    `json:"id"`
	Name        string    `json:"name"`
}

AllowListSummary is the summary view of an allow list (types.AllowListSummary, 6 of 6 members per its deserializer's case list -- no tags, unlike AllowListDetail/GetAllowListOutput).

type AutoDiscoveryAccount

type AutoDiscoveryAccount struct {
	AccountID string `json:"accountId"`
	Email     string `json:"email,omitempty"`
	Status    string `json:"status"`
}

AutoDiscoveryAccount holds automated discovery status for an account.

type AutoDiscoveryAccountUpdate

type AutoDiscoveryAccountUpdate struct {
	AccountID string `json:"accountId"`
	Status    string `json:"status"`
}

AutoDiscoveryAccountUpdate is a requested status change for an account.

type AutoDiscoveryConfig

type AutoDiscoveryConfig struct {
	AutoEnableOrganizationMembers string `json:"autoEnableOrganizationMembers,omitempty"`
	Status                        string `json:"status"`
}

AutoDiscoveryConfig holds automated discovery configuration.

type BucketCriterion

type BucketCriterion struct {
	Prefix *string
	Gt     *int64
	Gte    *int64
	Lt     *int64
	Lte    *int64
	Eq     []string
	Neq    []string
}

BucketCriterion mirrors types.BucketCriteriaAdditionalProperties -- the real per-property operator set (eq/neq/prefix string-valued, gt/gte/lt/lte int64-valued), confirmed against aws-sdk-go-v2/service/macie2@v1.54.4/serializers.go:6840 (awsRestjson1_serializeDocumentBucketCriteriaAdditionalProperties).

type BucketSortCriteria

type BucketSortCriteria struct {
	AttributeName string
	OrderBy       string
}

BucketSortCriteria mirrors types.BucketSortCriteria.

type ClassificationDetails added in v1.2.0

type ClassificationDetails struct {
	Result     *ClassificationResult `json:"result,omitempty"`
	JobArn     string                `json:"jobArn,omitempty"`
	JobID      string                `json:"jobId,omitempty"`
	OriginType string                `json:"originType,omitempty"`
}

ClassificationDetails describes how a sensitive-data finding was produced. Nil for policy findings.

type ClassificationExportConfig

type ClassificationExportConfig struct {
	S3Destination *ClassificationExportS3Dest `json:"s3Destination,omitempty"`
}

ClassificationExportConfig holds classification result export configuration.

type ClassificationExportS3Dest

type ClassificationExportS3Dest struct {
	BucketName string `json:"bucketName"`
	KeyPrefix  string `json:"keyPrefix,omitempty"`
	KmsKeyArn  string `json:"kmsKeyArn,omitempty"`
}

ClassificationExportS3Dest holds S3 destination details.

type ClassificationJob

type ClassificationJob struct {
	Tags                          map[string]string      `json:"tags,omitempty"`
	S3JobDefinition               map[string]any         `json:"s3JobDefinition,omitempty"`
	ScheduleFrequency             map[string]any         `json:"scheduleFrequency,omitempty"`
	LastRunTime                   *time.Time             `json:"lastRunTime,omitempty"`
	LastRunErrorStatus            *JobLastRunErrorStatus `json:"lastRunErrorStatus,omitempty"`
	Statistics                    *JobStatistics         `json:"statistics,omitempty"`
	UserPausedDetails             *JobUserPausedDetails  `json:"userPausedDetails,omitempty"`
	CreatedAt                     time.Time              `json:"createdAt"`
	Arn                           string                 `json:"jobArn"`
	ClientToken                   string                 `json:"clientToken,omitempty"`
	Description                   string                 `json:"description,omitempty"`
	JobID                         string                 `json:"jobId"`
	JobStatus                     string                 `json:"jobStatus"`
	JobType                       string                 `json:"jobType"`
	ManagedDataIdentifierSelector string                 `json:"managedDataIdentifierSelector,omitempty"`
	Name                          string                 `json:"name"`
	AllowListIDs                  []string               `json:"allowListIds,omitempty"`
	CustomDataIdentifierIDs       []string               `json:"customDataIdentifierIds,omitempty"`
	ManagedDataIdentifierIDs      []string               `json:"managedDataIdentifierIds,omitempty"`
	SamplingPercentage            int32                  `json:"samplingPercentage"`
	InitialRun                    bool                   `json:"initialRun"`
}

ClassificationJob represents a Macie classification job.

type ClassificationJobSummary

type ClassificationJobSummary struct {
	BucketCriteria     any                    `json:"bucketCriteria,omitempty"`
	BucketDefinitions  any                    `json:"bucketDefinitions,omitempty"`
	LastRunErrorStatus *JobLastRunErrorStatus `json:"lastRunErrorStatus,omitempty"`
	UserPausedDetails  *JobUserPausedDetails  `json:"userPausedDetails,omitempty"`
	CreatedAt          time.Time              `json:"createdAt"`
	JobID              string                 `json:"jobId"`
	JobStatus          string                 `json:"jobStatus"`
	JobType            string                 `json:"jobType"`
	Name               string                 `json:"name"`
}

ClassificationJobSummary is the list-view of a classification job. ClassificationJobSummary mirrors types.JobSummary (9 of 9 members per its deserializer's case list) -- no tags/description/lastRunTime, unlike the full ClassificationJob/DescribeClassificationJobOutput shape.

type ClassificationResult added in v1.2.0

type ClassificationResult struct {
	Status         *ClassificationResultStatus `json:"status,omitempty"`
	MimeType       string                      `json:"mimeType,omitempty"`
	SizeClassified int64                       `json:"sizeClassified,omitempty"`
}

ClassificationResult holds the status and other details of a sensitive data finding.

type ClassificationResultStatus added in v1.2.0

type ClassificationResultStatus struct {
	Code   string `json:"code,omitempty"`
	Reason string `json:"reason,omitempty"`
}

ClassificationResultStatus holds the status of a classification result.

type ClassificationScope

type ClassificationScope struct {
	Tags      map[string]string      `json:"tags,omitempty"`
	S3        *ClassificationScopeS3 `json:"s3,omitempty"`
	CreatedAt time.Time              `json:"createdAt"`
	UpdatedAt time.Time              `json:"updatedAt"`
	ID        string                 `json:"id"`
	Name      string                 `json:"name"`
}

ClassificationScope represents a classification scope resource.

type ClassificationScopeS3

type ClassificationScopeS3 struct {
	Excludes *ClassificationScopeS3Exclusion `json:"excludes"`
}

ClassificationScopeS3 holds S3 exclusion criteria (types.S3ClassificationScope, GetClassificationScopeOutput.S3). Excludes has no omitempty: it's "This member is required" on the real wire (macie2@v1.54.4 types/types.go:2532) -- every classification scope has one, even a freshly-created default scope with an empty exclusion list, so it must always be present as excludes: {bucketNames: []}, not omitted.

type ClassificationScopeS3Exclusion added in v1.5.0

type ClassificationScopeS3Exclusion struct {
	BucketNames []string `json:"bucketNames"`
}

ClassificationScopeS3Exclusion is the excluded-bucket list (types.S3ClassificationScopeExclusion).

type ClassificationScopeS3ExclusionUpdate added in v1.5.0

type ClassificationScopeS3ExclusionUpdate struct {
	Operation   string   `json:"operation"`
	BucketNames []string `json:"bucketNames"`
}

ClassificationScopeS3ExclusionUpdate mirrors types.S3ClassificationScopeExclusionUpdate. Operation is one of ADD/REMOVE/REPLACE (macie2@v1.54.4 types.ClassificationScopeUpdateOperation).

type ClassificationScopeS3Update added in v1.5.0

type ClassificationScopeS3Update struct {
	Excludes *ClassificationScopeS3ExclusionUpdate `json:"excludes,omitempty"`
}

ClassificationScopeS3Update is UpdateClassificationScopeInput's S3 shape (types.S3ClassificationScopeUpdate) -- distinct from ClassificationScopeS3 because real AWS adds/removes/replaces bucket names via an explicit Operation discriminator rather than accepting a full replacement list (gopherstack-c8ge).

type ClassificationScopeSummary

type ClassificationScopeSummary struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

ClassificationScopeSummary is the list-view of a classification scope.

type CustomDataIdentifier

type CustomDataIdentifier struct {
	CreatedAt            time.Time         `json:"createdAt"`
	Tags                 map[string]string `json:"tags,omitempty"`
	Arn                  string            `json:"arn"`
	Description          string            `json:"description,omitempty"`
	ID                   string            `json:"id"`
	Name                 string            `json:"name"`
	Regex                string            `json:"regex"`
	IgnoreWords          []string          `json:"ignoreWords,omitempty"`
	Keywords             []string          `json:"keywords,omitempty"`
	SeverityLevels       []SeverityLevel   `json:"severityLevels,omitempty"`
	MaximumMatchDistance int32             `json:"maximumMatchDistance"`
	// Deleted reflects real GetCustomDataIdentifierOutput/
	// BatchGetCustomDataIdentifierSummary soft-delete semantics: Amazon Macie
	// never hard-deletes a custom data identifier, so Get/BatchGet keep
	// returning it (with deleted:true) after DeleteCustomDataIdentifier.
	Deleted bool `json:"deleted"`
}

CustomDataIdentifier represents a custom data identifier.

type CustomDataIdentifierSummary

type CustomDataIdentifierSummary struct {
	Arn         string    `json:"arn"`
	CreatedAt   time.Time `json:"createdAt"`
	Description string    `json:"description,omitempty"`
	ID          string    `json:"id"`
	Name        string    `json:"name"`
}

CustomDataIdentifierSummary is the summary view of a custom data identifier.

type Finding

type Finding struct {
	CreatedAt             time.Time              `json:"createdAt"`
	UpdatedAt             time.Time              `json:"updatedAt"`
	ClassificationDetails *ClassificationDetails `json:"classificationDetails,omitempty"`
	ResourcesAffected     *ResourcesAffected     `json:"resourcesAffected,omitempty"`
	PolicyDetails         *PolicyDetails         `json:"policyDetails,omitempty"`
	AccountID             string                 `json:"accountId"`
	Category              string                 `json:"category"`
	Description           string                 `json:"description"`
	ID                    string                 `json:"id"`
	Partition             string                 `json:"partition,omitempty"`
	Region                string                 `json:"region"`
	SchemaVersion         string                 `json:"schemaVersion,omitempty"`
	Title                 string                 `json:"title"`
	Type                  string                 `json:"type"`
	Severity              Severity               `json:"severity"`
	Count                 int64                  `json:"count"`
	Archived              bool                   `json:"archived"`
	Sample                bool                   `json:"sample"`
}

Finding represents a Macie finding.

type FindingAction added in v1.3.4

type FindingAction struct {
	ActionType string `json:"actionType,omitempty"`
}

FindingAction specifies information about action that produced finding.

type FindingActor added in v1.3.4

type FindingActor struct {
	UserIdentity *UserIdentity `json:"userIdentity,omitempty"`
}

FindingActor provides information about an entity that performed action.

type FindingSortCriteria

type FindingSortCriteria struct {
	AttributeName string
	OrderBy       string
}

FindingSortCriteria mirrors types.SortCriteria for ListFindings. Only the AttributeName values backed by this model's fields are honored -- resourcesAffected and policyDetails.action.apiCallDetails.firstSeen/ lastSeen are documented AttributeName values (types.SortCriteria doc comment) this backend has no comparable scalar for, so sorting by them is left a no-op rather than inventing an ordering.

type FindingStatisticsGroup

type FindingStatisticsGroup struct {
	GroupKey string `json:"groupKey"`
	Count    int64  `json:"count"`
}

FindingStatisticsGroup holds a group of finding statistics.

type FindingType

type FindingType string

FindingType represents the type of a finding.

type FindingsFilterDetail

type FindingsFilterDetail struct {
	FindingCriteria map[string]any    `json:"findingCriteria,omitempty"`
	Tags            map[string]string `json:"tags,omitempty"`
	Action          string            `json:"action"`
	Arn             string            `json:"arn"`
	Description     string            `json:"description,omitempty"`
	ID              string            `json:"id"`
	Name            string            `json:"name"`
	Position        int32             `json:"position"`
}

FindingsFilterDetail is the full detail of a findings filter.

type FindingsFilterListItem

type FindingsFilterListItem struct {
	Tags   map[string]string `json:"tags,omitempty"`
	Action string            `json:"action"`
	Arn    string            `json:"arn"`
	ID     string            `json:"id"`
	Name   string            `json:"name"`
}

FindingsFilterListItem mirrors types.FindingsFilterListItem (5 of 5 members per its deserializer's case list) -- the real ListFindingsFilters element shape, narrower than FindingsFilterSummary: no description/position.

type FindingsFilterSummary

type FindingsFilterSummary struct {
	Tags        map[string]string `json:"tags,omitempty"`
	Action      string            `json:"action"`
	Arn         string            `json:"arn"`
	Description string            `json:"description,omitempty"`
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Position    int32             `json:"position"`
}

FindingsFilterSummary is the internal domain view of a findings filter -- carries Description/Position (needed by Create/Update's return value and ListFindingsFilters' Position-based sort) that the real wire type for ListFindingsFilters (types.FindingsFilterListItem) does not have. Never marshaled directly; see FindingsFilterListItem for the wire projection.

type FindingsPublicationConfig

type FindingsPublicationConfig struct {
	SecurityHubConfiguration *SecurityHubConfig `json:"securityHubConfiguration,omitempty"`
	ClientToken              string             `json:"clientToken,omitempty"`
}

FindingsPublicationConfig holds findings publication configuration. PublishClassificationFindings/PublishPolicyFindings live only on SecurityHubConfiguration -- neither PutFindingsPublicationConfigurationInput nor GetFindingsPublicationConfigurationOutput has a top-level member of either name (confirmed against aws-sdk-go-v2/service/macie2's api_op_PutFindingsPublicationConfiguration.go/ api_op_GetFindingsPublicationConfiguration.go); a prior pass fabricated both here, always emitted (no omitempty), on every response.

type Handler

type Handler struct {
	Backend StorageBackend
	// contains filtered or unexported fields
}

Handler handles Macie2 HTTP requests.

func NewHandler

func NewHandler(b StorageBackend) *Handler

NewHandler constructs a new Handler.

func (*Handler) BackendFor

func (h *Handler) BackendFor(region string) StorageBackend

BackendFor returns the backend serving region: the home backend, or the sibling built on first use.

func (*Handler) EnableRegions

func (h *Handler) EnableRegions()

EnableRegions makes h serve every other region through lazily built per-region siblings.

func (*Handler) ExtractOperation

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

ExtractOperation extracts the operation name from the request.

func (*Handler) ExtractResource

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

ExtractResource extracts the resource identifier from the request.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations returns the list of supported operations.

func (*Handler) Handler

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

Handler serves each request from the handler of its region.

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) RegionBackends

func (h *Handler) RegionBackends() []StorageBackend

RegionBackends returns the home backend followed by every sibling built so far.

func (*Handler) RegionHandler

func (h *Handler) RegionHandler(region string) *Handler

RegionHandler returns the handler serving region: h itself for the home region, else its sibling.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears every region.

func (*Handler) Restore

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

Restore implements persistence.Persistable.

func (*Handler) RouteMatcher

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

RouteMatcher returns a function that matches Macie2 requests by path prefix.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable; other regions ride in an additive "regions" key.

type InMemoryBackend

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

InMemoryBackend implements StorageBackend using in-memory maps.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend constructs a new InMemoryBackend.

func (*InMemoryBackend) AcceptInvitation

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

AcceptInvitation accepts a Macie invitation.

func (*InMemoryBackend) AccountID

func (b *InMemoryBackend) AccountID() string

AccountID returns the account ID.

func (*InMemoryBackend) AddS3Bucket

func (b *InMemoryBackend) AddS3Bucket(bucket S3BucketMetadata)

AddS3Bucket seeds an S3 bucket into the backend for DescribeBuckets.

func (*InMemoryBackend) BatchGetCustomDataIdentifiers

func (b *InMemoryBackend) BatchGetCustomDataIdentifiers(ids []string) ([]*CustomDataIdentifier, error)

BatchGetCustomDataIdentifiers returns full details for the given IDs. Like GetCustomDataIdentifier, soft-deleted identifiers are still returned (with deleted:true); only genuinely unknown IDs are omitted (and reported by the caller via notFoundIdentifierIds).

func (*InMemoryBackend) BatchUpdateAutomatedDiscoveryAccounts

func (b *InMemoryBackend) BatchUpdateAutomatedDiscoveryAccounts(updates []AutoDiscoveryAccountUpdate) error

BatchUpdateAutomatedDiscoveryAccounts updates automated discovery status for multiple accounts.

func (*InMemoryBackend) CreateAllowList

func (b *InMemoryBackend) CreateAllowList(
	name, description string,
	criteria AllowListCriteria,
	tags map[string]string,
) (*AllowListSummary, error)

CreateAllowList creates a new allow list.

func (*InMemoryBackend) CreateClassificationJob

func (b *InMemoryBackend) CreateClassificationJob(
	name, description, jobType, clientToken string,
	s3JobDefinition, scheduleFrequency map[string]any,
	allowListIDs, customDataIdentifierIDs, managedDataIdentifierIDs []string,
	managedDataIdentifierSelector string,
	tags map[string]string,
	samplingPercentage int32,
	initialRun bool,
) (string, string, error)

CreateClassificationJob creates a new classification job.

func (*InMemoryBackend) CreateCustomDataIdentifier

func (b *InMemoryBackend) CreateCustomDataIdentifier(
	name, description, regex string,
	ignoreWords, keywords []string,
	severityLevels []SeverityLevel,
	maxMatchDistance *int32,
	tags map[string]string,
) (string, error)

CreateCustomDataIdentifier creates a new custom data identifier.

func (*InMemoryBackend) CreateFindingsFilter

func (b *InMemoryBackend) CreateFindingsFilter(
	name, description, action string,
	position *int32,
	criteria map[string]any,
	tags map[string]string,
) (*FindingsFilterSummary, error)

CreateFindingsFilter creates a new findings filter.

func (*InMemoryBackend) CreateInvitations

func (b *InMemoryBackend) CreateInvitations(
	accountIDs []string, _ string, _ bool,
) ([]UnprocessedAccount, error)

CreateInvitations creates invitations for the given account IDs.

func (*InMemoryBackend) CreateMember

func (b *InMemoryBackend) CreateMember(accountID, email string, tags map[string]string) error

CreateMember creates a new member account relationship.

func (*InMemoryBackend) CreateSampleFindings

func (b *InMemoryBackend) CreateSampleFindings(findingTypes []string) error

CreateSampleFindings creates sample findings. Real Macie's sample findings use realistic example resource/classification data rather than empty fields, so this populates the same category-appropriate ResourcesAffected/ ClassificationDetails shape a live scan would produce.

func (*InMemoryBackend) DeclineInvitations

func (b *InMemoryBackend) DeclineInvitations(accountIDs []string) ([]UnprocessedAccount, error)

DeclineInvitations marks invitations from the given accounts as declined.

func (*InMemoryBackend) DeleteAllowList

func (b *InMemoryBackend) DeleteAllowList(id string, ignoreJobChecks bool) error

DeleteAllowList deletes an allow list. Unless ignoreJobChecks is set, the delete is rejected if a classification job with a non-terminal status still references the list.

func (*InMemoryBackend) DeleteCustomDataIdentifier

func (b *InMemoryBackend) DeleteCustomDataIdentifier(id string) error

DeleteCustomDataIdentifier soft-deletes a custom data identifier.

func (*InMemoryBackend) DeleteFindingsFilter

func (b *InMemoryBackend) DeleteFindingsFilter(id string) error

DeleteFindingsFilter deletes a findings filter.

func (*InMemoryBackend) DeleteInvitations

func (b *InMemoryBackend) DeleteInvitations(accountIDs []string) ([]UnprocessedAccount, error)

DeleteInvitations removes invitations from the given accounts.

func (*InMemoryBackend) DeleteMember

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

DeleteMember removes a member account.

func (*InMemoryBackend) DescribeBuckets

func (b *InMemoryBackend) DescribeBuckets(
	criteria map[string]BucketCriterion, sortBy *BucketSortCriteria, token string, limit int,
) ([]map[string]any, string, error)

DescribeBuckets returns a page of S3 bucket metadata, filtered by criteria and sorted by sortBy.

func (*InMemoryBackend) DescribeClassificationJob

func (b *InMemoryBackend) DescribeClassificationJob(jobID string) (*ClassificationJob, error)

DescribeClassificationJob returns a classification job by ID.

func (*InMemoryBackend) DescribeOrganizationConfiguration

func (b *InMemoryBackend) DescribeOrganizationConfiguration() (*OrgConfig, error)

DescribeOrganizationConfiguration returns the org-level Macie configuration.

func (*InMemoryBackend) DisableMacie

func (b *InMemoryBackend) DisableMacie() error

DisableMacie disables Macie and, per its own doc comment ("deletes all settings and resources for a Macie account" -- api_op_DisableMacie.go:11), clears every classification/discovery resource this account owns. Cross-account relationships (members, administrator, invitations, org config, automated-discovery account list) survive: those track organization structure, not this account's own Macie settings.

func (*InMemoryBackend) DisableOrganizationAdminAccount

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

DisableOrganizationAdminAccount removes the org admin designation.

func (*InMemoryBackend) DisassociateFromAdministratorAccount

func (b *InMemoryBackend) DisassociateFromAdministratorAccount() error

DisassociateFromAdministratorAccount removes the administrator relationship.

func (*InMemoryBackend) DisassociateFromMasterAccount

func (b *InMemoryBackend) DisassociateFromMasterAccount() error

DisassociateFromMasterAccount is the legacy alias.

func (*InMemoryBackend) DisassociateMember

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

DisassociateMember sets a member's relationship status to DISASSOCIATED.

func (*InMemoryBackend) EnableMacie

func (b *InMemoryBackend) EnableMacie(_, frequency, status string) error

EnableMacie enables Macie for the account.

func (*InMemoryBackend) EnableOrganizationAdminAccount

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

EnableOrganizationAdminAccount designates an account as org admin.

func (*InMemoryBackend) GetAdministratorAccount

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

GetAdministratorAccount returns the administrator account relationship.

func (*InMemoryBackend) GetAllowList

func (b *InMemoryBackend) GetAllowList(id string) (*AllowListDetail, error)

GetAllowList retrieves an allow list by ID.

func (*InMemoryBackend) GetAutomatedDiscoveryConfiguration

func (b *InMemoryBackend) GetAutomatedDiscoveryConfiguration() (*AutoDiscoveryConfig, error)

GetAutomatedDiscoveryConfiguration returns the automated discovery config.

func (*InMemoryBackend) GetBucketStatistics

func (b *InMemoryBackend) GetBucketStatistics(_ string) (map[string]any, error)

GetBucketStatistics returns aggregate S3 statistics computed from stored buckets.

func (*InMemoryBackend) GetClassificationExportConfiguration

func (b *InMemoryBackend) GetClassificationExportConfiguration() (*ClassificationExportConfig, error)

GetClassificationExportConfiguration returns the export config.

func (*InMemoryBackend) GetClassificationScope

func (b *InMemoryBackend) GetClassificationScope(scopeID string) (*ClassificationScope, error)

GetClassificationScope returns a classification scope by ID.

func (*InMemoryBackend) GetCustomDataIdentifier

func (b *InMemoryBackend) GetCustomDataIdentifier(id string) (*CustomDataIdentifier, error)

GetCustomDataIdentifier retrieves a custom data identifier. Real AWS soft deletes custom data identifiers (DeleteCustomDataIdentifier never removes them), so Get keeps succeeding for a deleted identifier and reports deleted:true instead of 404ing -- only an identifier that never existed 404s.

func (*InMemoryBackend) GetFindingStatistics

func (b *InMemoryBackend) GetFindingStatistics(
	groupBy string, criteria map[string]any, sortBy *FindingSortCriteria, size int,
) ([]FindingStatisticsGroup, error)

GetFindingStatistics returns statistics grouped by the given field.

func (*InMemoryBackend) GetFindings

func (b *InMemoryBackend) GetFindings(findingIDs []string, sortBy *FindingSortCriteria) ([]*Finding, error)

GetFindings retrieves findings by ID.

func (*InMemoryBackend) GetFindingsFilter

func (b *InMemoryBackend) GetFindingsFilter(id string) (*FindingsFilterDetail, error)

GetFindingsFilter retrieves a findings filter.

func (*InMemoryBackend) GetFindingsPublicationConfiguration

func (b *InMemoryBackend) GetFindingsPublicationConfiguration() (*FindingsPublicationConfig, error)

GetFindingsPublicationConfiguration returns the findings publication config.

func (*InMemoryBackend) GetInvitationsCount

func (b *InMemoryBackend) GetInvitationsCount() (int64, error)

GetInvitationsCount returns the number of active invitations.

func (*InMemoryBackend) GetMasterAccount

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

GetMasterAccount is the legacy alias for GetAdministratorAccount.

func (*InMemoryBackend) GetMember

func (b *InMemoryBackend) GetMember(accountID string) (*Member, error)

GetMember returns a member account by account ID.

func (*InMemoryBackend) GetResourceProfile

func (b *InMemoryBackend) GetResourceProfile(resourceARN string) (*ResourceProfile, error)

GetResourceProfile returns a bucket's sensitivity profile.

func (*InMemoryBackend) GetRetrievalConfiguration

func (b *InMemoryBackend) GetRetrievalConfiguration() *RetrievalConfiguration

GetRetrievalConfiguration returns the sensitive-data retrieval settings; CALLER_CREDENTIALS until configured.

func (*InMemoryBackend) GetRevealConfiguration

func (b *InMemoryBackend) GetRevealConfiguration() (*RevealConfiguration, error)

GetRevealConfiguration returns the sensitive data reveal configuration.

func (*InMemoryBackend) GetSensitiveDataOccurrences

func (b *InMemoryBackend) GetSensitiveDataOccurrences(findingID string) (map[string]any, error)

GetSensitiveDataOccurrences returns redacted occurrences for a finding.

func (*InMemoryBackend) GetSensitiveDataOccurrencesAvailability

func (b *InMemoryBackend) GetSensitiveDataOccurrencesAvailability(findingID string) (string, []string, error)

GetSensitiveDataOccurrencesAvailability reports reveal availability for a finding.

func (*InMemoryBackend) GetSensitivityInspectionTemplate

func (b *InMemoryBackend) GetSensitivityInspectionTemplate(templateID string) (*SensitivityInspectionTemplate, error)

GetSensitivityInspectionTemplate returns a sensitivity inspection template by ID.

func (*InMemoryBackend) GetSession

func (b *InMemoryBackend) GetSession() *Session

GetSession returns the current Macie session (may be nil if not enabled).

func (*InMemoryBackend) GetUsageStatistics

func (b *InMemoryBackend) GetUsageStatistics(
	_ []map[string]any, _ int, _ string, _ string,
) ([]UsageRecord, string, error)

GetUsageStatistics returns usage statistics (empty — no billing data in emulator).

func (*InMemoryBackend) GetUsageTotals

func (b *InMemoryBackend) GetUsageTotals(_ string) ([]UsageTotal, error)

GetUsageTotals returns aggregated usage totals (all zero).

func (*InMemoryBackend) ListAllowLists

func (b *InMemoryBackend) ListAllowLists(limit int, token string) ([]*AllowListSummary, string, error)

ListAllowLists returns summaries of all allow lists.

func (*InMemoryBackend) ListAutomatedDiscoveryAccounts

func (b *InMemoryBackend) ListAutomatedDiscoveryAccounts() ([]*AutoDiscoveryAccount, error)

ListAutomatedDiscoveryAccounts returns accounts with automated discovery status.

func (*InMemoryBackend) ListClassificationJobs

func (b *InMemoryBackend) ListClassificationJobs(
	filterCriteria map[string]any, sortBy *ListJobsSortCriteria, maxResults int, nextToken string,
) ([]*ClassificationJobSummary, string, error)

ListClassificationJobs returns summaries of jobs matching filterCriteria, paginated by maxResults/nextToken. filterCriteria mirrors the wire shape of types.ListJobsFilterCriteria: {"includes": [...], "excludes": [...]}, each term {"key", "comparator", "values"}. Only EQ/NE comparators are emulated (the same reduced-scope emulation as ListFindings' criteria matching) -- GT/GTE/LT/LTE/CONTAINS/STARTS_WITH terms are treated as non-filtering, not as errors.

func (*InMemoryBackend) ListClassificationScopes

func (b *InMemoryBackend) ListClassificationScopes() ([]*ClassificationScopeSummary, error)

ListClassificationScopes returns all classification scopes.

func (*InMemoryBackend) ListCustomDataIdentifiers

func (b *InMemoryBackend) ListCustomDataIdentifiers(
	limit int,
	token string,
) ([]*CustomDataIdentifierSummary, string, error)

ListCustomDataIdentifiers returns summaries of all non-deleted custom data identifiers.

func (*InMemoryBackend) ListFindings

func (b *InMemoryBackend) ListFindings(
	criteria map[string]any, sortBy *FindingSortCriteria, limit int, token string,
) ([]string, string, error)

ListFindings returns finding IDs, filtered by criteria and sorted by sortBy.

func (*InMemoryBackend) ListFindingsFilters

func (b *InMemoryBackend) ListFindingsFilters(limit int, token string) ([]*FindingsFilterSummary, string, error)

ListFindingsFilters returns summaries of all findings filters.

func (*InMemoryBackend) ListInvitations

func (b *InMemoryBackend) ListInvitations() ([]*Invitation, error)

ListInvitations returns all active invitations.

func (*InMemoryBackend) ListManagedDataIdentifiers

func (b *InMemoryBackend) ListManagedDataIdentifiers() ([]ManagedDataIdentifier, error)

ListManagedDataIdentifiers returns the built-in Macie data identifiers.

func (*InMemoryBackend) ListMembers

func (b *InMemoryBackend) ListMembers(onlyAssociated bool, limit int, token string) ([]*Member, string, error)

ListMembers returns member accounts, optionally filtered to only accounts still associated with this administrator, paginated by limit/token.

func (*InMemoryBackend) ListOrganizationAdminAccounts

func (b *InMemoryBackend) ListOrganizationAdminAccounts() ([]*OrgAdminAccount, error)

ListOrganizationAdminAccounts returns all org admin accounts.

func (*InMemoryBackend) ListResourceProfileArtifacts

func (b *InMemoryBackend) ListResourceProfileArtifacts(_ string) ([]ResourceProfileArtifact, error)

ListResourceProfileArtifacts returns classified artifacts for a bucket (always empty).

func (*InMemoryBackend) ListResourceProfileDetections

func (b *InMemoryBackend) ListResourceProfileDetections(resourceARN string) ([]ResourceProfileDetection, error)

ListResourceProfileDetections returns data identifier detections for a bucket.

func (*InMemoryBackend) ListSensitivityInspectionTemplates

func (b *InMemoryBackend) ListSensitivityInspectionTemplates() ([]*SensitivityInspectionTemplateSummary, error)

ListSensitivityInspectionTemplates returns all templates.

func (*InMemoryBackend) ListTagsForResource

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

ListTagsForResource returns the tags for a resource.

func (*InMemoryBackend) PaginationSecret

func (b *InMemoryBackend) PaginationSecret() string

PaginationSecret returns the HMAC secret signing page tokens.

func (*InMemoryBackend) PutClassificationExportConfiguration

func (b *InMemoryBackend) PutClassificationExportConfiguration(cfg *ClassificationExportConfig) error

PutClassificationExportConfiguration stores the export config.

func (*InMemoryBackend) PutFindingsPublicationConfiguration

func (b *InMemoryBackend) PutFindingsPublicationConfiguration(cfg *FindingsPublicationConfig) error

PutFindingsPublicationConfiguration stores the findings publication config.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the region.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

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

Restore deserializes backend state from JSON. It implements persistence.Persistable.

func (*InMemoryBackend) SearchResources

func (b *InMemoryBackend) SearchResources(
	bucketCriteria *SearchResourcesBucketCriteria,
	sortBy *SearchResourcesSortCriteria,
	maxResults int,
	nextToken string,
) ([]map[string]any, string, error)

SearchResources returns a page of S3 resources matching bucketCriteria, sorted by sortBy.

func (*InMemoryBackend) SetLifecycleDelay

func (b *InMemoryBackend) SetLifecycleDelay(d time.Duration)

SetLifecycleDelay overrides how long a ONE_TIME classification job stays RUNNING before it is COMPLETE; 0 keeps the built-in 5s window.

func (*InMemoryBackend) Snapshot

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

Snapshot serializes backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

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

TagResource adds or updates tags on a resource.

func (*InMemoryBackend) TaggedResources added in v1.3.1

func (b *InMemoryBackend) TaggedResources() []TaggedEntry

TaggedResources returns every Macie2 resource ARN that currently has at least one tag applied via TagResource.

func (*InMemoryBackend) TestCustomDataIdentifier

func (b *InMemoryBackend) TestCustomDataIdentifier(
	regex string,
	ignoreWords, keywords []string,
	maxMatchDistance *int32,
	sampleText string,
) (int32, error)

TestCustomDataIdentifier tests a regex against sample text.

func (*InMemoryBackend) UntagResource

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

UntagResource removes tags from a resource.

func (*InMemoryBackend) UpdateAllowList

func (b *InMemoryBackend) UpdateAllowList(
	id, name, description string,
	criteria AllowListCriteria,
) (*AllowListSummary, error)

UpdateAllowList updates an existing allow list.

func (*InMemoryBackend) UpdateAutomatedDiscoveryConfiguration

func (b *InMemoryBackend) UpdateAutomatedDiscoveryConfiguration(autoEnableMembers, status string) error

UpdateAutomatedDiscoveryConfiguration updates the automated discovery config.

func (*InMemoryBackend) UpdateClassificationJob

func (b *InMemoryBackend) UpdateClassificationJob(jobID, status string) error

UpdateClassificationJob updates a job's status. Transitioning to USER_PAUSED populates UserPausedDetails (present only in that state, per the real DescribeClassificationJobOutput/JobSummary shapes); transitioning away from it clears UserPausedDetails again.

func (*InMemoryBackend) UpdateClassificationScope

func (b *InMemoryBackend) UpdateClassificationScope(scopeID string, s3 *ClassificationScopeS3Update) error

UpdateClassificationScope applies an ADD/REMOVE/REPLACE change to a scope's excluded-bucket list. Real AWS (types.S3ClassificationScopeExclusionUpdate) never accepts a full replacement list implicitly -- Operation is a required discriminator, so wholesale-replacing the stored Excludes with whatever the request carries would silently drop every bucket name an ADD/REMOVE call didn't mention (gopherstack-c8ge).

func (*InMemoryBackend) UpdateFindingsFilter

func (b *InMemoryBackend) UpdateFindingsFilter(
	id, name, action string,
	description *string,
	position *int32,
	criteria map[string]any,
) (*FindingsFilterSummary, error)

UpdateFindingsFilter updates an existing findings filter.

func (*InMemoryBackend) UpdateMacieSession

func (b *InMemoryBackend) UpdateMacieSession(frequency, status string) error

UpdateMacieSession updates the Macie session configuration.

func (*InMemoryBackend) UpdateMemberSession

func (b *InMemoryBackend) UpdateMemberSession(accountID, status string) error

UpdateMemberSession updates the status of a member's Macie session.

func (*InMemoryBackend) UpdateOrganizationConfiguration

func (b *InMemoryBackend) UpdateOrganizationConfiguration(autoEnable bool) error

UpdateOrganizationConfiguration updates the org-level configuration.

func (*InMemoryBackend) UpdateResourceProfile

func (b *InMemoryBackend) UpdateResourceProfile(resourceARN string, sensitivityScore int32) error

UpdateResourceProfile sets a bucket's sensitivity score override.

func (*InMemoryBackend) UpdateResourceProfileDetections

func (b *InMemoryBackend) UpdateResourceProfileDetections(
	resourceARN string, suppressDataIdentifiers []map[string]any,
) error

UpdateResourceProfileDetections updates suppression status of detections.

func (*InMemoryBackend) UpdateRetrievalConfiguration

func (b *InMemoryBackend) UpdateRetrievalConfiguration(mode, roleName string) (*RetrievalConfiguration, error)

UpdateRetrievalConfiguration applies the retrieval mode; the external ID is generated on first ASSUME_ROLE.

func (*InMemoryBackend) UpdateRevealConfiguration

func (b *InMemoryBackend) UpdateRevealConfiguration(kmsKeyID, status string) error

UpdateRevealConfiguration stores the reveal configuration.

func (*InMemoryBackend) UpdateSensitivityInspectionTemplate

func (b *InMemoryBackend) UpdateSensitivityInspectionTemplate(
	templateID, name string,
	description *string,
	excludes, includes map[string]any,
) error

UpdateSensitivityInspectionTemplate updates a template. The real input (types.UpdateSensitivityInspectionTemplateInput) carries Description, Excludes, and Includes as independently-optional pointers -- a client changing only one must not wipe the other two, so each is merged only when actually provided (gopherstack-c8ge).

type Invitation

type Invitation struct {
	AccountID          string    `json:"accountId"`
	InvitationID       string    `json:"invitationId"`
	InvitedAt          time.Time `json:"invitedAt"`
	RelationshipStatus string    `json:"relationshipStatus"`
}

Invitation represents a Macie invitation.

type JobLastRunErrorStatus added in v1.2.0

type JobLastRunErrorStatus struct {
	Code string `json:"code,omitempty"`
}

JobLastRunErrorStatus indicates whether account- or bucket-level access errors occurred during a classification job's most recent run.

type JobStatistics added in v1.2.0

type JobStatistics struct {
	ApproximateNumberOfObjectsToProcess float64 `json:"approximateNumberOfObjectsToProcess"`
	NumberOfRuns                        float64 `json:"numberOfRuns"`
}

JobStatistics holds run-count and remaining-object processing stats for a classification job.

type JobUserPausedDetails added in v1.2.0

type JobUserPausedDetails struct {
	JobExpiresAt                        *time.Time `json:"jobExpiresAt,omitempty"`
	JobPausedAt                         *time.Time `json:"jobPausedAt,omitempty"`
	JobImminentExpirationHealthEventArn string     `json:"jobImminentExpirationHealthEventArn,omitempty"`
}

JobUserPausedDetails records when a job was paused by the user and when it will expire if not resumed. Present only while JobStatus is USER_PAUSED.

type ListJobsSortCriteria

type ListJobsSortCriteria struct {
	AttributeName string
	OrderBy       string
}

ListJobsSortCriteria mirrors types.ListJobsSortCriteria. AttributeName's four defined enum values (createdAt, jobStatus, name, jobType -- types/enums.go) are all backed by ClassificationJobSummary fields.

type ManagedDataIdentifier

type ManagedDataIdentifier struct {
	Category string `json:"category"`
	ID       string `json:"id"`
}

ManagedDataIdentifier describes a built-in Macie data identifier.

type Member

type Member struct {
	Tags                   map[string]string `json:"tags,omitempty"`
	InvitedAt              time.Time         `json:"invitedAt"`
	UpdatedAt              time.Time         `json:"updatedAt"`
	Arn                    string            `json:"arn"`
	AccountID              string            `json:"accountId"`
	AdministratorAccountID string            `json:"administratorAccountId,omitempty"`
	Email                  string            `json:"email"`
	MasteredBy             string            `json:"masterAccountId,omitempty"`
	RelationshipStatus     string            `json:"relationshipStatus"`
}

Member represents a Macie member account.

type OrgAdminAccount

type OrgAdminAccount struct {
	AccountID string `json:"accountId"`
	Status    string `json:"status"`
}

OrgAdminAccount represents an organization admin account.

type OrgConfig

type OrgConfig struct {
	AutoEnable             bool `json:"autoEnable"`
	MaxAccountLimitReached bool `json:"maxAccountLimitReached"`
}

OrgConfig holds organization-level Macie configuration. Matches DescribeOrganizationConfigurationOutput exactly: AutoEnable and MaxAccountLimitReached are its only two fields in the real SDK.

type PolicyDetails added in v1.3.4

type PolicyDetails struct {
	Action *FindingAction `json:"action,omitempty"`
	Actor  *FindingActor  `json:"actor,omitempty"`
}

PolicyDetails provides the details of the policy finding.

type Provider

type Provider struct{}

Provider implements service.Provider for Amazon Macie2.

func (*Provider) Init

Init initializes the Macie2 service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ResourceProfile

type ResourceProfile struct {
	Statistics                 *ResourceStatistics `json:"statistics,omitempty"`
	ResourceArn                string              `json:"resourceArn"`
	SensitivityScore           int32               `json:"sensitivityScore"`
	SensitivityScoreOverridden bool                `json:"sensitivityScoreOverridden"`
}

ResourceProfile holds sensitivity profile data for a bucket.

type ResourceProfileArtifact

type ResourceProfileArtifact struct {
	Arn       string `json:"arn"`
	Type      string `json:"type,omitempty"`
	Sensitive bool   `json:"sensitive"`
}

ResourceProfileArtifact is a single artifact in a resource profile.

type ResourceProfileDetection

type ResourceProfileDetection struct {
	Arn        string `json:"arn,omitempty"`
	ID         string `json:"id,omitempty"`
	Name       string `json:"name,omitempty"`
	Type       string `json:"type,omitempty"`
	Count      int64  `json:"count"`
	Suppressed bool   `json:"suppressed"`
}

ResourceProfileDetection is a data identifier detection result.

type ResourceStatistics

type ResourceStatistics struct {
	LastRunErroredAt                   *time.Time `json:"lastRunErroredAt,omitempty"`
	LastRunAt                          *time.Time `json:"lastRunAt,omitempty"`
	TotalBytesClassified               int64      `json:"totalBytesClassified"`
	TotalDetections                    int64      `json:"totalDetections"`
	TotalDetectionsSuppressed          int64      `json:"totalDetectionsSuppressed"`
	TotalItemsClassified               int64      `json:"totalItemsClassified"`
	TotalItemsSkipped                  int64      `json:"totalItemsSkipped"`
	TotalItemsSkippedInvalidEncryption int64      `json:"totalItemsSkippedInvalidEncryption"`
	TotalItemsSkippedInvalidKms        int64      `json:"totalItemsSkippedInvalidKms"`
	TotalItemsSkippedPermissionDenied  int64      `json:"totalItemsSkippedPermissionDenied"`
}

ResourceStatistics holds classification result counts for a bucket. Real GetResourceProfileOutput.Statistics never round-trips a set value in this backend (nothing populates it beyond the zero-value struct on read), so these key names are unverifiable by a real-client test -- fixed to match deserializers.go's ResourceStatistics EqualFold list, disclosed untested.

type ResourcesAffected added in v1.2.0

type ResourcesAffected struct {
	S3Bucket *AffectedS3Bucket `json:"s3Bucket,omitempty"`
	S3Object *AffectedS3Object `json:"s3Object,omitempty"`
}

ResourcesAffected identifies the S3 bucket/object a finding applies to.

type RetrievalConfiguration

type RetrievalConfiguration struct {
	RetrievalMode string `json:"retrievalMode"`
	ExternalID    string `json:"externalId,omitempty"`
	RoleName      string `json:"roleName,omitempty"`
}

RetrievalConfiguration mirrors types.RetrievalConfiguration.

type RevealConfiguration

type RevealConfiguration struct {
	KmsKeyID string `json:"kmsKeyId,omitempty"`
	Status   string `json:"status"`
}

RevealConfiguration holds sensitive data reveal configuration.

type S3BucketMetadata

type S3BucketMetadata struct {
	AccountID               string           `json:"accountId"`
	BucketArn               string           `json:"bucketArn"`
	BucketName              string           `json:"bucketName"`
	Region                  string           `json:"region"`
	PublicAccess            string           `json:"publicAccess"`
	EncryptionType          string           `json:"encryptionType"`
	SharedAccess            string           `json:"sharedAccess"`
	Tags                    []map[string]any `json:"tags,omitempty"`
	ClassifiableObjectCount int64            `json:"classifiableObjectCount"`
	ClassifiableSizeInBytes int64            `json:"classifiableSizeInBytes"`
	ObjectCount             int64            `json:"objectCount"`
	SizeInBytes             int64            `json:"sizeInBytes"`
}

S3BucketMetadata holds Macie's view of an S3 bucket for DescribeBuckets.

type S3WordsList

type S3WordsList struct {
	BucketName string `json:"bucketName"`
	ObjectKey  string `json:"objectKey"`
}

S3WordsList references an S3 object containing ignore words.

type SearchResourcesBucketCriteria

type SearchResourcesBucketCriteria struct {
	Includes *SearchResourcesCriteriaBlock
	Excludes *SearchResourcesCriteriaBlock
}

SearchResourcesBucketCriteria mirrors types.SearchResourcesBucketCriteria.

type SearchResourcesCriteriaBlock

type SearchResourcesCriteriaBlock struct {
	And []SearchResourcesCriterion
}

SearchResourcesCriteriaBlock mirrors types.SearchResourcesCriteriaBlock: its And list is AND-joined per the SDK's own doc comment ("If you specify more than one condition, Amazon Macie uses AND logic to join the conditions").

type SearchResourcesCriterion

type SearchResourcesCriterion struct {
	SimpleCriterion *SearchResourcesSimpleCriterion
	TagCriterion    *SearchResourcesTagCriterion
}

SearchResourcesCriterion mirrors types.SearchResourcesCriteria: a single condition, either property-based or tag-based.

type SearchResourcesSimpleCriterion

type SearchResourcesSimpleCriterion struct {
	Comparator string
	Key        string
	Values     []string
}

SearchResourcesSimpleCriterion mirrors types.SearchResourcesSimpleCriterion (aws-sdk-go-v2/service/macie2@v1.54.4 types/types.go:2777): Values are OR'd together, then Comparator EQ/NE applies across that OR set.

type SearchResourcesSortCriteria

type SearchResourcesSortCriteria struct {
	AttributeName string
	OrderBy       string
}

SearchResourcesSortCriteria mirrors types.SearchResourcesSortCriteria.

type SearchResourcesTagCriterion

type SearchResourcesTagCriterion struct {
	Comparator string
	TagValues  []SearchResourcesTagCriterionPair
}

SearchResourcesTagCriterion mirrors types.SearchResourcesTagCriterion.

type SearchResourcesTagCriterionPair

type SearchResourcesTagCriterionPair struct {
	Key   string
	Value string
}

SearchResourcesTagCriterionPair mirrors types.SearchResourcesTagCriterionPair.

type SecurityHubConfig

type SecurityHubConfig struct {
	PublishClassificationFindings bool `json:"publishClassificationFindings"`
	PublishPolicyFindings         bool `json:"publishPolicyFindings"`
}

SecurityHubConfig holds Security Hub integration settings.

type SensitivityInspectionTemplate

type SensitivityInspectionTemplate struct {
	Excludes    map[string]any `json:"excludes,omitempty"`
	Includes    map[string]any `json:"includes,omitempty"`
	ID          string         `json:"sensitivityInspectionTemplateId"`
	Name        string         `json:"name"`
	Description string         `json:"description,omitempty"`
}

SensitivityInspectionTemplate holds template configuration. ID's wire key is "sensitivityInspectionTemplateId" -- distinct from the "id" key used by SensitivityInspectionTemplateSummary (the ListSensitivityInspectionTemplates list-view type), which wraps the real types.SensitivityInspectionTemplatesEntry shape instead of GetSensitivityInspectionTemplateOutput's flat fields (macie2@v1.54.4 deserializers.go:7839 vs :21230).

type SensitivityInspectionTemplateSummary

type SensitivityInspectionTemplateSummary struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

SensitivityInspectionTemplateSummary is the list-view of a template.

type Session

type Session struct {
	CreatedAt                  time.Time `json:"createdAt"`
	UpdatedAt                  time.Time `json:"updatedAt"`
	FindingPublishingFrequency string    `json:"findingPublishingFrequency"`
	ServiceRole                string    `json:"serviceRole"`
	Status                     string    `json:"status"`
	Enabled                    bool      `json:"-"`
}

Session represents the Macie account state.

type Severity

type Severity struct {
	Description string `json:"description"`
	Score       int64  `json:"score"`
}

Severity holds finding severity details. Score is an integer 1 (Low) to 3 (High) on the wire (types.Severity.Score is *int64 in the real SDK) -- not a fractional value.

type SeverityLevel added in v1.2.0

type SeverityLevel struct {
	Severity             string `json:"severity"`
	OccurrencesThreshold int64  `json:"occurrencesThreshold"`
}

SeverityLevel specifies a severity level for findings that a custom data identifier produces, keyed by an occurrence-count threshold.

type StorageBackend

type StorageBackend interface {
	// PaginationSecret is the HMAC secret signing this backend's page tokens.
	PaginationSecret() string

	// Session management
	GetSession() *Session
	EnableMacie(clientToken, frequency, status string) error
	DisableMacie() error
	UpdateMacieSession(frequency, status string) error

	// Classification job operations
	CreateClassificationJob(
		name, description, jobType, clientToken string,
		s3JobDefinition, scheduleFrequency map[string]any,
		allowListIDs, customDataIdentifierIDs, managedDataIdentifierIDs []string,
		managedDataIdentifierSelector string,
		tags map[string]string,
		samplingPercentage int32,
		initialRun bool,
	) (id, jobArn string, err error)
	DescribeClassificationJob(jobID string) (*ClassificationJob, error)
	ListClassificationJobs(
		filterCriteria map[string]any,
		sortBy *ListJobsSortCriteria,
		maxResults int,
		nextToken string,
	) ([]*ClassificationJobSummary, string, error)
	UpdateClassificationJob(jobID, status string) error

	// Member operations
	CreateMember(accountID, email string, tags map[string]string) error
	GetMember(accountID string) (*Member, error)
	DeleteMember(accountID string) error
	ListMembers(onlyAssociated bool, limit int, token string) ([]*Member, string, error)
	DisassociateMember(accountID string) error
	UpdateMemberSession(accountID, status string) error

	// Invitation operations
	CreateInvitations(
		accountIDs []string,
		message string,
		disableEmail bool,
	) ([]UnprocessedAccount, error)
	AcceptInvitation(administratorAccountID, invitationID string) error
	DeclineInvitations(accountIDs []string) ([]UnprocessedAccount, error)
	DeleteInvitations(accountIDs []string) ([]UnprocessedAccount, error)
	GetInvitationsCount() (int64, error)
	ListInvitations() ([]*Invitation, error)

	// Administrator / master account operations
	GetAdministratorAccount() (*AdministratorAccount, error)
	GetMasterAccount() (*AdministratorAccount, error)
	DisassociateFromAdministratorAccount() error
	DisassociateFromMasterAccount() error

	// Organization admin operations
	EnableOrganizationAdminAccount(accountID string) error
	DisableOrganizationAdminAccount(accountID string) error
	ListOrganizationAdminAccounts() ([]*OrgAdminAccount, error)

	// Organization configuration
	DescribeOrganizationConfiguration() (*OrgConfig, error)
	UpdateOrganizationConfiguration(autoEnable bool) error

	// Automated discovery operations
	GetAutomatedDiscoveryConfiguration() (*AutoDiscoveryConfig, error)
	UpdateAutomatedDiscoveryConfiguration(autoEnableMembers, status string) error
	ListAutomatedDiscoveryAccounts() ([]*AutoDiscoveryAccount, error)
	BatchUpdateAutomatedDiscoveryAccounts(updates []AutoDiscoveryAccountUpdate) error

	// Bucket operations
	DescribeBuckets(
		criteria map[string]BucketCriterion, sortBy *BucketSortCriteria, token string, limit int,
	) ([]map[string]any, string, error)
	GetBucketStatistics(accountID string) (map[string]any, error)

	// Batch custom data identifier
	BatchGetCustomDataIdentifiers(ids []string) ([]*CustomDataIdentifier, error)

	// Classification export configuration
	GetClassificationExportConfiguration() (*ClassificationExportConfig, error)
	PutClassificationExportConfiguration(cfg *ClassificationExportConfig) error

	// Classification scope operations
	GetClassificationScope(scopeID string) (*ClassificationScope, error)
	ListClassificationScopes() ([]*ClassificationScopeSummary, error)
	UpdateClassificationScope(scopeID string, s3 *ClassificationScopeS3Update) error

	// Findings publication configuration
	GetFindingsPublicationConfiguration() (*FindingsPublicationConfig, error)
	PutFindingsPublicationConfiguration(cfg *FindingsPublicationConfig) error

	// Resource profile operations
	GetResourceProfile(resourceARN string) (*ResourceProfile, error)
	UpdateResourceProfile(resourceARN string, sensitivityScore int32) error
	ListResourceProfileArtifacts(resourceARN string) ([]ResourceProfileArtifact, error)
	ListResourceProfileDetections(resourceARN string) ([]ResourceProfileDetection, error)
	UpdateResourceProfileDetections(
		resourceARN string,
		suppressDataIdentifiers []map[string]any,
	) error

	// Reveal configuration
	GetRevealConfiguration() (*RevealConfiguration, error)
	UpdateRevealConfiguration(kmsKeyID, status string) error
	GetRetrievalConfiguration() *RetrievalConfiguration
	UpdateRetrievalConfiguration(mode, roleName string) (*RetrievalConfiguration, error)

	// Sensitive data occurrences
	GetSensitiveDataOccurrences(findingID string) (map[string]any, error)
	GetSensitiveDataOccurrencesAvailability(findingID string) (string, []string, error)

	// Sensitivity inspection template operations
	GetSensitivityInspectionTemplate(templateID string) (*SensitivityInspectionTemplate, error)
	ListSensitivityInspectionTemplates() ([]*SensitivityInspectionTemplateSummary, error)
	UpdateSensitivityInspectionTemplate(
		templateID, name string,
		description *string,
		excludes, includes map[string]any,
	) error

	// Usage operations
	GetUsageStatistics(
		filterBy []map[string]any,
		maxResults int,
		nextToken, sortBy string,
	) ([]UsageRecord, string, error)
	GetUsageTotals(timeRange string) ([]UsageTotal, error)

	// Managed data identifiers
	ListManagedDataIdentifiers() ([]ManagedDataIdentifier, error)

	// Search resources
	SearchResources(
		bucketCriteria *SearchResourcesBucketCriteria,
		sortBy *SearchResourcesSortCriteria,
		maxResults int,
		nextToken string,
	) ([]map[string]any, string, error)

	// Allow list operations
	CreateAllowList(
		name, description string,
		criteria AllowListCriteria,
		tags map[string]string,
	) (*AllowListSummary, error)
	GetAllowList(id string) (*AllowListDetail, error)
	UpdateAllowList(
		id, name, description string,
		criteria AllowListCriteria,
	) (*AllowListSummary, error)
	DeleteAllowList(id string, ignoreJobChecks bool) error
	ListAllowLists(limit int, token string) ([]*AllowListSummary, string, error)

	// Custom data identifier operations
	CreateCustomDataIdentifier(
		name, description, regex string,
		ignoreWords, keywords []string,
		severityLevels []SeverityLevel,
		maxMatchDistance *int32,
		tags map[string]string,
	) (string, error)
	GetCustomDataIdentifier(id string) (*CustomDataIdentifier, error)
	DeleteCustomDataIdentifier(id string) error
	ListCustomDataIdentifiers(limit int, token string) ([]*CustomDataIdentifierSummary, string, error)
	TestCustomDataIdentifier(
		regex string,
		ignoreWords, keywords []string,
		maxMatchDistance *int32,
		sampleText string,
	) (int32, error)

	// Findings filter operations
	CreateFindingsFilter(
		name, description, action string,
		position *int32,
		criteria map[string]any,
		tags map[string]string,
	) (*FindingsFilterSummary, error)
	GetFindingsFilter(id string) (*FindingsFilterDetail, error)
	UpdateFindingsFilter(
		id, name, action string,
		description *string,
		position *int32,
		criteria map[string]any,
	) (*FindingsFilterSummary, error)
	DeleteFindingsFilter(id string) error
	ListFindingsFilters(limit int, token string) ([]*FindingsFilterSummary, string, error)

	// Finding operations
	GetFindings(findingIDs []string, sortBy *FindingSortCriteria) ([]*Finding, error)
	ListFindings(
		criteria map[string]any,
		sortBy *FindingSortCriteria,
		maxResults int,
		nextToken string,
	) ([]string, string, error)
	CreateSampleFindings(findingTypes []string) error
	GetFindingStatistics(
		groupBy string, criteria map[string]any, sortBy *FindingSortCriteria, size int,
	) ([]FindingStatisticsGroup, error)

	// Tag operations
	TagResource(resourceARN string, tags map[string]string) error
	UntagResource(resourceARN string, tagKeys []string) error
	ListTagsForResource(resourceARN string) (map[string]string, error)

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

StorageBackend is the interface for Macie2 storage operations.

type TaggedEntry added in v1.3.1

type TaggedEntry struct {
	Tags map[string]string
	ARN  string
}

TaggedEntry pairs a resource ARN with its tags.

type UnprocessedAccount

type UnprocessedAccount struct {
	AccountID    string `json:"accountId"`
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
}

UnprocessedAccount describes an account that could not be processed.

type UsageByAccount

type UsageByAccount struct {
	Currency      string         `json:"currency,omitempty"`
	EstimatedCost string         `json:"estimatedCost,omitempty"`
	ServiceLimit  map[string]any `json:"serviceLimit,omitempty"`
	Type          string         `json:"type,omitempty"`
}

UsageByAccount holds usage data for one type.

type UsageRecord

type UsageRecord struct {
	AccountID                            string           `json:"accountId"`
	AutomatedDiscoveryFreeTrialStartDate *time.Time       `json:"automatedDiscoveryFreeTrialStartDate,omitempty"`
	FreeTrialStartDate                   *time.Time       `json:"freeTrialStartDate,omitempty"`
	Usage                                []UsageByAccount `json:"usage,omitempty"`
}

UsageRecord holds usage data for a single account.

type UsageTotal

type UsageTotal struct {
	Currency      string `json:"currency,omitempty"`
	EstimatedCost string `json:"estimatedCost,omitempty"`
	Type          string `json:"type,omitempty"`
}

UsageTotal holds aggregated usage totals.

type UserIdentity added in v1.3.4

type UserIdentity struct {
	Type        string `json:"type,omitempty"`
	UserName    string `json:"userName,omitempty"`
	PrincipalID string `json:"principalId,omitempty"`
}

UserIdentity provides information about the user/entity that performed the action.

Jump to

Keyboard shortcuts

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