firewall

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(c HTTPClient) *Client

func (*Client) GetOptions

func (c *Client) GetOptions(ctx context.Context, req *GetOptionsRequest) (*GetOptionsResponse, error)

GetOptions Get host firewall options.

func (*Client) Index

func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)

Index Directory index.

func (*Client) Log

func (c *Client) Log(ctx context.Context, req *LogRequest) (*LogResponse, error)

Log Read firewall log

func (*Client) SetOptions

func (c *Client) SetOptions(ctx context.Context, req *SetOptionsRequest) (*SetOptionsResponse, error)

SetOptions Set Firewall options.

type GetOptionsRequest

type GetOptionsRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.

}

type GetOptionsResponse

type GetOptionsResponse map[string]interface{}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexRequest

type IndexRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.

}

type IndexResponse

type IndexResponse []*map[string]interface{}

type LogRequest

type LogRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.

	// The following parameters are optional
	Limit *int `url:"limit,omitempty",json:"limit,omitempty"`
	Start *int `url:"start,omitempty",json:"start,omitempty"`
}

type LogResponse

type LogResponse []*struct {
	N int    `url:"n",json:"n"` // Line number
	T string `url:"t",json:"t"` // Line text

}

type SetOptionsRequest

type SetOptionsRequest struct {
	Node string `url:"node",json:"node"` // The cluster node name.

	// The following parameters are optional
	Delete                           *string `url:"delete,omitempty",json:"delete,omitempty"`                                                             // A list of settings you want to delete.
	Digest                           *string `url:"digest,omitempty",json:"digest,omitempty"`                                                             // Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications.
	Enable                           *bool   `url:"enable,omitempty",json:"enable,omitempty"`                                                             // Enable host firewall rules.
	LogLevelIn                       *string `url:"log_level_in,omitempty",json:"log_level_in,omitempty"`                                                 // Log level for incoming traffic.
	LogLevelOut                      *string `url:"log_level_out,omitempty",json:"log_level_out,omitempty"`                                               // Log level for outgoing traffic.
	LogNfConntrack                   *bool   `url:"log_nf_conntrack,omitempty",json:"log_nf_conntrack,omitempty"`                                         // Enable logging of conntrack information.
	Ndp                              *bool   `url:"ndp,omitempty",json:"ndp,omitempty"`                                                                   // Enable NDP (Neighbor Discovery Protocol).
	NfConntrackAllowInvalid          *bool   `url:"nf_conntrack_allow_invalid,omitempty",json:"nf_conntrack_allow_invalid,omitempty"`                     // Allow invalid packets on connection tracking.
	NfConntrackMax                   *int    `url:"nf_conntrack_max,omitempty",json:"nf_conntrack_max,omitempty"`                                         // Maximum number of tracked connections.
	NfConntrackTcpTimeoutEstablished *int    `url:"nf_conntrack_tcp_timeout_established,omitempty",json:"nf_conntrack_tcp_timeout_established,omitempty"` // Conntrack established timeout.
	NfConntrackTcpTimeoutSynRecv     *int    `url:"nf_conntrack_tcp_timeout_syn_recv,omitempty",json:"nf_conntrack_tcp_timeout_syn_recv,omitempty"`       // Conntrack syn recv timeout.
	Nosmurfs                         *bool   `url:"nosmurfs,omitempty",json:"nosmurfs,omitempty"`                                                         // Enable SMURFS filter.
	ProtectionSynflood               *bool   `url:"protection_synflood,omitempty",json:"protection_synflood,omitempty"`                                   // Enable synflood protection
	ProtectionSynfloodBurst          *int    `url:"protection_synflood_burst,omitempty",json:"protection_synflood_burst,omitempty"`                       // Synflood protection rate burst by ip src.
	ProtectionSynfloodRate           *int    `url:"protection_synflood_rate,omitempty",json:"protection_synflood_rate,omitempty"`                         // Synflood protection rate syn/sec by ip src.
	SmurfLogLevel                    *string `url:"smurf_log_level,omitempty",json:"smurf_log_level,omitempty"`                                           // Log level for SMURFS filter.
	TcpFlagsLogLevel                 *string `url:"tcp_flags_log_level,omitempty",json:"tcp_flags_log_level,omitempty"`                                   // Log level for illegal tcp flags filter.
	Tcpflags                         *bool   `url:"tcpflags,omitempty",json:"tcpflags,omitempty"`                                                         // Filter illegal combinations of TCP flags.
}

type SetOptionsResponse

type SetOptionsResponse map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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