networkservice

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInternalIP

func IsInternalIP(cidr string) bool

Returns true if the IP is an internal ipv4 or ipv6 IP

Types

type Endpoint

type Endpoint struct {
	IP       string   `json:"ip"`
	Ports    []string `json:"ports"`
	Protocol string   `json:"protocol"`
}

type FirewallRule

type FirewallRule struct {
	FWName            string              `json:"fw_name"`
	Description       string              `json:"description"`
	Direction         string              `json:"direction"`
	Allowed           map[string][]string `json:"allowed"`
	Denied            map[string][]string `json:"denied"`
	SourceRanges      []string            `json:"source_ranges"`
	TargetTag         string              `json:"target_tag"`
	AllowedTraffic    Traffic             `json:"allowed_traffic"`
	ExposedEndpoints  []Endpoint          `json:"exposed_endpoints"`
	DestinationRanges []string            `json:"destinatioRanges"`
	TargetTags        []string            `json:"targetTags"`
}

type NetwworkService

type NetwworkService struct {
}

func New

func New() *NetwworkService

func (*NetwworkService) FirewallRules

func (ns *NetwworkService) FirewallRules(projectID string) ([]*compute.Firewall, error)

Returns firewall rules for a project.

func (*NetwworkService) FirewallRulesWithPublicExposure

func (ns *NetwworkService) FirewallRulesWithPublicExposure(projectID string) ([]FirewallRule, error)

Returns firewall rules with additional logic to tag rules that expose resources to the public

type Traffic

type Traffic struct {
	TCP []string `json:"tcp"`
	UDP []string `json:"udp"`
}

Jump to

Keyboard shortcuts

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