netsec

package
v0.0.0-...-7ed9018 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerSecurity

type ContainerSecurity struct {
	ID             string
	Pid            int
	Pretend        bool
	SecurityGroups map[string][]uint16 // ipgroup name -> ports
	// contains filtered or unexported fields
}

func NewContainerSecurity

func NewContainerSecurity(id string, pid int, sgs map[string][]uint16, pretend bool) (contSec *ContainerSecurity, err error)

func (ContainerSecurity) String

func (c ContainerSecurity) String() string

type NetworkSecurity

type NetworkSecurity struct {
	sync.Mutex
	Pretend    bool
	SaveFile   string                        // where to save state
	DeniedIPs  map[string]bool               // list of denied IPs. map for easy existence check
	IPGroups   map[string][]string           // group name -> list of infrastructure IPs to blanket deny
	Containers map[string]*ContainerSecurity // container id -> ContainerSecurity
}

func New

func New(saveFile string, pretend bool) *NetworkSecurity

func (*NetworkSecurity) AddContainerSecurity

func (n *NetworkSecurity) AddContainerSecurity(id string, pid int, sgs map[string][]uint16) error

func (*NetworkSecurity) DeleteIPGroup

func (n *NetworkSecurity) DeleteIPGroup(name string) error

func (*NetworkSecurity) RemoveContainerSecurity

func (n *NetworkSecurity) RemoveContainerSecurity(id string) error

func (*NetworkSecurity) UpdateIPGroup

func (n *NetworkSecurity) UpdateIPGroup(name string, ips []string) error

Jump to

Keyboard shortcuts

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