sslpolicy

package
v0.0.0-...-9920aa2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertPolicy

func AssertPolicy(config *Config, svc *compute.Service) (*compute.SslPolicy, error)

AssertPolicy ensures that a policy exists that matches our expectations.

func NewSslPolicy

func NewSslPolicy(name, profile, version string) compute.SslPolicy

NewSslPolicy returns instance of the configuration options necessary to create our globally enforced SSL Policy.

func SelectProxies

func SelectProxies(proxies *compute.TargetHttpsProxyList, blacklist map[string]struct{}) *compute.TargetHttpsProxyList

SelectProxies removes black listed proxies from our list of targets.

Types

type Config

type Config struct {
	IgnoreProxies map[string]struct{}
}

Config contains the configuration values that the rest of the program will leverage. Fields from the YAML are manipulated to become more convenient for the internal program.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig returns an instance of the unmarshalled configuration file.

func (*Config) PolicyName

func (*Config) PolicyName() string

PolicyName will be used by the service to fetch the current TLS Policy by this name and if not found will create it. The Version string at the end is very important! It will be used to upgrade TLS policies in the future.

func (*Config) Project

func (*Config) Project() string

Project returns the ID (not the display name) of the Google Cloud Project to work under.

func (*Config) SslProfile

func (*Config) SslProfile() string

SslProfile returns the string value of pre-configured profile defined by GCP. The acceptable value MUST BE either `COMPATIBLE`/`MODERN`/`RESTRICTED`. Default is "MODERN"

func (*Config) TlsVersion

func (*Config) TlsVersion() string

TlsVersion will be used current TLS Policy by this value. The acceptable value MUST BE either`TLS_1_1`/`TLS_1_2`/`TLS_1_3` Default is "TLS_1_2"

Jump to

Keyboard shortcuts

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