models

package
v0.0.0-...-fd6b471 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// New  indicates the rule needs to be created
	New ruleState = "new"
	// Modified indicates the rule needs to be modified
	Modified ruleState = "modified"
)

Variables

This section is empty.

Functions

func ConvertSourceRangesMapToSlice

func ConvertSourceRangesMapToSlice(sourceRanges map[string]bool) []string

ConvertSourceRangesMapToSlice Convert SourceRanges map to slice

func ConvertSourceRangesSliceToMap

func ConvertSourceRangesSliceToMap(sourceRanges []string) map[string]bool

ConvertSourceRangesSliceToMap Convert SourceRanges slice to map

func GetCIDR

func GetCIDR(source string) string

Types

type AWSConfig

type AWSConfig struct {
	Disabled          bool   `yaml:"disabled"`
	Region            string `yaml:"region"`
	FirewallPolicy    string `yaml:"firewall_policy"`
	Capacity          int    `yaml:"capacity"`
	RuleGroupPriority int64  `yaml:"priority"`
	// Endpoint is used for making calls to a mock server instead of the real AWS services endpoints.
	Endpoint string `yaml:"endpoint"`
}

type AzureConfig

type AzureConfig struct {
	Disabled       bool   `yaml:"disabled"`
	SubscriptionID string `yaml:"subscription_id"`
	ResourceGroup  string `yaml:"resource_group"`
	Network        string `yaml:"network"`
	Priority       int64  `yaml:"priority"`
	MaxRules       int    `yaml:"max_rules"`
	Capacity       int    `yaml:"capacity"`
	UserAgent      string `yaml:"user_agent"`
	// Endpoint is used for making calls to a mock server instead of the real Google services endpoints.
	Endpoint string `yaml:"endpoint"`
}

type CloudArmorConfig

type CloudArmorConfig struct {
	Disabled  bool   `yaml:"disabled"`
	ProjectID string `yaml:"project_id"`
	Policy    string `yaml:"policy"`
	Priority  int64  `yaml:"priority"`
	MaxRules  int    `yaml:"max_rules"`
	// Endpoint is used for making calls to a mock server instead of the real Google services endpoints.
	Endpoint string `yaml:"endpoint"`
}

type CloudProviders

type CloudProviders struct {
	GCP        GCPConfig        `yaml:"gcp"`
	Azure      AzureConfig      `yaml:"azure"`
	AWS        AWSConfig        `yaml:"aws"`
	CloudArmor CloudArmorConfig `yaml:"cloudarmor"`
}

type FirewallRule

type FirewallRule struct {
	// Name identifies the firewall rule name
	Name string
	// SourceRanges contains the source ranges defined in the firewall rule
	SourceRanges map[string]bool
	// State determines the operation when updating the firewall rule.
	// An empty State will result in noop when updating the rule at the cloud provider.
	State    ruleState
	Priority int64
}

FirewallRule represents a cloud agnostic firewall rule

type GCPConfig

type GCPConfig struct {
	Disabled  bool   `yaml:"disabled"`
	ProjectID string `yaml:"project_id"`
	Network   string `yaml:"network"`
	Priority  int64  `yaml:"priority"`
	MaxRules  int    `yaml:"max_rules"`
	// Endpoint is used for making calls to a mock server instead of the real Google services endpoints.
	Endpoint string `yaml:"endpoint"`
}

Jump to

Keyboard shortcuts

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