firewall

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// IsEnabled returns if firewall is enabled
	IsEnabled() (bool, error)

	// AllowTcpPort adds a rule to open a port on the host
	AllowTcpPort(string) error

	// AllowTcpPortRange adds a rule to open a range of port on the host
	AllowTcpPortRange(string, string) error

	// FlushRules writes newly added rules to disk and reloads the firewall
	FlushRules() error
}

Manager is an interface for providing firewall functionalities

func NewFirewalld

func NewFirewalld() Manager

func NewUncomplicatedFirewall

func NewUncomplicatedFirewall() Manager

type UncomplicatedFireWall

type UncomplicatedFireWall struct {
	// contains filtered or unexported fields
}

func (*UncomplicatedFireWall) AllowTcpPort

func (ufw *UncomplicatedFireWall) AllowTcpPort(port string) error

AllowTcpPort adds a rule to the firewall to open input port

func (*UncomplicatedFireWall) AllowTcpPortRange

func (ufw *UncomplicatedFireWall) AllowTcpPortRange(startPort, endPort string) error

AllowTcpPortRange adds a rule to the firewall to open the range of input port

func (*UncomplicatedFireWall) FlushRules

func (ufw *UncomplicatedFireWall) FlushRules() error

FlushRules flushes the rules and reloads the firewall to enforce the rules

func (*UncomplicatedFireWall) IsEnabled

func (ufw *UncomplicatedFireWall) IsEnabled() (bool, error)

IsEnabled returns true if ufw is enabled and running on the node

Jump to

Keyboard shortcuts

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