Documentation ¶
Index ¶
Constants ¶
const ( Disabled enumBase = 0 Enabled enumBase = 1 Unknown enumBase = 2 )
enum defining the states a fiewall can be in.
const DefaultTimeout time.Duration = 10 * time.Second
default timeout used in commands.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirewallEnumOptFunc ¶
type FirewallEnumOptFunc func(*FirewallEnumOptions) error
type definition explaining a Firewall Enumerator Options Function. this will be used during the initialization of a new FirewalEnumerator to set user-controlled variables.
func ErrorOutputOff ¶
func ErrorOutputOff() FirewallEnumOptFunc
function designed to turn off the error output for a FirewallEnumerator. this will not show non-critical errors when the occur; they will just be ignored and the function will continue without signaling to the user that something went wrong.
type FirewallEnumOptions ¶
type FirewallEnumOptions struct {
DisplayErrors bool
}
structure designed to hold the options a user can set when initializing a FirewallEnumerator.
type FirewallEnumerator ¶
type FirewallEnumerator struct {
// contains filtered or unexported fields
}
structure representing the object that will conduct the firewall enumeration.
func NewFirewallEnumerator ¶
func NewFirewallEnumerator(optFuncs ...FirewallEnumOptFunc) (enumerator *FirewallEnumerator, err error)
function designed to create and initialize a new FirewallEnumerator object that can be used by the end-user. this returns a pointer to the newly created object and an error (nil if successful).
func (*FirewallEnumerator) CheckFirewalls ¶
func (fe *FirewallEnumerator) CheckFirewalls() (activefirewalls []string, err error)
function designed to determine whether the discovered firewall(s) are active. if the firewall binary requires sudo (elevated) privileges and the command errors out, the next discovered firewall will be checked.
the firewall binaries that error out will be kept track of and an error will be raised if no firewalls were found to be running but at least one error occurred during testing.
func (*FirewallEnumerator) EnumBinaries ¶
func (fe *FirewallEnumerator) EnumBinaries() (err error)
function designed to look for the target firewall binaries on the current machine.
this will return a string slice outlining the absolute paths of any binaries found.
func (*FirewallEnumerator) ShowFirewallBinaries ¶
func (fe *FirewallEnumerator) ShowFirewallBinaries() (err error)
function designed to output the discovered firewall binaries.
if no binaries have been discovered, an error will be returned.
func (*FirewallEnumerator) ShowServices ¶
func (fe *FirewallEnumerator) ShowServices() (err error)
function designed to output the discovered services and their status.
if no services have been discovered an error will be returned.