dp

package
v5.0.0-preview.1+incom... Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 15 Imported by: 9

Documentation

Index

Constants

View Source
const (
	DP_TASK_THREAT_LOG = iota
	DP_TASK_CONNECTION
	DP_TASK_HOST_CONNECTION
	DP_TASK_APPLICATION
	DP_TASK_FQDN_IP
)
View Source
const DPServer string = "/tmp/dp_listen.sock"

Variables

This section is empty.

Functions

func Close

func Close()

func Connected

func Connected() bool

func DPCtrlAddMAC

func DPCtrlAddMAC(iface string, mac, ucmac, bcmac, oldmac, pmac net.HardwareAddr, pips []net.IP)

func DPCtrlAddNfqPort

func DPCtrlAddNfqPort(netns, iface string, epmac net.HardwareAddr, jumboframe *bool)

func DPCtrlAddPortPair

func DPCtrlAddPortPair(vex_iface, vin_iface string, epmac net.HardwareAddr)

func DPCtrlAddSrvcPort

func DPCtrlAddSrvcPort(iface string, jumboframe *bool)

func DPCtrlAddTapPort

func DPCtrlAddTapPort(netns, iface string, epmac net.HardwareAddr)

func DPCtrlBldDlp

func DPCtrlBldDlp(dlpRulesInfo []*DPDlpRuleEntry, dlpDpMacs utils.Set, delmacs utils.Set, dlpApplyDir int) int

func DPCtrlBldDlpChgMac

func DPCtrlBldDlpChgMac(oldmacs, addmacs, delmacs utils.Set)

func DPCtrlClearSession

func DPCtrlClearSession(id uint32)

func DPCtrlConfigAgent

func DPCtrlConfigAgent(debug *DPDebug)

func DPCtrlConfigDlp

func DPCtrlConfigDlp(wldlprule *DPWorkloadDlpRule) int

func DPCtrlConfigInternalSubnet

func DPCtrlConfigInternalSubnet(subnets map[string]share.CLUSSubnet, internal bool)

func DPCtrlConfigMAC

func DPCtrlConfigMAC(MACs []string, tap *bool, appMap map[share.CLUSProtoPort]*share.CLUSApp)

func DPCtrlConfigPolicy

func DPCtrlConfigPolicy(policy *DPWorkloadIPPolicy, cmd uint) int

func DPCtrlConfigSpecialIPSubnet

func DPCtrlConfigSpecialIPSubnet(subnets map[string]share.CLUSSpecSubnet)

func DPCtrlCountSession

func DPCtrlCountSession(cb DPCallback, param interface{})

func DPCtrlCounterAgent

func DPCtrlCounterAgent(cb DPCallback, param interface{})

func DPCtrlDelMAC

func DPCtrlDelMAC(iface string, mac net.HardwareAddr)

func DPCtrlDelNfqPort

func DPCtrlDelNfqPort(netns, iface string)

func DPCtrlDelPortPair

func DPCtrlDelPortPair(vex_iface, vin_iface string)

func DPCtrlDelSrvcPort

func DPCtrlDelSrvcPort(iface string)

func DPCtrlDelTapPort

func DPCtrlDelTapPort(netns, iface string)

func DPCtrlDeleteFqdn

func DPCtrlDeleteFqdn(names []string) int

func DPCtrlDlpCfgChgMac

func DPCtrlDlpCfgChgMac(delmacs utils.Set)

func DPCtrlListMeter

func DPCtrlListMeter(cb DPCallback, param interface{})

func DPCtrlListSession

func DPCtrlListSession(cb DPCallback, param interface{})

func DPCtrlRefreshApp

func DPCtrlRefreshApp()

func DPCtrlSetFqdnIp

func DPCtrlSetFqdnIp(fqdnip *share.CLUSFqdnIp) int

func DPCtrlSetSysConf

func DPCtrlSetSysConf(xffenabled *bool)

func DPCtrlStatsAgent

func DPCtrlStatsAgent(cb DPCallback, param interface{})

func DPCtrlStatsMAC

func DPCtrlStatsMAC(macs []*net.HardwareAddr, cb DPCallback, param interface{})

func Open

func Open(cb DPTaskCallback, sc chan bool, ec chan interface{})

func ParseDPMsgHeader

func ParseDPMsgHeader(msg []byte) *C.DPMsgHdr

Types

type Connection

