models

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IntegrationTypeAWSScan is the integration type for snapshots in customer AWS accounts.
	IntegrationTypeAWSScan = "aws-scan"
	// IntegrationTypeAWS3 is the integration type for importing data from customer S3 buckets.
	IntegrationTypeAWS3 = "aws-s3"

	// StatusError is the string set in the database when an error occurs in a scan.
	StatusError = "error"
	// StatusOK is the string set in the database when a scan is successful.
	StatusOK = "ok"
	// StatusScanning is the status set while a scan is underway.
	StatusScanning = "scanning"
)

Variables

This section is empty.

Functions

func Validator

func Validator() (*validator.Validate, error)

Validator builds a custom struct validator.

Types

type CheckIntegrationInput

type CheckIntegrationInput struct {
	AWSAccountID     *string `genericapi:"redact" json:"awsAccountId" validate:"required,len=12,numeric"`
	IntegrationType  *string `json:"integrationType" validate:"required,oneof=aws-scan aws-s3"`
	IntegrationLabel *string `json:"integrationLabel" validate:"required,integrationLabel"`

	// Checks for cloudsec integrations
	EnableCWESetup    *bool `json:"enableCWESetup"`
	EnableRemediation *bool `json:"enableRemediation"`

	// Checks for log analysis integrations
	S3Bucket *string `json:"s3Bucket,omitempty"`
	S3Prefix *string `json:"s3Prefix,omitempty"`
	KmsKey   *string `json:"kmsKey,omitempty"`
}

CheckIntegrationInput is used to check the health of a potential configuration.

type DeleteIntegrationInput

type DeleteIntegrationInput struct {
	IntegrationID *string `json:"integrationId" validate:"required,uuid4"`
}

DeleteIntegrationInput is used to delete a specific item from the database.

type FullScanInput added in v1.2.1

type FullScanInput struct {
	Integrations []*SourceIntegrationMetadata
}

FullScanInput is used to do a full scan of one or more integrations.

type GetIntegrationTemplateInput

type GetIntegrationTemplateInput struct {
	AWSAccountID       *string `genericapi:"redact" json:"awsAccountId" validate:"required,len=12,numeric"`
	IntegrationType    *string `json:"integrationType" validate:"oneof=aws-scan aws-s3"`
	IntegrationLabel   *string `json:"integrationLabel" validate:"required,integrationLabel"`
	RemediationEnabled *bool   `json:"remediationEnabled,omitempty"`
	CWEEnabled         *bool   `json:"cweEnabled,omitempty"`
	S3Bucket           *string `json:"s3Bucket,omitempty" validate:"omitempty,min=1"`
	S3Prefix           *string `json:"s3Prefix,omitempty" validate:"omitempty,min=1"`
	KmsKey             *string `json:"kmsKey,omitempty" validate:"omitempty,kmsKeyArn"`
}

GetIntegrationTemplateInput allows specification of what resources should be enabled/disabled in the template

type LambdaInput

type LambdaInput struct {
	CheckIntegration *CheckIntegrationInput `json:"integrationHealthCheck"`

	PutIntegration            *PutIntegrationInput            `json:"putIntegration"`
	UpdateIntegrationSettings *UpdateIntegrationSettingsInput `json:"updateIntegrationSettings"`
	ListIntegrations          *ListIntegrationsInput          `json:"listIntegrations"`
	DeleteIntegration         *DeleteIntegrationInput         `json:"deleteIntegration"`

	GetIntegrationTemplate *GetIntegrationTemplateInput `json:"getIntegrationTemplate"`

	UpdateIntegrationLastScanEnd   *UpdateIntegrationLastScanEndInput   `json:"updateIntegrationLastScanEnd"`
	UpdateIntegrationLastScanStart *UpdateIntegrationLastScanStartInput `json:"updateIntegrationLastScanStart"`

	FullScan *FullScanInput `json:"fullScan"`
}

LambdaInput is the collection of all possible args to the Lambda function.

type ListIntegrationsInput

type ListIntegrationsInput struct {
	IntegrationType *string `json:"integrationType" validate:"omitempty,oneof=aws-scan aws-s3"`
}

ListIntegrationsInput allows filtering by the IntegrationType or Enabled fields

type PutIntegrationInput

type PutIntegrationInput struct {
	PutIntegrationSettings
	SkipScanQueue *bool `json:"skipScanQueue"`
}

PutIntegrationInput is used to add one or many integrations.

type PutIntegrationSettings

type PutIntegrationSettings struct {
	AWSAccountID       *string   `genericapi:"redact" json:"awsAccountId,omitempty" validate:"required,len=12,numeric"`
	IntegrationLabel   *string   `json:"integrationLabel,omitempty" validate:"required,integrationLabel,excludesall='<>&\""`
	IntegrationType    *string   `json:"integrationType" validate:"required,oneof=aws-scan aws-s3"`
	CWEEnabled         *bool     `json:"cweEnabled,omitempty"`
	RemediationEnabled *bool     `json:"remediationEnabled,omitempty"`
	ScanIntervalMins   *int      `json:"scanIntervalMins,omitempty" validate:"omitempty,oneof=60 180 360 720 1440"`
	UserID             *string   `json:"userId" validate:"required,uuid4"`
	S3Bucket           *string   `json:"s3Bucket,omitempty"`
	S3Prefix           *string   `json:"s3Prefix,omitempty" validate:"omitempty,min=1"`
	KmsKey             *string   `json:"kmsKey,omitempty" validate:"omitempty,kmsKeyArn"`
	LogTypes           []*string `json:"logTypes,omitempty" validate:"omitempty,min=1"`
}

