Documentation ¶
Overview ¶
Copyright © 2020 GUILLAUME FOURNIER
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 GUILLAUME FOURNIER ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Cache
- type NetworkSecurityProbe
- func (nsp *NetworkSecurityProbe) DispatchEvent(event model.ProbeEvent)
- func (nsp *NetworkSecurityProbe) GetBootTime() time.Time
- func (nsp *NetworkSecurityProbe) GetCollection() *ebpf.Collection
- func (nsp *NetworkSecurityProbe) GetConfig() *config.NSPConfig
- func (nsp *NetworkSecurityProbe) GetHostNetns() uint64
- func (nsp *NetworkSecurityProbe) GetKubeConfig() *rest.Config
- func (nsp *NetworkSecurityProbe) GetWaitGroup() *sync.WaitGroup
- func (nsp *NetworkSecurityProbe) SetupDeviceMonitor(event *model.DeviceEvent) error
- func (nsp *NetworkSecurityProbe) Start() error
- func (nsp *NetworkSecurityProbe) Stop() error
- func (nsp *NetworkSecurityProbe) StopDeviceMonitor(event *model.DeviceEvent) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { HostNetns uint64 ProcessCache *processArrayCache NamespaceCache *namespaceMapCache }
Cache - Probe manager cache
func (*Cache) EnrichEvent ¶
func (cache *Cache) EnrichEvent(event model.ProbeEvent) bool
EnrichEvent - Enrich event with process and container data. This function will return false if either the namespace or the process weren't in cache, or if they were in cache but aren't linked to a container or a process yet. Whatever the initial state of the cache, when this function returns, a new entry in cache will be created and ready to be used.
type NetworkSecurityProbe ¶
type NetworkSecurityProbe struct { KubeConfig *rest.Config KubeInformer *informer.SecurityProfileInformer Config *config.NSPConfig Collection *ebpf.Collection Processors map[model.EventType][]model.Processor Monitors []model.Monitor TCMonitors map[int32]model.Monitor Cache *Cache // contains filtered or unexported fields }
NetworkSecurityProbe - Network Security probe
func NewWithConfig ¶
func NewWithConfig(config *config.NSPConfig) (*NetworkSecurityProbe, error)
NewWithConfig - Returns a new NetworkSecurityProbe instance with the provided config
func (*NetworkSecurityProbe) DispatchEvent ¶
func (nsp *NetworkSecurityProbe) DispatchEvent(event model.ProbeEvent)
DispatchEvent - Dispatches an event to the processors
func (*NetworkSecurityProbe) GetBootTime ¶
func (nsp *NetworkSecurityProbe) GetBootTime() time.Time
GetBootTime - Returns the boot time of the host
func (*NetworkSecurityProbe) GetCollection ¶
func (nsp *NetworkSecurityProbe) GetCollection() *ebpf.Collection
GetCollection - Returns the eBPF collection of the NSP
func (*NetworkSecurityProbe) GetConfig ¶
func (nsp *NetworkSecurityProbe) GetConfig() *config.NSPConfig
GetConfig - Returns the config of the NSP
func (*NetworkSecurityProbe) GetHostNetns ¶
func (nsp *NetworkSecurityProbe) GetHostNetns() uint64
GetHostNetns - Returns the host netns
func (*NetworkSecurityProbe) GetKubeConfig ¶
func (nsp *NetworkSecurityProbe) GetKubeConfig() *rest.Config
GetKubeConfig - Returns the K8s config of the NSP
func (*NetworkSecurityProbe) GetWaitGroup ¶
func (nsp *NetworkSecurityProbe) GetWaitGroup() *sync.WaitGroup
GetWaitGroup - Returns the wait group of the NSP
func (*NetworkSecurityProbe) SetupDeviceMonitor ¶
func (nsp *NetworkSecurityProbe) SetupDeviceMonitor(event *model.DeviceEvent) error
SetupDeviceMonitor - Sets up network monitoring on the newly discovered network device
func (*NetworkSecurityProbe) Start ¶
func (nsp *NetworkSecurityProbe) Start() error
Start - Starts the network security probe (doesn't block)
func (*NetworkSecurityProbe) Stop ¶
func (nsp *NetworkSecurityProbe) Stop() error
Stop - Stops the network security probe and does all the required cleanups
func (*NetworkSecurityProbe) StopDeviceMonitor ¶
func (nsp *NetworkSecurityProbe) StopDeviceMonitor(event *model.DeviceEvent) error
StopDeviceMonitor - Stops a device monitor