type Connection struct {
	AgentID      string
	HostID       string
	ClientWL     string
	ServerWL     string
	ClientIP     net.IP
	ServerIP     net.IP
	Scope        string
	Network      string
	ServerPort   uint16
	ClientPort   uint16
	IPProto      uint8
	Application  uint32
	Bytes        uint64
	Sessions     uint32
	FirstSeenAt  uint32
	LastSeenAt   uint32
	ThreatID     uint32
	Severity     uint8
	PolicyAction uint8
	Ingress      bool
	ExternalPeer bool
	LocalPeer    bool
	PolicyId     uint32
	Violates     uint32
	Xff          bool
	SvcExtIP     bool
	ToSidecar    bool
}

type ConnectionData

type ConnectionData struct {
	EPMAC net.HardwareAddr
	Conn  *Connection
}

type DPAddMAC

type DPAddMAC struct {
	Iface  string     `json:"iface"`
	MAC    string     `json:"mac"`
	UCMAC  string     `json:"ucmac"`
	BCMAC  string     `json:"bcmac"`
	OldMAC string     `json:"oldmac"`
	PMAC   string     `json:"pmac"`
	PIPS   []DPMacPip `json:"pips"`
}

type DPAddMACReq

type DPAddMACReq struct {
	AddMAC *DPAddMAC `json:"ctrl_add_mac"`
}

type DPAddNfqPortReq

type DPAddNfqPortReq struct {
	AddNfqPort *DPNfqPort `json:"ctrl_add_nfq_port"`
}

type DPAddPortPairReq

type DPAddPortPairReq struct {
	AddPortPair *DPPortPair `json:"ctrl_add_port_pair"`
}

type DPAddSrvcPortReq

type DPAddSrvcPortReq struct {
	AddPort *DPSrvcPort `json:"ctrl_add_srvc_port"`
}

type DPAddTapPortReq

type DPAddTapPortReq struct {
	AddPort *DPTapPort `json:"ctrl_add_tap_port"`
}

type DPCallback

type DPCallback func(buf []byte, param interface{}) bool

type DPClearSession

type DPClearSession struct {
	ID uint32 `json:"filter_id"`
}

type DPClearSessionReq

type DPClearSessionReq struct {
	ClearSession *DPClearSession `json:"ctrl_clear_session"`
}

type DPConfigMACReq

type DPConfigMACReq struct {
	Cfg *DPMacConfig `json:"ctrl_cfg_mac"`
}

type DPCountSessionReq

type DPCountSessionReq struct {
	CountSession *DPEmpty `json:"ctrl_count_session"`
}

type DPCounterAgentReq

type DPCounterAgentReq struct {
	Counter *DPEmpty `json:"ctrl_counter_device"`
}

type DPDebug

type DPDebug struct {
	Categories []string `json:"categories"`
}

type DPDelMAC

type DPDelMAC struct {
	Iface string `json:"iface"`
	MAC   string `json:"mac"`
}

type DPDelMACReq

type DPDelMACReq struct {
	DelMAC *DPDelMAC `json:"ctrl_del_mac"`
}

type DPDelNfqPortReq

type DPDelNfqPortReq struct {
	DelNfqPort *DPNfqPort `json:"ctrl_del_nfq_port"`
}

type DPDelPortPairReq

type DPDelPortPairReq struct {
	DelPortPair *DPPortPair `json:"ctrl_del_port_pair"`
}

type DPDelSrvcPortReq

type DPDelSrvcPortReq struct {
	DelPort *DPSrvcPort `json:"ctrl_del_srvc_port"`
}

type DPDelTapPortReq

type DPDelTapPortReq struct {
	DelPort *DPTapPort `json:"ctrl_del_tap_port"`
}

type DPDlpBldMACReq

type DPDlpBldMACReq struct {
	DPDlpChgBldMac *DPDlpBldMac `json:"ctrl_bld_dlpmac"`
}

type DPDlpBldMac

type DPDlpBldMac struct {
	OldMac []string `json:"oldmac"`
	AddMac []string `json:"addmac"`
	DelMac []string `json:"delmac"`
}

type DPDlpBldReq

type DPDlpBldReq struct {
	DPDlpBld *DPDlpBuild `json:"ctrl_bld_dlp"`
}

type DPDlpBuild

type DPDlpBuild struct {
	Flag        uint              `json:"flag"`
	ApplyDir    int               `json:"dir"`
	DlpRules    []*DPDlpRuleEntry `json:"dlp_rules"`
	WorkloadMac []string          `json:"mac"`
	DelMac      []string          `json:"delmac"`
}

type DPDlpCfg

