spcgi

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 5 Imported by: 0

README

go-spcgi

package to wrap the backend of a Securepoint UTM

work in progress

used packages

getting started

go get github.com/Lukas-Nielsen/go-spcgi
import "github.com/Lukas-Nielsen/go-spcgi"

usage

TODO

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertingcenterAlerts

type AlertingcenterAlerts struct {
	AlertID     string    `json:"alert_id,omitempty"`
	Severity    string    `json:"severity,omitempty"`
	Time        time.Time `json:"time,omitempty"`
	Collector   string    `json:"collector,omitempty"`
	Program     string    `json:"program,omitempty"`
	UserMessage string    `json:"user_message,omitempty"`
	Content     []struct {
		Attribute string `json:"attribute,omitempty"`
		Value     string `json:"value,omitempty"`
	} `json:"content,omitempty"`
}

type AlertingcenterAlertsProgram

type AlertingcenterAlertsProgram struct {
	Program           string `json:"program,omitempty"`
	ProgramTranslated string `json:"program_translated,omitempty"`
}

type AlertingcenterSeverity

type AlertingcenterSeverity struct {
	Priority int      `json:"priority,omitempty"`
	Severity string   `json:"severity,omitempty"`
	Emitter  []string `json:"emitter,omitempty"`
}

type AlertingcenterSyslogPattern

type AlertingcenterSyslogPattern struct {
	PatternID      int    `json:"pattern_id,omitempty"`
	PatternName    string `json:"pattern_name,omitempty"`
	GroupID        int    `json:"group_id,omitempty"`
	PatternMessage string `json:"pattern_message,omitempty"`
}

type AlertingcenterSyslogPatterngroup

type AlertingcenterSyslogPatterngroup struct {
	GroupID       int    `json:"group_id,omitempty"`
	GroupName     string `json:"group_name,omitempty"`
	GroupSeverity string `json:"group_severity,omitempty"`
	GroupMessage  string `json:"group_message,omitempty"`
}

type Appmgmt

type Appmgmt struct {
	Application string `json:"application,omitempty"`
	State       string `json:"state,omitempty"`
	Flags       []any  `json:"flags,omitempty"`
}

type Cert

type Cert struct {
	ID               int      `json:"id,omitempty"`
	Name             string   `json:"name,omitempty"`
	Issuer           string   `json:"issuer,omitempty"`
	Flags            []string `json:"flags,omitempty"`
	Country          string   `json:"country,omitempty"`
	State            string   `json:"state,omitempty"`
	Location         string   `json:"location,omitempty"`
	Organization     string   `json:"organization,omitempty"`
	OrganizationUnit string   `json:"organization_unit,omitempty"`
	CommonName       string   `json:"common_name,omitempty"`
	Email            string   `json:"email,omitempty"`
	Bits             int      `json:"bits,omitempty"`
	ValidSince       string   `json:"valid_since,omitempty"`
	ValidTill        string   `json:"valid_till,omitempty"`
	SignatureAlgo    string   `json:"signature_algo,omitempty"`
	Status           string   `json:"status,omitempty"`
	Content          []struct {
		ExtName  string `json:"ext_name,omitempty"`
		ExtValue string `json:"ext_value,omitempty"`
	} `json:"content,omitempty"`
	AcmeAccountID        int    `json:"acme_account_id,omitempty"`
	AcmeAccountName      string `json:"acme_account_name,omitempty"`
	AcmeMinLifetime      int    `json:"acme_min_lifetime,omitempty"`
	AcmeCertAltChainHint string `json:"acme_cert_alt_chain_hint,omitempty"`
	AcmeStatus           string `json:"acme_status,omitempty"`
	AcmeMsg              string `json:"acme_msg,omitempty"`
	AcmeErrorCount       int    `json:"acme_error_count,omitempty"`
	AcmeAltnameIDList    []int  `json:"acme_altname_id_list,omitempty"`
	AltName              string `json:"alt_name,omitempty"`
}

type CertAcmeaccount

type CertAcmeaccount struct {
	ID                 int      `json:"acme_account_id,omitempty"`
	Name               string   `json:"acme_account_name,omitempty"`
	URL                string   `json:"acme_account_url,omitempty"`
	EntryPath          string   `json:"acme_account_entry_path,omitempty"`
	Email              string   `json:"acme_account_email,omitempty"`
	Flags              []string `json:"acme_account_flags,omitempty"`
	MinLifetime        int      `json:"acme_min_lifetime,omitempty"`
	Keytype            string   `json:"acme_account_keytype,omitempty"`
	Status             string   `json:"acme_status,omitempty"`
	Msg                string   `json:"acme_msg,omitempty"`
	ErrorCount         int      `json:"acme_error_count,omitempty"`
	UserActionRequired int      `json:"acme_account_user_action_required,omitempty"`
}