PutIntegrationSettings are all the settings for the new integration.

type SourceIntegration

SourceIntegration represents a Panther integration with a source.

type SourceIntegrationHealth

type SourceIntegrationHealth struct {
	AWSAccountID    string `json:"awsAccountId"`
	IntegrationType string `json:"integrationType"`

	// Checks for cloudsec integrations
	AuditRoleStatus       SourceIntegrationItemStatus `json:"auditRoleStatus"`
	CWERoleStatus         SourceIntegrationItemStatus `json:"cweRoleStatus"`
	RemediationRoleStatus SourceIntegrationItemStatus `json:"remediationRoleStatus"`

	// Checks for log analysis integrations
	ProcessingRoleStatus SourceIntegrationItemStatus `json:"processingRoleStatus"`
	S3BucketStatus       SourceIntegrationItemStatus `json:"s3BucketStatus"`
	KMSKeyStatus         SourceIntegrationItemStatus `json:"kmsKeyStatus"`
}

type SourceIntegrationItemStatus

type SourceIntegrationItemStatus struct {
	Healthy      *bool   `json:"healthy"`
	ErrorMessage *string `json:"errorMessage"`
}

type SourceIntegrationMetadata

type SourceIntegrationMetadata struct {
	AWSAccountID       *string    `json:"awsAccountId"`
	CreatedAtTime      *time.Time `json:"createdAtTime"`
	CreatedBy          *string    `json:"createdBy"`
	IntegrationID      *string    `json:"integrationId"`
	IntegrationLabel   *string    `json:"integrationLabel"`
	IntegrationType    *string    `json:"integrationType"`
	RemediationEnabled *bool      `json:"remediationEnabled"`
	CWEEnabled         *bool      `json:"cweEnabled"`
	ScanIntervalMins   *int       `json:"scanIntervalMins"`
	S3Bucket           *string    `json:"s3Bucket,omitempty"`
	S3Prefix           *string    `json:"s3Prefix,omitempty"`
	KmsKey             *string    `json:"kmsKey,omitempty"`
	LogTypes           []*string  `json:"logTypes,omitempty"`
	LogProcessingRole  *string    `json:"logProcessingRole,omitempty"`
	StackName          *string    `json:"stackName,omitempty"`
}

SourceIntegrationMetadata is general settings and metadata for an integration.

type SourceIntegrationScanInformation

type SourceIntegrationScanInformation struct {
	LastScanEndTime      *time.Time `json:"lastScanEndTime"`
	LastScanErrorMessage *string    `json:"lastScanErrorMessage"`
	LastScanStartTime    *time.Time `json:"lastScanStartTime"`
}

SourceIntegrationScanInformation is detail about the last snapshot.

type SourceIntegrationStatus

type SourceIntegrationStatus struct {
	ScanStatus  *string `json:"scanStatus"`
	EventStatus *string `json:"eventStatus"`
}

SourceIntegrationStatus provides context that the full scan works and that events are being received.

type SourceIntegrationTemplate

type SourceIntegrationTemplate struct {
	Body      *string `json:"body"`
	StackName *string `json:"stackName"`
}

type UpdateIntegrationLastScanEndInput

type UpdateIntegrationLastScanEndInput struct {
	EventStatus          *string    `json:"eventStatus"`
	IntegrationID        *string    `json:"integrationId" validate:"required,uuid4"`
	LastScanEndTime      *time.Time `json:"lastScanEndTime" validate:"required"`
	LastScanErrorMessage *string    `json:"lastScanErrorMessage"`
	ScanStatus           *string    `json:"scanStatus" validate:"required,oneof=ok error scanning"`
}

UpdateIntegrationLastScanEndInput is used to update scan information at the end of a scan.

type UpdateIntegrationLastScanStartInput

type UpdateIntegrationLastScanStartInput struct {
	IntegrationID     *string    `json:"integrationId" validate:"required,uuid4"`
	LastScanStartTime *time.Time `json:"lastScanStartTime" validate:"required"`
	ScanStatus        *string    `json:"scanStatus" validate:"required,oneof=ok error scanning"`
}

UpdateIntegrationLastScanStartInput is used to update scan information at the beginning of a scan.

type UpdateIntegrationSettingsInput

type UpdateIntegrationSettingsInput struct {
	IntegrationID      *string   `json:"integrationId" validate:"required,uuid4"`
	IntegrationLabel   *string   `json:"integrationLabel,omitempty" validate:"required,integrationLabel,excludesall='<>&\""`
	CWEEnabled         *bool     `json:"cweEnabled,omitempty"`
	RemediationEnabled *bool     `json:"remediationEnabled,omitempty"`
	ScanIntervalMins   *int      `json:"scanIntervalMins" validate:"omitempty,oneof=60 180 360 720 1440"`
	S3Bucket           *string   `json:"s3Bucket,omitempty" validate:"omitempty,min=1"`
	S3Prefix           *string   `json:"s3Prefix,omitempty" validate:"omitempty,min=1"`
	KmsKey             *string   `json:"kmsKey,omitempty" validate:"omitempty,kmsKeyArn"`
	LogTypes           []*string `json:"logTypes,omitempty" validate:"omitempty,min=1"`
}

UpdateIntegrationSettingsInput is used to update integration settings.

Jump to

Keyboard shortcuts

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