ddb

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DDB

type DDB struct {
	Client    dynamodbiface.DynamoDBAPI
	TableName string
}

DDB is a struct containing the DynamoDB client, and the table name to retrieve data.

func New

func New(tableName string) *DDB

New instantiates a new client.

func (*DDB) DeleteItem added in v1.3.0

func (ddb *DDB) DeleteItem(integrationID string) error

DeleteItem deletes an integration from the database based on the integration ID

func (*DDB) GetItem added in v1.3.0

func (ddb *DDB) GetItem(integrationID string) (*Integration, error)

GetItem returns an integration by its ID

func (*DDB) PutItem added in v1.3.0

func (ddb *DDB) PutItem(input *Integration) error

PutItem adds a source integration to the database

func (*DDB) ScanIntegrations

func (ddb *DDB) ScanIntegrations(integrationType *string) ([]*Integration, error)

ScanIntegrations returns all enabled integrations based on type (if type is specified). It performs a DDB scan of the entire table with a filter expression.

func (*DDB) UpdateStatus added in v1.5.1

func (ddb *DDB) UpdateStatus(integrationID string, status IntegrationStatus) error

type Integration added in v1.5.1

type Integration struct {
	CreatedAtTime    time.Time `json:"createdAtTime,omitempty"`
	CreatedBy        string    `json:"createdBy,omitempty"`
	IntegrationID    string    `json:"integrationId,omitempty"`
	IntegrationLabel string    `json:"integrationLabel,omitempty"`
	IntegrationType  string    `json:"integrationType,omitempty"`

	AWSAccountID       string `json:"awsAccountId,omitempty"`
	RemediationEnabled *bool  `json:"remediationEnabled,omitempty"`
	CWEEnabled         *bool  `json:"cweEnabled,omitempty"`

	LastScanStartTime    *time.Time `json:"lastScanStartTime,omitempty"`
	LastScanEndTime      *time.Time `json:"lastScanEndTime,omitempty"`
	LastScanErrorMessage string     `json:"lastScanErrorMessage,omitempty"`
	ScanIntervalMins     int        `json:"scanIntervalMins,omitempty"`
	IntegrationStatus

	S3Bucket          string   `json:"s3Bucket,omitempty"`
	S3Prefix          string   `json:"s3Prefix,omitempty"`
	KmsKey            string   `json:"kmsKey,omitempty"`
	LogTypes          []string `json:"logTypes,omitempty" dynamodbav:",stringset"`
	StackName         string   `json:"stackName,omitempty"`
	LogProcessingRole string   `json:"logProcessingRole,omitempty"`

	SqsConfig *SqsConfig `json:"sqsConfig,omitempty"`
}

Integration represents an integration item as it is stored in DynamoDB.

type IntegrationStatus added in v1.5.1

type IntegrationStatus struct {
	ScanStatus        string     `json:"scanStatus,omitempty"`
	EventStatus       string     `json:"eventStatus,omitempty"`
	LastEventReceived *time.Time `json:"lastEventReceived,omitempty"`
}

type SqsConfig added in v1.6.0

type SqsConfig struct {
	S3Bucket             string   `json:"s3Bucket,omitempty"`
	S3Prefix             string   `json:"s3Prefix,omitempty"`
	LogProcessingRole    string   `json:"logProcessingRole,omitempty"`
	LogTypes             []string `json:"logTypes" dynamodbav:",stringset"`
	AllowedPrincipalArns []string `json:"allowedPrincipalArns" dynamodbav:",stringset"`
	AllowedSourceArns    []string `json:"allowedSourceArns" dynamodbav:",stringset"`
	QueueURL             string   `json:"queueUrl,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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