Documentation
¶
Overview ¶
Package awssecurityhub defines the consolidated AWS Security Hub, AWS IAM, and AWS Config integration definition.
Index ¶
Constants ¶
const ( // AccountScopeAll indicates operations should run across all accessible accounts AccountScopeAll = "all" // AccountScopeSpecific indicates operations should be limited to explicitly listed accounts AccountScopeSpecific = "specific" )
Variables ¶
var ( // ErrRoleARNMissing indicates the IAM role ARN is missing from the credential ErrRoleARNMissing = errors.New("awssecurityhub: roleArn required") // ErrRoleARNInvalid is returned when the assume-role ARN does not carry an account id ErrRoleARNInvalid = errors.New("awssecurityhub: assume role arn missing account id") // ErrRegionMissing indicates the home region is missing from the credential ErrRegionMissing = errors.New("awssecurityhub: homeRegion required") // ErrAWSConfigBuildFailed indicates the AWS SDK config could not be constructed ErrAWSConfigBuildFailed = errors.New("awssecurityhub: aws config build failed") // ErrCallerIdentityFetchFailed indicates STS GetCallerIdentity failed ErrCallerIdentityFetchFailed = errors.New("awssecurityhub: caller identity fetch failed") // ErrAccountIDMissing indicates STS GetCallerIdentity returned no account id ErrAccountIDMissing = errors.New("awssecurityhub: account id missing") // ErrAccountIDMismatch indicates the configured account id disagrees with the role ARN ErrAccountIDMismatch = errors.New("awssecurityhub: configured account id does not match role arn account") // ErrDescribeHubFailed indicates DescribeHub failed ErrDescribeHubFailed = errors.New("awssecurityhub: describe hub failed") // ErrSecurityHubNotEnabled indicates security hub is not enabled for the account ErrSecurityHubNotEnabled = errors.New("awssecurityhub: security hub not enabled for account") // ErrFindingsFetchFailed indicates GetFindings failed ErrFindingsFetchFailed = errors.New("awssecurityhub: findings fetch failed") // ErrFindingEncode indicates a finding payload could not be serialized ErrFindingEncode = errors.New("awssecurityhub: finding encode failed") // ErrIAMUsersFetchFailed indicates ListUsers failed ErrIAMUsersFetchFailed = errors.New("awsiam: IAM users fetch failed") // ErrIAMGroupsFetchFailed indicates ListGroups failed ErrIAMGroupsFetchFailed = errors.New("awsiam: IAM groups fetch failed") // ErrIAMGroupsForUserFetchFailed indicates ListGroupsForUser failed ErrIAMGroupsForUserFetchFailed = errors.New("awsiam: IAM groups for user fetch failed") // ErrDirectorySyncPayloadEncode indicates a directory sync payload could not be serialized ErrDirectorySyncPayloadEncode = errors.New("awsiam: directory sync payload encode failed") )
Functions ¶
Types ¶
type AssetSync ¶
type AssetSync struct {
types.OperationSettings
}
AssetSync are the configuration settings for the asset sync
type AssumeRoleCredentialSchema ¶
type AssumeRoleCredentialSchema struct {
// RoleARN is the cross-account IAM role ARN Openlane should assume in the tenant environment
RoleARN string `` /* 166-byte string literal not displayed */
// ExternalID is the external ID required in the tenant role trust policy
ExternalID string `` /* 172-byte string literal not displayed */
// HomeRegion is the AWS region where Security Hub cross-region aggregation is managed
HomeRegion string `` /* 175-byte string literal not displayed */
// AccountID is the AWS account ID, derived from RoleARN when not provided
AccountID string `` /* 138-byte string literal not displayed */
// AccountScope controls whether collection covers all delegated accounts or a subset
AccountScope string `` /* 173-byte string literal not displayed */
// AccountIDs lists the specific AWS account IDs used when account scope is specific
AccountIDs []string `json:"accountIds,omitempty" jsonschema:"title=Account IDs,description=Required when accountScope is specific."`
// LinkedRegions limits findings collection to the listed source regions
LinkedRegions []string `` /* 144-byte string literal not displayed */
// SessionName is an optional STS session name override
SessionName string `json:"sessionName,omitempty" jsonschema:"title=Session Name,description=Optional STS session name override."`
// SessionDuration is an optional STS session duration override
SessionDuration string `json:"sessionDuration,omitempty" jsonschema:"title=Session Duration,description=Optional STS session duration (e.g. 1h)."`
}
AssumeRoleCredentialSchema holds the AWS assume-role and collection-scope inputs
type CheckSync ¶
type CheckSync struct {
types.OperationSettings
}
CheckSync are the configuration settings for the check sync from AWS Config
type Client ¶
type Client struct {
// Config is the AWS SDK config the service clients are built from
Config awssdk.Config
// Scope is the non-secret collection scope of the connection
Scope CollectionScope
}
Client is the AWS client every operation of this definition runs against
func (Client) ConfigService ¶
func (c Client) ConfigService() *configservice.Client
ConfigService returns the AWS Config client
func (Client) SecurityHub ¶
func (c Client) SecurityHub() *securityhub.Client
SecurityHub returns the AWS Security Hub client
type CollectionScope ¶
type CollectionScope struct {
// AccountID is the primary AWS account identifier
AccountID string
// AccountScope indicates whether collection targets all delegated accounts or a specific set
AccountScope string
// AccountIDs lists the explicitly selected AWS account identifiers when account scope is specific
AccountIDs []string
// LinkedRegions limits collection to the listed AWS source regions when configured
LinkedRegions []string
}
CollectionScope is the account and region scope the connection collects
type Config ¶
type Config struct {
// AccessKeyID is the AWS access key ID for Openlane's source identity used when assuming cross-account roles
AccessKeyID string `json:"accessKeyId" koanf:"accesskeyid" sensitive:"true"`
// SecretAccessKey is the AWS secret access key for Openlane's source identity
SecretAccessKey string `json:"secretAccessKey" koanf:"secretaccesskey" sensitive:"true"`
// ARN is the Openlane ARN that is used as the Principal that is allowed to use the assume role
ARN string `json:"arn" koanf:"arn"`
}
Config holds operator-level credentials for the AWS Security Hub definition
type FindingSync ¶
type FindingSync struct {
types.OperationSettings
}
FindingSync are configuration settings for the findings sync
type InstallationMetadata ¶
type InstallationMetadata struct {
// RoleARN is the cross-account IAM role ARN Openlane assumes for this installation
RoleARN string `json:"roleArn,omitempty" jsonschema:"title=IAM Role ARN"`
// HomeRegion is the AWS region used for Security Hub aggregation and API calls
HomeRegion string `json:"homeRegion,omitempty" jsonschema:"title=Home Region"`
// AccountID is the primary AWS account identifier when supplied during setup
AccountID string `json:"accountId,omitempty" jsonschema:"title=Account ID"`
// AccountScope indicates whether collection targets all delegated accounts or a specific set
AccountScope string `json:"accountScope,omitempty" jsonschema:"title=Account Scope"`
// AccountIDs lists the explicitly selected AWS account identifiers when account scope is specific
AccountIDs []string `json:"accountIds,omitempty" jsonschema:"title=Account IDs"`
// LinkedRegions limits collection to the listed AWS source regions when configured
LinkedRegions []string `json:"linkedRegions,omitempty" jsonschema:"title=Linked Regions"`
}
InstallationMetadata holds the non-secret AWS connection attributes for an installation
func (InstallationMetadata) InstallationIdentity ¶
func (m InstallationMetadata) InstallationIdentity() types.IntegrationInstallationIdentity
InstallationIdentity implements types.InstallationIdentifiable
type ServiceAccountCredentialSchema ¶
type ServiceAccountCredentialSchema struct {
// AccessKeyID is an service account credential when runtime IAM is unavailable
AccessKeyID string `` /* 139-byte string literal not displayed */
// SecretAccessKey is the AWS secret access key for static credentials
SecretAccessKey string `json:"secretAccessKey" jsonschema:"required,title=Secret Access Key"`
// SessionToken is the AWS session token for static credentials
SessionToken string `json:"sessionToken,omitempty" jsonschema:"title=Session Token"`
// Region is the AWS region for API calls (e.g. us-east-1)
Region string `` /* 139-byte string literal not displayed */
}
ServiceAccountCredentialSchema is the service account based credential schema