appsec

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package appsec contains implementation for Akamai Terraform sub-provider responsible for Application Security

Index

Constants

View Source
const (
	APITarget     = "API"
	WebsiteTarget = "Website"
)

Definition of constant variables

View Source
const (
	Alert = "alert"
	Deny  = "deny"
	None  = "none"
)

Constant values

View Source
const (
	Start    = "START"
	Stop     = "STOP"
	Restart  = "RESTART"
	Update   = "UPDATE"
	Complete = "COMPLETE"
)

Definition of constant variables

View Source
const (
	Allow = "allow"
	Block = "block"
)

Definition of constant variables

View Source
const (
	Append  = "APPEND"
	Replace = "REPLACE"
	Remove  = "REMOVE"
)

Append Replace Remove mode flags

View Source
const (
	// AAG = Automated Attack Groups
	AAG = "AAG"

	// KRS = Kona Rule Sets
	KRS = "KRS"

	// AseAuto = Adaptive Security Engine - Auto
	AseAuto = "ASE_AUTO"

	// AseManual = Adaptive Security Engine - Manual
	AseManual = "ASE_MANUAL"
)

Definition of constant variables

View Source
const (
	Abort = "abort"
)

Definition of constant variables

View Source
const (
	// ActivationPollMinimum is the minimum polling interval for activation creation
	ActivationPollMinimum = time.Minute
)
View Source
const ProviderVersion string = "v1.0.1"

ProviderVersion update version string anytime provider adds new features

Variables

View Source
var (

	// GetModifiableConfigVersion returns the number of the latest editable version
	// of the given security configuration. If the most recent version is not editable
	// (because it is active in staging or production) a new version is cloned and the
	// new version's number is returned. API calls are made using the supplied context
	// and the API client obtained from m. Log messages are written to m's logger. A
	// mutex prevents calls made by multiple resources from creating unnecessary clones.
	GetModifiableConfigVersion = getModifiableConfigVersion
	// GetLatestConfigVersion returns the latest version number of the given security
	// configuration. API calls are made using the supplied context and the API client
	// obtained from m. Log messages are written to m's logger.
	GetLatestConfigVersion = getLatestConfigVersion
)
View Source
var (
	// ActivationPollInterval is the interval for polling an activation status on creation
	ActivationPollInterval = ActivationPollMinimum

	// AppsecResourceTimeout is the default timeout for the resource operations
	AppsecResourceTimeout = time.Minute * 90
)

Functions

func InitTemplates

func InitTemplates(otm map[string]*OutputTemplate)

InitTemplates populates map of templates given as argument with output templates

func Provider

func Provider() *schema.Provider

Provider returns the Akamai terraform.Resource provider.

func RenderTemplates

func RenderTemplates(ots map[string]*OutputTemplate, key string, str interface{}) (string, error)

RenderTemplates renders a template and returns it as a string.

func Subprovider

func Subprovider(opts ...Option) akamai.Subprovider

Subprovider returns a core sub provider

func ValidateActions

func ValidateActions(v interface{}, path cty.Path) diag.Diagnostics

ValidateActions ensure actions are correct for API call

func VerifyIDUnchanged

func VerifyIDUnchanged(_ context.Context, d *schema.ResourceDiff, m interface{}) error

VerifyIDUnchanged compares the configuration's value for the configuration ID with the resource's value specified in the resources's ID, to ensure that the user has not inadvertently modified the configuration's value; any such modifications indicate an incorrect understanding of the Update operation.

Types

type MatchTargetOutputText

type MatchTargetOutputText struct {
	TargetID int
	PolicyID string
	Type     string
}

MatchTargetOutputText holds data for templates

type Option

type Option func(p *provider)

Option is a appsec provider option

func WithClient

func WithClient(c appsec.APPSEC) Option

WithClient sets the client interface function, used for mocking and testing

type OutputTemplate

type OutputTemplate struct {
	TemplateName   string
	TemplateType   string
	TableTitle     string
	TemplateString string
}

OutputTemplate contains template data

func GetTemplate

func GetTemplate(ots map[string]*OutputTemplate, key string) (*OutputTemplate, error)

GetTemplate given map of templates and a key, returns template stored under this key

type OutputTemplates

type OutputTemplates map[string]*OutputTemplate

OutputTemplates is a map of templates

Source Files

Jump to

Keyboard shortcuts

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