app

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const RuleDescription = "owned"

RuleDescription should match this value in order to indicate that a certain rule should be managed on security group.

View Source
const TagProtocolValue = "managed"

TagProtocolValue should match this value in order to indicate that a certain protocol should be managed on tagged security group. In any case, only "owned" rules will be managed.

View Source
const Version string = "1.1.4"

Version contains current application version

Variables

View Source
var CategorizeRules = (*Config).categorizeRules

CategorizeRules is exported for unit test because test are in a sepparate package

View Source
var GetManagedRules = (*Config).getManagedRules

GetManagedRules is exported for unit test because test are in a sepparate package

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Correct   *Group
	Incorrect *Group
	Missing   *Group
}

Catalog contains rule groups by types

type Client

type Client interface {
	GetSecretValue(*secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error)
}

Client represents a Secrets Manager client

type Config

type Config struct {
	Protocols map[string]*Protocol `json:"protocols"`
	Rules     []*Rule              `json:"rules"`
}

Config defines a configuration Protocol name should be an AWS Support Application Protocol

func GetConfig

func GetConfig(cli Client, secret string) (*Config, error)

GetConfig returns parsed Configuration

func (*Config) Run

func (c *Config) Run(cli sg.Client) error

Run is a main thread of this application

type Group

type Group struct {
	Rules []*sg.Rule
	CIDRs []string
}

Group contains similar types of rules

type Protocol

type Protocol struct {
	Transport *string `json:"transport"`
	FromPort  *int64  `json:"from_port"`
	ToPort    *int64  `json:"to_port"`
}

Protocol represends a single protocol configuration

type Rule

type Rule struct {
	CIDR *string `json:"cidr"`
}

Rule represents a whitelisted CIDR

Jump to

Keyboard shortcuts

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