Documentation ¶
Index ¶
- Constants
- type Communication
- func GetCommunication(pid int, domain string) (comm *Communication, ok bool)
- func GetCommunicationByDNSRequest(ip net.IP, port uint16, fqdn string) (*Communication, error)
- func GetCommunicationByFirstPacket(pkt packet.Packet) (*Communication, error)
- func GetUnknownCommunication(pkt packet.Packet) (*Communication, error)
- func (comm *Communication) Accept(reason string)
- func (comm *Communication) AddLink(link *Link)
- func (comm *Communication) AddReason(reason string)
- func (comm *Communication) Block(reason string)
- func (comm *Communication) Delete()
- func (comm *Communication) Deny(reason string)
- func (comm *Communication) Drop(reason string)
- func (comm *Communication) GetVerdict() Verdict
- func (comm *Communication) NeedsReevaluation() bool
- func (comm *Communication) Process() *process.Process
- func (comm *Communication) RemoveLink()
- func (comm *Communication) ResetVerdict()
- func (comm *Communication) Save() error
- func (comm *Communication) String() string
- func (comm *Communication) UpdateVerdict(newVerdict Verdict)
- type FirewallHandler
- type Link
- func (link *Link) Accept(reason string)
- func (link *Link) AddReason(reason string)
- func (link *Link) ApplyVerdict(pkt packet.Packet)
- func (link *Link) Block(reason string)
- func (link *Link) Communication() *Communication
- func (link *Link) Delete()
- func (link *Link) Deny(reason string)
- func (link *Link) Drop(reason string)
- func (link *Link) FirewallHandlerIsSet() bool
- func (link *Link) GetActiveInspectors() []bool
- func (link *Link) GetInspectorData() map[uint8]interface{}
- func (link *Link) GetVerdict() Verdict
- func (link *Link) HandlePacket(pkt packet.Packet)
- func (link *Link) RerouteToNameserver()
- func (link *Link) RerouteToTunnel(reason string)
- func (link *Link) Save() error
- func (link *Link) SetActiveInspectors(new []bool)
- func (link *Link) SetFirewallHandler(handler FirewallHandler)
- func (link *Link) SetInspectorData(new map[uint8]interface{})
- func (link *Link) StopFirewallHandler()
- func (link *Link) String() string
- func (link *Link) UpdateVerdict(newVerdict Verdict)
- type StorageInterface
- type Verdict
Constants ¶
const ( Inbound = true Outbound = false )
Packer Directions
const ( IncomingHost = "IH" IncomingLAN = "IL" IncomingInternet = "II" IncomingInvalid = "IX" PeerHost = "PH" PeerLAN = "PL" PeerInternet = "PI" PeerInvalid = "PX" )
Non-Domain Connections
const (
ReasonUnknownProcess = "unknown connection owner: process could not be found"
)
Static reasons
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Communication ¶ added in v0.2.2
type Communication struct { record.Base sync.Mutex Domain string Direction bool Intel *intel.Intel Verdict Verdict Reason string Inspect bool FirstLinkEstablished int64 LastLinkEstablished int64 LinkCount uint // contains filtered or unexported fields }
Communication describes a logical connection between a process and a domain.
func GetCommunication ¶ added in v0.2.2
func GetCommunication(pid int, domain string) (comm *Communication, ok bool)
GetCommunication fetches a connection object from the internal storage.
func GetCommunicationByDNSRequest ¶ added in v0.2.2
GetCommunicationByDNSRequest returns the matching communication from the internal storage.
func GetCommunicationByFirstPacket ¶ added in v0.2.2
func GetCommunicationByFirstPacket(pkt packet.Packet) (*Communication, error)
GetCommunicationByFirstPacket returns the matching communication from the internal storage.
func GetUnknownCommunication ¶ added in v0.2.2
func GetUnknownCommunication(pkt packet.Packet) (*Communication, error)
GetUnknownCommunication returns the connection to a packet of unknown owner.
func (*Communication) Accept ¶ added in v0.2.2
func (comm *Communication) Accept(reason string)
Accept accepts the communication and adds the given reason.
func (*Communication) AddLink ¶ added in v0.2.2
func (comm *Communication) AddLink(link *Link)
AddLink applies the Communication to the Link and increases sets counter and timestamps.
func (*Communication) AddReason ¶ added in v0.2.2
func (comm *Communication) AddReason(reason string)
AddReason adds a human readable string as to why a certain verdict was set in regard to this communication.
func (*Communication) Block ¶ added in v0.2.2
func (comm *Communication) Block(reason string)
Block blocks the communication and adds the given reason.
func (*Communication) Delete ¶ added in v0.2.2
func (comm *Communication) Delete()
Delete deletes a connection from the storage and propagates the change.
func (*Communication) Deny ¶ added in v0.2.2
func (comm *Communication) Deny(reason string)
Deny blocks or drops the communication depending on the connection direction and adds the given reason.
func (*Communication) Drop ¶ added in v0.2.2
func (comm *Communication) Drop(reason string)
Drop drops the communication and adds the given reason.
func (*Communication) GetVerdict ¶ added in v0.2.2
func (comm *Communication) GetVerdict() Verdict
GetVerdict returns the current verdict.
func (*Communication) NeedsReevaluation ¶ added in v0.2.2
func (comm *Communication) NeedsReevaluation() bool
NeedsReevaluation returns whether the decision on this communication should be re-evaluated.
func (*Communication) Process ¶ added in v0.2.2
func (comm *Communication) Process() *process.Process
Process returns the process that owns the connection.
func (*Communication) RemoveLink ¶ added in v0.2.2
func (comm *Communication) RemoveLink()
RemoveLink lowers the link counter by one.
func (*Communication) ResetVerdict ¶ added in v0.2.2
func (comm *Communication) ResetVerdict()
ResetVerdict resets the verdict to VerdictUndecided.
func (*Communication) Save ¶ added in v0.2.2
func (comm *Communication) Save() error
Save saves the connection object in the storage and propagates the change.
func (*Communication) String ¶ added in v0.2.2
func (comm *Communication) String() string
String returns a string representation of Communication.
func (*Communication) UpdateVerdict ¶ added in v0.2.2
func (comm *Communication) UpdateVerdict(newVerdict Verdict)
UpdateVerdict sets a new verdict for this link, making sure it does not interfere with previous verdicts.
type FirewallHandler ¶
FirewallHandler defines the function signature for a firewall handle function
type Link ¶
type Link struct { record.Base sync.Mutex ID string Verdict Verdict Reason string Tunneled bool VerdictPermanent bool Inspect bool Started int64 Ended int64 RemoteAddress string // contains filtered or unexported fields }
Link describes a distinct physical connection (e.g. TCP connection) - like an instance - of a Connection.
func CreateLinkFromPacket ¶
CreateLinkFromPacket creates a new Link based on Packet.
func GetOrCreateLinkByPacket ¶
GetOrCreateLinkByPacket returns the associated Link for a packet and a bool expressing if the Link was newly created
func (*Link) AddReason ¶
AddReason adds a human readable string as to why a certain verdict was set in regard to this link
func (*Link) ApplyVerdict ¶
ApplyVerdict appies the link verdict to a packet.
func (*Link) Communication ¶ added in v0.2.2
func (link *Link) Communication() *Communication
Communication returns the Communication the Link is part of
func (*Link) Delete ¶
func (link *Link) Delete()
Delete deletes a link from the storage and propagates the change.
func (*Link) Deny ¶
Deny blocks or drops the link depending on the connection direction and adds the given reason.
func (*Link) FirewallHandlerIsSet ¶
FirewallHandlerIsSet returns whether a firewall handler is set or not
func (*Link) GetActiveInspectors ¶
GetActiveInspectors returns the list of active inspectors.
func (*Link) GetInspectorData ¶
GetInspectorData returns the list of inspector data.
func (*Link) GetVerdict ¶
GetVerdict returns the current verdict.
func (*Link) HandlePacket ¶
HandlePacket queues packet of Link for handling
func (*Link) RerouteToNameserver ¶
func (link *Link) RerouteToNameserver()
RerouteToNameserver reroutes the link to the portmaster nameserver.
func (*Link) RerouteToTunnel ¶
RerouteToTunnel reroutes the link to the tunnel entrypoint and adds the given reason for accepting the connection.
func (*Link) SetActiveInspectors ¶
SetActiveInspectors sets the list of active inspectors.
func (*Link) SetFirewallHandler ¶
func (link *Link) SetFirewallHandler(handler FirewallHandler)
SetFirewallHandler sets the firewall handler for this link
func (*Link) SetInspectorData ¶
SetInspectorData set the list of inspector data.
func (*Link) StopFirewallHandler ¶
func (link *Link) StopFirewallHandler()
StopFirewallHandler unsets the firewall handler
func (*Link) UpdateVerdict ¶
UpdateVerdict sets a new verdict for this link, making sure it does not interfere with previous verdicts
type StorageInterface ¶
type StorageInterface struct {
storage.InjectBase
}
StorageInterface provices a storage.Interface to the configuration manager.
type Verdict ¶
type Verdict uint8
Verdict describes the decision made about a connection or link.
const ( // UNDECIDED is the default status of new connections VerdictUndecided Verdict = 0 VerdictUndeterminable Verdict = 1 VerdictAccept Verdict = 2 VerdictBlock Verdict = 3 VerdictDrop Verdict = 4 VerdictRerouteToNameserver Verdict = 5 VerdictRerouteToTunnel Verdict = 6 )
List of values a Status can have