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
Click to show internal directories.
Click to hide internal directories.