deploy

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: 27 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFilepath = "deployments/panther_config.yml"

Variables

View Source
var SupportedRegions = map[string]bool{
	"ap-northeast-1": true,
	"ap-northeast-2": true,
	"ap-south-1":     true,
	"ap-southeast-1": true,
	"ap-southeast-2": true,
	"ca-central-1":   true,
	"eu-central-1":   true,
	"eu-north-1":     true,
	"eu-west-1":      true,
	"eu-west-2":      true,
	"eu-west-3":      true,
	"sa-east-1":      true,
	"us-east-1":      true,
	"us-east-2":      true,
	"us-west-1":      true,
	"us-west-2":      true,
}

SupportedRegions is a set of region names where Panther can be deployed. Not all AWS services are available in every region. https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services

Functions

func CallForEachString added in v1.16.0

func CallForEachString(label string, callOnSet []string, callFn func(string) error) (callErrors []error)

Call a method for every string in the callOnSet string slice. Return a slice of errors where the index of the error is the index of the callOnSet string used as the argument in the function call.

func Deploy

func Deploy() error

Deploy Panther to your AWS account

func PantherNames added in v1.16.0

func PantherNames(setString string) []string

Takes a string and returns the panther- prefixed, lowercased slice of words(strings) (separated by spaces). e.g "oRg-ApI" -> []string{"panther-org-api"} e.g "one two THREE" -> []string{"panther-one", "panther-two", "panther-three"}

func PreCheck

func PreCheck(region string) error

Fail the deploy early if there is a known issue with the user's environment.

func Stack added in v1.16.0

func Stack(
	packager *pkg.Packager,
	templatePath, stack string,
	params map[string]string,
) (map[string]string, error)

Deploy a CloudFormation template, returning stack outputs.

The bucket parameter can be empty to skip S3 packaging.

Types

type Company

type Company struct {
	DisplayName string `yaml:"DisplayName"`
	Email       string `yaml:"Email"`
}

type FirstUser

type FirstUser struct {
	GivenName  string `yaml:"GivenName"`
	FamilyName string `yaml:"FamilyName"`
	Email      string `yaml:"Email"`
}

type Infra

type Infra struct {
	BaseLayerVersionArns               string   `yaml:"BaseLayerVersionArns"`
	LoadBalancerSecurityGroupCidr      string   `yaml:"LoadBalancerSecurityGroupCidr"`
	LogProcessorLambdaMemorySize       int      `yaml:"LogProcessorLambdaMemorySize"`
	LogProcessorLambdaSQSReadBatchSize string   `yaml:"LogProcessorLambdaSQSReadBatchSize"`
	PipLayer                           []string `yaml:"PipLayer"`
	KvTableBillingMode                 string   `yaml:"KvTableBillingMode"`
	PythonLayerVersionArn              string   `yaml:"PythonLayerVersionArn"`
	PythonManagedPolicyArn             string   `yaml:"PythonManagedPolicyArn"`
	PythonAssumableRoleArns            []string `yaml:"PythonAssumableRoleArns"`
	SecurityGroupID                    string   `yaml:"SecurityGroupID"`
	SubnetOneID                        string   `yaml:"SubnetOneID"`
	SubnetTwoID                        string   `yaml:"SubnetTwoID"`
	SubnetOneIPRange                   string   `yaml:"SubnetOneIPRange"`
	SubnetTwoIPRange                   string   `yaml:"SubnetTwoIPRange"`
	VpcID                              string   `yaml:"VpcID"`
}

type LogSubscriptions

type LogSubscriptions struct {
	PrincipalARNs []string `yaml:"PrincipalARNs"`
}

type Monitoring

type Monitoring struct {
	AlarmSnsTopicArn           string `yaml:"AlarmSnsTopicArn"`
	CloudWatchLogRetentionDays int    `yaml:"CloudWatchLogRetentionDays"`
	Debug                      bool   `yaml:"Debug"`
	TracingMode                string `yaml:"TracingMode"`
}

type PantherConfig

type PantherConfig struct {
	Infra      Infra      `yaml:"Infra"`
	Monitoring Monitoring `yaml:"Monitoring"`
	Setup      Setup      `yaml:"Setup"`
	Web        Web        `yaml:"Web"`
}

func Settings

func Settings() (*PantherConfig, error)

Read settings from the config file

type Setup

type Setup struct {
	Company               Company          `yaml:"Company"`
	FirstUser             FirstUser        `yaml:"FirstUser"`
	OnboardSelf           bool             `yaml:"OnboardSelf"`
	EnableS3AccessLogs    bool             `yaml:"EnableS3AccessLogs"`
	EnableCloudTrail      bool             `yaml:"EnableCloudTrail"`
	EnableGuardDuty       bool             `yaml:"EnableGuardDuty"`
	S3AccessLogsBucket    string           `yaml:"S3AccessLogsBucket"`
	DataReplicationBucket string           `yaml:"DataReplicationBucket"`
	InitialAnalysisSets   []string         `yaml:"InitialAnalysisSets"`
	LogSubscriptions      LogSubscriptions `yaml:"LogSubscriptions"`
}

type Web

type Web struct {
	CertificateArn string `yaml:"CertificateArn"`
	CustomDomain   string `yaml:"CustomDomain"`
}

Jump to

Keyboard shortcuts

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