sources

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DownloadMaxPartSize = 50 * 1024 * 1024                  // the max size of in memory buffers will be 3X as this due to multiple buffers
	DownloadMinPartSize = s3manager.DefaultDownloadPartSize // the min part size for efficiency

)

Variables

This section is empty.

Functions

func BuildClassifier added in v1.8.0

func BuildClassifier(
	availableLogTypes []string,
	src *models.SourceIntegration,
	r pantherlog.ParserResolver,
) (classification.ClassifierAPI, error)

BuildClassifier builds a classifier for a source

func ConfirmSubscription

func ConfirmSubscription(notification *SnsNotification) (err error)

ConfirmSubscription will confirm the SNS->SQS subscription

func LoadSource added in v1.8.0

func LoadSource(id string) (*models.SourceIntegration, error)

LoadSource loads the source configuration for an source id. This will update the global cache if needed. It will return error if it encountered an issue retrieving the source information or if the source is not found.

func LoadSourceS3 added in v1.8.0

func LoadSourceS3(bucketName, objectKey string) (*models.SourceIntegration, error)

LoadSourceS3 loads the source configuration for an S3 object. It will update the global cache if needed It will return error if it encountered an issue retrieving the source information or if the source is not found.

func ReadSnsMessage added in v1.13.0

func ReadSnsMessage(ctx context.Context, message string) (result []*common.DataStream, err error)

ReadSnsMessage reads incoming messages containing SNS notifications and returns a slice of DataStream items

Types

type MessageForwarderReader added in v1.6.0

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

func NewMessageForwarderReader added in v1.6.0

func NewMessageForwarderReader(input io.Reader) *MessageForwarderReader

Reader for messages sent by the Message Forwarder Lambda

func (*MessageForwarderReader) Read added in v1.6.0

func (r *MessageForwarderReader) Read(p []byte) (n int, err error)

type RefreshableS3Client added in v1.16.0

type RefreshableS3Client struct {
	s3iface.S3API
	// contains filtered or unexported fields
}

Wrapper around S3 client. It will refresh credentials in case `InvalidAccessKeyId` error is encountered

func (*RefreshableS3Client) GetBucketLocationWithContext added in v1.16.0

func (r *RefreshableS3Client) GetBucketLocationWithContext(
	ctx aws.Context,
	request *s3.GetBucketLocationInput,
	options ...request.Option) (*s3.GetBucketLocationOutput, error)

func (*RefreshableS3Client) GetObjectWithContext added in v1.16.0

func (r *RefreshableS3Client) GetObjectWithContext(
	ctx aws.Context,
	request *s3.GetObjectInput,
	options ...request.Option) (*s3.GetObjectOutput, error)

type S3ObjectInfo

type S3ObjectInfo struct {
	S3Bucket    string
	S3ObjectKey string
	// In case the size is not known, this will have a negative value
	S3ObjectSize int64
}

S3ObjectInfo contains information about the S3 object

func ParseNotification

func ParseNotification(message string) ([]*S3ObjectInfo, error)

ParseNotification parses a message received

type SQSClassifier added in v1.8.0

type SQSClassifier struct {
	Resolver   pantherlog.ParserResolver
	LoadSource func(id string) (*models.SourceIntegration, error)
	// contains filtered or unexported fields
}

func (*SQSClassifier) Classify added in v1.8.0

func (*SQSClassifier) ParserStats added in v1.8.0

func (c *SQSClassifier) ParserStats() map[string]*classification.ParserStats

func (*SQSClassifier) Stats added in v1.8.0

type SnsNotification

type SnsNotification struct {
	events.SNSEntity
	Token *string `json:"Token"`
}

SnsNotification struct represents an SNS message arriving to Panther SQS from a customer account. The message can either be of type 'Notification' or 'SubscriptionConfirmation' Since there is no AWS SDK-provided struct to represent both types we had to create this custom type to include fields from both types.

Jump to

Keyboard shortcuts

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