type CertAcmenames

type CertAcmenames struct {
	AltnameID          int    `json:"acme_altname_id,omitempty"`
	Altname            string `json:"acme_altname,omitempty"`
	ChallengeID        int    `json:"acme_challenge_id,omitempty"`
	Alias              string `json:"acme_alias,omitempty"`
	Apikey             string `json:"acme_apikey,omitempty"`
	ChallengeStatus    int    `json:"acme_challenge_status,omitempty"`
	Msg                string `json:"acme_msg,omitempty"`
	ChallengeTs        int    `json:"acme_challenge_ts,omitempty"`
	ChallengeNextStepS int    `json:"acme_challenge_next_step_s,omitempty"`
}

type Client

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

func NewCLient

func NewCLient(conf Conf) *Client

func (*Client) AlertingscenterAlertsGet

func (c *Client) AlertingscenterAlertsGet() ([]AlertingcenterAlerts, error)

func (*Client) AlertingscenterAlertsProgramGet

func (c *Client) AlertingscenterAlertsProgramGet() ([]AlertingcenterAlertsProgram, error)

func (*Client) AlertingscenterSeverityGet

func (c *Client) AlertingscenterSeverityGet() ([]AlertingcenterSeverity, error)

func (*Client) AlertingscenterSyslogPatternGet

func (c *Client) AlertingscenterSyslogPatternGet() ([]AlertingcenterSyslogPattern, error)

func (*Client) AlertingscenterSyslogPatterngroupGet

func (c *Client) AlertingscenterSyslogPatterngroupGet() ([]AlertingcenterSyslogPatterngroup, error)

func (*Client) AppmgmtConfig

func (c *Client) AppmgmtConfig() error

func (*Client) AppmgmtGet

func (c *Client) AppmgmtGet() ([]Appmgmt, error)

func (*Client) AppmgmtRestart

func (c *Client) AppmgmtRestart(a string) error

pass application name

func (*Client) AppmgmtSet

func (c *Client) AppmgmtSet(a string, f ...string) error

pass application name and flags

func (*Client) AppmgmtStart

func (c *Client) AppmgmtStart(a string) error

pass application name

func (*Client) AppmgmtStatus

func (c *Client) AppmgmtStatus() ([]Appmgmt, error)

func (*Client) AppmgmtStop

func (c *Client) AppmgmtStop(a string) error

pass application name

func (*Client) AppmgmtUpdate

func (c *Client) AppmgmtUpdate() error

func (*Client) AppmgmtUpdateApplication

func (c *Client) AppmgmtUpdateApplication(a string) error

pass application name

func (*Client) CertAcmeaccountGet

func (c *Client) CertAcmeaccountGet() ([]CertAcmeaccount, error)

func (*Client) CertAcmenamesGet

func (c *Client) CertAcmenamesGet() ([]CertAcmenames, error)

func (*Client) CertGet

func (c *Client) CertGet() ([]Cert, error)

func (*Client) DhcpLeaseDelete

func (c *Client) DhcpLeaseDelete(h string) error

Löschen eines bestehenden statischen DHCP Lease

host

func (*Client) DhcpLeaseGet

func (c *Client) DhcpLeaseGet() ([]DhcpLeaseStatic, error)

Auflistung der vorhandenen statischen DHCP Leases

func (*Client) DhcpLeaseList

func (c *Client) DhcpLeaseList() ([]DhcpLease, error)

Auflistung der zugeteilten DHCP Leases

func (*Client) DhcpLeaseNew

func (c *Client) DhcpLeaseNew(h string, m string, i string) error

Erstellt eine neues statisches DHCP Lease

host, mac, ip

func (*Client) DhcpLeaseSet

func (c *Client) DhcpLeaseSet(id int, h string, m string, i string) error

Ändert ein bestehendes statisches DHCP Lease

id, host, mac, ip

func (*Client) DhcpPoolDelete

func (c *Client) DhcpPoolDelete(n string) error

Löschen eines bestehenden DHCP Pool

name

func (*Client) DhcpPoolGet

func (c *Client) DhcpPoolGet() ([]DhcpPool, error)

Auflistung der angelegten DHCP Pools

func (*Client) DhcpPoolNew

func (c *Client) DhcpPoolNew(n string, s string, e string) error

Erstellt einen neuen DHCP Pool

pool-name, pool-start and pool-end

func (*Client) DhcpPoolSet

func (c *Client) DhcpPoolSet(d DhcpPool) error

Ändert die Eigenschaften eines bestehenden DHCP Pool

func (*Client) Login

func (c *Client) Login() error

func (*Client) Logout

func (c *Client) Logout() error

func (*Client) NodeGet