type DPDlpCfg struct {
	Flag         uint               `json:"flag"`
	WorkloadMac  []string           `json:"mac"`
	DlpRuleNames []*DPDlpRidSetting `json:"dlp_rule_names"`
	WafRuleNames []*DPDlpRidSetting `json:"waf_rule_names"`
	RuleIds      []uint32           `json:"rule_ids"`
	WafRuleIds   []uint32           `json:"waf_rule_ids"`
	RuleType     string             `json:"ruletype"`
}

type DPDlpCfgMACReq

type DPDlpCfgMACReq struct {
	DPDlpChgCfgMac *DPDlpCfgMac `json:"ctrl_cfg_dlpmac"`
}

type DPDlpCfgMac

type DPDlpCfgMac struct {
	DelMac []string `json:"delmac"`
}

type DPDlpCfgReq

type DPDlpCfgReq struct {
	DPWlDlpCfg *DPDlpCfg `json:"ctrl_cfg_dlp"`
}

type DPDlpRidSetting

type DPDlpRidSetting struct {
	ID     uint32 `json:"id"`
	Action uint8  `json:"action"`
}

type DPDlpRuleEntry

type DPDlpRuleEntry struct {
	Name     string   `json:"name"`
	ID       uint32   `json:"id"`
	Patterns []string `json:"patterns"`
}

type DPDlpSetting

type DPDlpSetting struct {
	Name   string `json:"name"`
	ID     uint32 `json:"id"`
	Action uint8  `json:"action"`
}

dlp

type DPEmpty

type DPEmpty struct {
}

type DPFqdnDeleteReq

type DPFqdnDeleteReq struct {
	Delete *DPFqdnList `json:"ctrl_cfg_del_fqdn"`
}

type DPFqdnIpSetReq

type DPFqdnIpSetReq struct {
	Fqdns *DPFqdnIps `json:"ctrl_cfg_set_fqdn"`
}

type DPFqdnIps

type DPFqdnIps struct {
	FqdnName string   `json:"fqdn_name"`
	FqdnIps  []net.IP `json:"fqdn_ips"`
}

type DPFqdnList

type DPFqdnList struct {
	Names []string `json:"names"`
}

type DPInternalSubnetCfg

type DPInternalSubnetCfg struct {
	Flag    uint       `json:"flag"`
	Subnets []DPSubnet `json:"subnet_addr"`
}

type DPInternalSubnetCfgReq

type DPInternalSubnetCfgReq struct {
	SubnetCfg *DPInternalSubnetCfg `json:"ctrl_cfg_internal_net"`
}

type DPKeepAlive

type DPKeepAlive struct {
	SeqNum uint32 `json:"seq_num"`
}

type DPKeepAliveReq

type DPKeepAliveReq struct {
	Alive *DPKeepAlive `json:"ctrl_keep_alive"`
}

type DPListMeterReq

type DPListMeterReq struct {
	ListMeter *DPEmpty `json:"ctrl_list_meter"`
}

type DPListSessionReq

type DPListSessionReq struct {
	ListSession *DPEmpty `json:"ctrl_list_session"`
}

type DPMACArray

type DPMACArray struct {
	MACs []string `json:"macs"`
}

type DPMacConfig

type DPMacConfig struct {
	MACs []string          `json:"macs"`
	Tap  *bool             `json:"tap,omitempty"`
	Apps *[]DPProtoPortApp `json:"apps,omitempty"`
}

type DPMacPip

type DPMacPip struct {
	IP net.IP `json:"ip"`
}

type DPNfqPort

type DPNfqPort struct {
	NetNS      string `json:"netns"`
	Iface      string `json:"iface"`
	EPMAC      string `json:"epmac"`
	JumboFrame *bool  `json:"jumboframe,omitempty"`
}

type DPPolicyAddressCfgReq

type DPPolicyAddressCfgReq struct {
	PolicyAddrCfg *DPInternalSubnetCfg `json:"ctrl_cfg_policy_addr"`
}

type DPPolicyApp

type DPPolicyApp struct {
	App    uint32 `json:"app"`
	Action uint8  `json:"action"`
	RuleID uint32 `json:"rid"`
}

type DPPolicyCfg

type DPPolicyCfg struct {
	Cmd         uint              `json:"cmd"`
	Flag        uint              `json:"flag"`
	DefAction   uint8             `json:"defact"`
	ApplyDir    int               `json:"dir"`
	WorkloadMac []string          `json:"mac"`
	IPRules     []*DPPolicyIPRule `json:"rules"`
}

type DPPolicyCfgReq

type DPPolicyCfgReq struct {
	DPPolicyCfg *DPPolicyCfg `json:"ctrl_cfg_policy"`
}

type DPPolicyIPRule

