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.
Index ¶
- func CookieListContains(cookies []Cookie, cookie Cookie) int
- func NewRandomMapName() string
- type ActionKey
- type ActionValue
- type BinaryPathKey
- type CIDRKey
- type CIDRRouterKey
- type Cookie
- type CookieValue
- type DNSKey
- type HTTPKey
- type Key
- type KeyValue
- type MapOfMapsKeyValue
- type NETnsKey
- type NetworkAttack
- type NetworkAttacksKey
- type NetworkAttacksValue
- type PIDKey
- type PIDnsKey
- type ProtocolKey
- type ProtocolPortKey
- type SecurityProfileActionValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CookieListContains ¶
CookieListContains - Checks if a cookie is in a list of cookies. The functions returns the first id in the map if there is a match.
func NewRandomMapName ¶
func NewRandomMapName() string
NewRandomMapName - Returns a new map name randomly generated
Types ¶
type ActionKey ¶
type ActionKey struct {
Cookie Cookie
}
ActionKey - Action key structure
func (*ActionKey) GetMapSection ¶
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*ActionKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type ActionValue ¶
type ActionValue struct {
Action kernel.SecurityProfileAction
}
ActionValue - Action value
type BinaryPathKey ¶
BinaryPathKey - Binary path key
func (BinaryPathKey) GetMapSection ¶
func (bpk BinaryPathKey) GetMapSection() string
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*BinaryPathKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
func (*BinaryPathKey) String ¶
func (bpk *BinaryPathKey) String() string
type CIDRKey ¶
CIDRKey - CIDR key
func (*CIDRKey) GetMapSection ¶
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*CIDRKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type CIDRRouterKey ¶
type CIDRRouterKey struct { Cookie Cookie IPVersion kernel.NetworkProtocol TrafficType kernel.TrafficType }
CIDRRouterKey - CIDR router key
func (*CIDRRouterKey) GetMapSection ¶
func (k *CIDRRouterKey) GetMapSection() string
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*CIDRRouterKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
func (*CIDRRouterKey) String ¶
func (k *CIDRRouterKey) String() string
type CookieValue ¶
type CookieValue struct {
Cookie Cookie
}
CookieValue - Cookie structure used as value in hashmaps
func (*CookieValue) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type DNSKey ¶
type DNSKey struct { DNS [kernel.DNSMaxLength]byte Cookie Cookie TrafficType kernel.TrafficType Layer uint8 }
DNSKey - DNS key structure
func (*DNSKey) GetMapSection ¶
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*DNSKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type HTTPKey ¶
type HTTPKey struct { TrafficType kernel.TrafficType Cookie Cookie Method [kernel.HTTPMaxMethodLength]byte URI [kernel.HTTPMaxURILength]byte }
HTTPKey - Http key structure
func NewHTTPKey ¶
NewHTTPKey - Creates a new HTTPKey and encodes the method and URI appropriately
func (HTTPKey) GetMapSection ¶
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*HTTPKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type Key ¶
type Key interface { GetMapSection() string GetUnsafePointer(byteOrder binary.ByteOrder) (unsafe.Pointer, error) String() string }
Key - Key interface
type KeyValue ¶
type KeyValue struct { Key Key Value interface{} }
KeyValue - Key value of a rule in a profile
func (*KeyValue) GetMapSection ¶
GetMapSection - Returns the map section of the hashmap in which the key-value should live
type MapOfMapsKeyValue ¶
MapOfMapsKeyValue - Key value of a rule in a profile
func NewCIDRMapOfMapsKeyValue ¶
func NewCIDRMapOfMapsKeyValue(cidrs []string, cookie Cookie, tt kernel.TrafficType, ipVersion kernel.NetworkProtocol, action interface{}) (*MapOfMapsKeyValue, error)
NewCIDRMapOfMapsKeyValue - Creates a new MapOfMaps key-value for the provided cidrs
func (*MapOfMapsKeyValue) String ¶
func (momkv *MapOfMapsKeyValue) String() string
type NETnsKey ¶
type NETnsKey struct {
NS uint64
}
NETnsKey - Process namespace key
func (NETnsKey) GetMapSection ¶
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*NETnsKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type NetworkAttack ¶
type NetworkAttack uint32
NetworkAttack - Network attack
const ( // EmptyNetworkAttack - Used to specify that no attacks was selected. This is the default. EmptyNetworkAttack NetworkAttack = 0 // ArpSpoofing - ARP spoofing network attack ArpSpoofing NetworkAttack = 1 << 0 )
func (NetworkAttack) String ¶
func (na NetworkAttack) String() string
type NetworkAttacksKey ¶
type NetworkAttacksKey struct {
Cookie Cookie
}
NetworkAttacksKey - Network attacks key structure
func (*NetworkAttacksKey) GetMapSection ¶
func (nak *NetworkAttacksKey) GetMapSection() string
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*NetworkAttacksKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
func (*NetworkAttacksKey) String ¶
func (nak *NetworkAttacksKey) String() string
type NetworkAttacksValue ¶
type NetworkAttacksValue struct {
Value NetworkAttack
}
NetworkAttacksValue - Network attack value
type PIDKey ¶
type PIDKey struct {
PID uint32
}
PIDKey - Process key
func (PIDKey) GetMapSection ¶
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*PIDKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type PIDnsKey ¶
type PIDnsKey struct {
NS uint64
}
PIDnsKey - Process namespace key
func (PIDnsKey) GetMapSection ¶
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*PIDnsKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
type ProtocolKey ¶
type ProtocolKey struct { Cookie Cookie Protocol uint16 TrafficType kernel.TrafficType Layer uint8 }
ProtocolKey - Protocol key structure
func (*ProtocolKey) GetMapSection ¶
func (pk *ProtocolKey) GetMapSection() string
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*ProtocolKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
func (*ProtocolKey) String ¶
func (pk *ProtocolKey) String() string
type ProtocolPortKey ¶
type ProtocolPortKey struct { Cookie Cookie Protocol uint16 Port uint16 TrafficType kernel.TrafficType }
ProtocolPortKey - ProtocolPortKey key structure
func (*ProtocolPortKey) GetMapSection ¶
func (ppk *ProtocolPortKey) GetMapSection() string
GetMapSection - Returns the kernel map section of the hasmap for this key
func (*ProtocolPortKey) GetUnsafePointer ¶
GetUnsafePointer - Returns an unsafe Pointer to the data
func (*ProtocolPortKey) String ¶
func (ppk *ProtocolPortKey) String() string
type SecurityProfileActionValue ¶
type SecurityProfileActionValue struct {
Action kernel.SecurityProfileAction
}
SecurityProfileActionValue - Security profile action used for value in hashmaps