func (c *Client) NodeGet() ([]Node, error)

Gibt eine Liste mit den Netwerkobjekten zurück

func (*Client) NodeGroupGet

func (c *Client) NodeGroupGet() ([]NodeGroup, error)

Gibt eine Liste mit den Netzwerkobjektgruppen zurück

func (*Client) Request

func (c *Client) Request(r Request) ([]byte, error)

func (*Client) RuleGet

func (c *Client) RuleGet() ([]Rule, error)

Gibt eine Liste mit den Regeln zurück

func (*Client) ServiceGet

func (c *Client) ServiceGet() ([]Service, error)

Gibt eine Liste mit den Diensten zurück

func (*Client) ServiceGroupGet

func (c *Client) ServiceGroupGet() ([]ServiceGroup, error)

Gibt eine Liste mit den Dienstgruppen zurück

func (*Client) SetHost

func (c *Client) SetHost(i string) *Client

func (*Client) SetInsecure

func (c *Client) SetInsecure(i bool) *Client

func (*Client) SetPassword

func (c *Client) SetPassword(i string) *Client

func (*Client) SetPort

func (c *Client) SetPort(i int) *Client

func (*Client) SetUser

func (c *Client) SetUser(i string) *Client

type Conf

type Conf struct {
	User     string
	Password string
	Host     string
	Port     int
	Insecure bool
}

type DhcpLease

type DhcpLease struct {
	IP       string `json:"ip,omitempty"`
	Ethernet string `json:"ethernet,omitempty"`
	Host     string `json:"host,omitempty"`
	Cltt     string `json:"cltt,omitempty"`
	End      string `json:"end,omitempty"`
	Binding  string `json:"binding,omitempty"`
}

type DhcpLeaseStatic

type DhcpLeaseStatic struct {
	Host     string `json:"host,omitempty"`
	Ethernet string `json:"ethernet,omitempty"`
	IP       string `json:"ip,omitempty"`
}

type DhcpPool

type DhcpPool struct {
	ID    int    `json:"id,omitempty"`
	Name  string `json:"name,omitempty"`
	Start string `json:"start,omitempty"`
	End   string `json:"end,omitempty"`
}

type Node

type Node struct {
	Address string `json:"address,omitempty"`
	ID      int    `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
	Zone    string `json:"zone,omitempty"`
}

type NodeGroup

type NodeGroup struct {
	ID    int      `json:"id,omitempty"`
	Name  string   `json:"name,omitempty"`
	Nodes []string `json:"nodes,omitempty"`
}

type Request

type Request struct {
	Module    string         `json:"module,omitempty"`
	Command   []string       `json:"command,omitempty"`
	SessionID string         `json:"sessionid,omitempty"`
	Arguments map[string]any `json:"arguments,omitempty"`
}

type Response

type Response struct {
	SessionID string `json:"sessionid,omitempty"`
	Mode      string `json:"mode,omitempty"`
	Result    struct {
		Module  string `json:"module,omitempty"`
		Code    int    `json:"code,omitempty"`
		Status  string `json:"status,omitempty"`
		Message string `json:"message,omitempty"`
		Content []any  `json:"content,omitempty"`
	} `json:"result,omitempty"`
	Version string `json:"version,omitempty"`
}

type Rule

type Rule struct {
	Applayer    string   `json:"applayer,omitempty"`
	Comment     string   `json:"comment,omitempty"`
	Dst         string   `json:"dst,omitempty"`
	Flags       []string `json:"flags,omitempty"`
	Group       string   `json:"group,omitempty"`
	ID          int      `json:"id,omitempty"`
	Log         any      `json:"log,omitempty"`
	NatNode     string   `json:"nat_node,omitempty"`
	NatService  string   `json:"nat_service,omitempty"`
	Pos         int      `json:"pos,omitempty"`
	Qos         any      `json:"qos,omitempty"`
	Route       any      `json:"route,omitempty"`
	Service     string   `json:"service,omitempty"`
	Src         string   `json:"src,omitempty"`
	Timeprofile any      `json:"timeprofile,omitempty"`
}

type Service

type Service struct {
	CtHelper  any      `json:"ct_helper,omitempty"`
	ID        int      `json:"id,omitempty"`
	Name      string   `json:"name,omitempty"`
	Proto     string   `json:"proto,omitempty"`
	DstPorts  []string `json:"dst-ports,omitempty"`
	IcmpTypes []string `json:"icmp-types,omitempty"`
}

type ServiceGroup

type ServiceGroup struct {
	Descr    string   `json:"descr,omitempty"`
	ID       int      `json:"id,omitempty"`
	Name     string   `json:"name,omitempty"`
	Services []string `json:"services,omitempty"`
}

Jump to

Keyboard shortcuts

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