type DPPolicyIPRule struct {
	ID      uint32         `json:"id"`
	SrcIP   net.IP         `json:"sip"`
	DstIP   net.IP         `json:"dip"`
	SrcIPR  net.IP         `json:"sipr,omitempty"`
	DstIPR  net.IP         `json:"dipr,omitempty"`
	Port    uint16         `json:"port"`
	PortR   uint16         `json:"portr"`
	IPProto uint8          `json:"proto"`
	Action  uint8          `json:"action"`
	Ingress bool           `json:"ingress"`
	Fqdn    string         `json:"fqdn,omitempty"`
	Apps    []*DPPolicyApp `json:"apps,omitempty"`
}

type DPPortPair

type DPPortPair struct {
	IfaceVex string `json:"vex_iface"`
	IfaceVin string `json:"vin_iface"`
	EPMAC    string `json:"epmac"`
}

type DPProtoPortApp

type DPProtoPortApp struct {
	IPProto     uint8  `json:"ip_proto"`
	Port        uint16 `json:"port"`
	Application uint32 `json:"app"`
	Server      uint32 `json:"server"`
}

type DPRefreshApp

type DPRefreshApp struct {
}

type DPRefreshAppReq

type DPRefreshAppReq struct {
	RefreshApp *DPRefreshApp `json:"ctrl_refresh_app"`
}

type DPSetDebugReq

type DPSetDebugReq struct {
	Debug *DPDebug `json:"ctrl_set_debug"`
}

type DPSpecIPSubnetCfg

type DPSpecIPSubnetCfg struct {
	Flag    uint           `json:"flag"`
	Subnets []DPSpecSubnet `json:"subnet_addr"`
}

type DPSpecSubnet

type DPSpecSubnet struct {
	IP     net.IP `json:"ip"`
	Mask   net.IP `json:"mask"`
	IpType string `json:"iptype"`
}

type DPSpecialIPSubnetCfgReq

type DPSpecialIPSubnetCfgReq struct {
	SubnetCfg *DPSpecIPSubnetCfg `json:"ctrl_cfg_specip_net"`
}

type DPSrvcPort

type DPSrvcPort struct {
	Iface      string `json:"iface"`
	JumboFrame *bool  `json:"jumboframe,omitempty"`
}

type DPStatsAgentReq

type DPStatsAgentReq struct {
	Stats *DPEmpty `json:"ctrl_stats_device"`
}

type DPStatsMACReq

type DPStatsMACReq struct {
	Stats *DPMACArray `json:"ctrl_stats_macs"`
}

type DPSubnet

type DPSubnet struct {
	IP   net.IP `json:"ip"`
	Mask net.IP `json:"mask"`
}

type DPSysConf

type DPSysConf struct {
	XffEnabled *bool `json:"xff_enabled"`
}

type DPSysConfReq

type DPSysConfReq struct {
	Sysconf *DPSysConf `json:"ctrl_sys_conf"`
}

type DPTapPort

type DPTapPort struct {
	NetNS string `json:"netns"`
	Iface string `json:"iface"`
	EPMAC string `json:"epmac"`
}

type DPTask

type DPTask struct {
	Task     int
	MAC      net.HardwareAddr
	SecLog   *share.CLUSThreatLog
	Connects []*ConnectionData
	Apps     map[share.CLUSProtoPort]*share.CLUSApp
	Fqdns    *share.CLUSFqdnIp
}

type DPTaskCallback

type DPTaskCallback func(task *DPTask)

type DPWorkloadDlpRule

type DPWorkloadDlpRule struct {
	WlID          string          `json:"wl_id"`
	Mode          string          `json:"mode"`
	DefAction     uint8           `json:"defact"`
	ApplyDir      int             `json:"apply_dir"`
	WorkloadMac   []string        `json:"mac"`
	DlpRuleNames  []*DPDlpSetting `json:"dlp_rule_names"`
	WafRuleNames  []*DPDlpSetting `json:"waf_rule_names"`
	PolicyRuleIds []uint32        `json:"policy_rule_ids"`
	PolWafRuleIds []uint32        `json:"polwaf_rule_ids"`
	RuleType      string          `json:"ruletype"`
}

type DPWorkloadIPPolicy

type DPWorkloadIPPolicy struct {
	WlID        string            `json:"wl_id"`
	Mode        string            `json:"mode"`
	DefAction   uint8             `json:"defact"`
	ApplyDir    int               `json:"apply_dir"`
	WorkloadMac []string          `json:"mac"`
	IPRules     []*DPPolicyIPRule `json:"policy_rules"`
}

Jump to

Keyboard shortcuts

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