func (sps SecurityProfileSpec) GetNetworkAttacksFlag() keyvalue.NetworkAttack {
	flag := keyvalue.EmptyNetworkAttack
	for _, attack := range sps.NetworkAttacks {
		switch attack {
		case "arp-spoofing":
			flag = flag | keyvalue.ArpSpoofing
			break
		}
	}
	return flag
}
GetNetworkAttacksFlag - Computes the network attacks flag of the security profile
package v1
import (
	"fmt"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"github.com/Gui774ume/network-security-probe/pkg/model/kernel"
	"github.com/Gui774ume/network-security-probe/pkg/processor/profileloader/keyvalue"
)
type SecurityProfile struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec SecurityProfileSpec `json:"spec"`
}
func (sp *SecurityProfile) GenerateRandomIDs() {
	sp.Spec.securityProfileID = keyvalue.NewCookie()
	for _, p := range sp.Spec.ProcessProfiles {
		p.binaryPathID = keyvalue.NewCookie()
	}
}
func (sp *SecurityProfile) GetSecurityProfileCookie() keyvalue.Cookie {
	return sp.Spec.securityProfileID
}
type SecurityProfileSpec struct {
	securityProfileID    keyvalue.Cookie
	LabelSelector        *metav1.LabelSelector `json:"labelSelector"`
	Actions              []string              `json:"actions"`
	NetworkAttacks       []string              `json:"attacks"`
	DefaultNetworkPolicy NetworkPolicy         `json:"default"`
	ProcessProfiles      []*ProcessProfile     `json:"processes"`
}
func (sps SecurityProfileSpec) GetActionFlag() kernel.SecurityProfileAction {
	actionFlag := kernel.Ignore
	for _, action := range sps.Actions {
		switch action {
		case "enforce":
			actionFlag = actionFlag | kernel.Enforce
			break
		case "alert":
			actionFlag = actionFlag | kernel.Alert
		case "trace-dns":
			actionFlag = actionFlag | kernel.TraceDNS
		}
	}
	return actionFlag
}
func (sps SecurityProfileSpec) GetActionKeyValue() *keyvalue.KeyValue {
	return &keyvalue.KeyValue{
		Key: &keyvalue.ActionKey{
			Cookie: sps.securityProfileID,
		},
		Value: keyvalue.ActionValue{
			Action: sps.GetActionFlag(),
		},
	}
}