models

package
v0.0.0-...-e8c9bfe Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ARISTA_BLOCKER_CONNECTION = "aristaConnection"
	ARISTA_BLOCKER_INTERFACE  = "aristaInterface"
)
View Source
const (
	BLOCKER_TYPE_GO_ARISTA = "Arista-ACL"
	PROTECTION_TYPE_ARISTA = "AristaACL"

	ARISTA_NAME        = "name"
	ANY_VALUE          = "any"
	IPV4_VALUE         = "ip"
	IPV6_VALUE         = "ipv6"
	ACTION_TYPE_DENY   = "deny"
	ACTION_TYPE_PERMIT = "permit"
	FRAGMENTS_VALUE    = "fragments"
	EMPTY_VALUE        = ""
	TTL_KEY            = "ttl"
	HOPLIMIT_KEY       = "hop-limit"
	PORT_RANGE         = "range"
	DSCP_KEY           = "dscp"
	ECN_KEY            = "ecn"

	ECN_VALUE_CE      = "ce"
	ECN_VALUE_ECT     = "ect"
	ECN_VALUE_ECT_CE  = "ect-ce"
	ECN_VALUE_NON_ECT = "non-ect"

	INTERFACE_VALUE    = "interface"
	ACCESS_LIST_VALUE  = "access-list"
	ACCESS_GROUP_VALUE = "access-group"
	CONFIGURE_SESSION  = "configure session"
	COMMIT_VALUE       = "commit"
	EXIT_VALUE         = "exit"
	NO_VALUE           = "no"
	INBOUND_PACKET     = "in"
	IPV4_PERMIT_RULE   = "permit ip any any"
	IPV6_PERMIT_RULE   = "permit ipv6 any any"

	LEN_CMDS_ACL_WITHOUT_RULE = 3
)
View Source
const (
	FLOWSPEC_BLOCKER_HOST    = "host"
	FLOWSPEC_BLOCKER_PORT    = "port"
	FLOWSPEC_BLOCKER_TIMEOUT = "timeout"
	FLOWSPEC_BLOCKER_NEXTHOP = "nextHop"
	FLOWSPEC_BLOCKER_VRF     = "vrf"
)
View Source
const (
	BLOCKER_TYPE_GoBGP_FLOWSPEC = "GoBGP-FlowSpec"
	PROTECTION_TYPE_FLOWSPEC    = "FlowSpec"

	IPV4_FLOW_SPEC         = "ipv4-flowspec"
	IPV6_FLOW_SPEC         = "ipv6-flowspec"
	ACTION_TYPE_DISCARD    = "discard"
	ACTION_TYPE_ACCEPT     = "accept"
	ACTION_TYPE_RATE_LIMIT = "rate-limit"
	ACTION_TYPE_REDIRECT   = "redirect"
)
View Source
const (
	RTBH_BLOCKER_HOST    = "host"
	RTBH_BLOCKER_PORT    = "port"
	RTBH_BLOCKER_TIMEOUT = "timeout"
	RTBH_BLOCKER_NEXTHOP = "nextHop"
)
View Source
const (
	AnyMitigationScopeId  int64 = 0
	InProgress            int   = 1
	SuccessfullyMitigated int   = 2
	Stopped               int   = 3
	ExceedCapability      int   = 4
	ActiveButTerminating  int   = 5
	Terminated            int   = 6
	Withdrawn             int   = 7
	Triggered             int   = 8
)
View Source
const (
	TOTAL_TRAFFIC_NORMAL trafficType = "TOTAL_TRAFFIC_NORMAL"
	TOTAL_ATTACK_TRAFFIC trafficType = "TOTAL_ATTACK_TRAFFIC"
	TOTAL_TRAFFIC        trafficType = "TOTAL_TRAFFIC"
)
View Source
const (
	BLOCKER_TYPE_GoBGP_RTBH = "GoBGP-RTBH"
)
View Source
const IP_PREFIX_LENGTH int = 32
View Source
const PROTECTION_TYPE_RTBH = "RTBH"
View Source
const ValidationError string = "validation error"

Variables

View Source
var BlockerSelectionService *blockerSelectionService

declare instance variables

View Source
var DefaultTsid = -1

Functions

func ActivationTypeToInt

func ActivationTypeToInt(activationType data_types.ActivationType) int

* Parse ACL activation type to int activation type * * return: * int activation type

func AddActiveMitigationRequest

func AddActiveMitigationRequest(id int64, lifetime int, modified time.Time)

func BlockerConfigurationParametersToMap

func BlockerConfigurationParametersToMap(configParams []db_models.BlockerConfigurationParameter) map[string][]string

func BlockerParametersToMap

func BlockerParametersToMap(params []db_models.BlockerParameter) map[string][]string

func CheckOverlapTargetList

func CheckOverlapTargetList(requestTargets []Target, currentTargets []Target) bool

* Check overlap targets(target_prefix, target_fqdn, target_uri) * return: * true: if request targets overlap with current targets * false: else

func CheckPeaceTimeSignalChannel

func CheckPeaceTimeSignalChannel(customerID int, clientIdentifier string) (bool, error)

* Check peace time signal channel

func ConnectDB

func ConnectDB() (*xorm.Engine, error)

database connection create

func ConvertQueryTypeToString

func ConvertQueryTypeToString(queryType int) (queryTypeString string)

Convert query-type to string

func ConvertToSecond

func ConvertToSecond(stringValue string) (second int)

Convert the interval(string) or the sample(string) to second(int)

func CreateAccessGroup

func CreateAccessGroup(aclType string, aclName string) string

* Create ip/ipv6 access group to apply acl to interface

func CreateAccessList

func CreateAccessList(aclType string, aclName string) string

* Create ip/ipv6 access list

func CreateBaseline

func CreateBaseline(customerId int, cuid string, cdid string, tsid int, baselineList []Baseline, isPresent bool) (isConflict bool, err error)

Create baseline

func CreateBlocker

func CreateBlocker(blocker Blocker) (newBlocker db_models.Blocker, err error)

* Stores a Blocker object to the database * * parameter: * blocker Blocker * return: * newBlocker db_models.Blocker * err error

func CreateConfigureSession

func CreateConfigureSession(sessName string) string

* Create configure session

func CreateCustomer

func CreateCustomer(customer Customer) (newCustomer db_models.Customer, err error)

* Create a new customer object and store it to the DB. * If the customer object with same customer_id is already in the DB, update the object with new values. * * parameter: * customer Customer * return: * err error

func CreateMitigationScope

func CreateMitigationScope(mitigationScope MitigationScope, customer Customer, isIfMatchOption bool) (newMitigationScope db_models.MitigationScope, err error)

* Create a new MitigationScope object and store it to the DB. * If there exists an object with same CustomerID and PolicyID, update the object. * * parameter: * mitigationScope MitigationScope * customer Customer * return: * err error

func CreateProtection2

func CreateProtection2(protection Protection) (newProtection db_models.Protection, err error)

* Stores a Protection object to the DB. * * parameter: * protection ProtectionBase * protectionStatus ProtectionStatus * protectionParameters db_models.ProtectionParameter * return: * err error

func CreateSignalSessionConfiguration

func CreateSignalSessionConfiguration(signalSessionConfiguration SignalSessionConfiguration, customer Customer) (newSignalSessionConfiguration db_models.SignalSessionConfiguration, err error)

* Stores SignalSessionConfiguration to the DB. * * parameter: * signalSessionConfiguration SignalSessionConfiguration * customer Customer * return: * err error

func CreateTargets

func CreateTargets(session *xorm.Session, telePreMitigationId int64, targets Targets) error

Create targets

func CreateTelemetryConfiguration

func CreateTelemetryConfiguration(customerId int, cuid string, cdid string, tsid int, telemetryConfiguration *TelemetryConfiguration) (err error)

Create telemetry configuration

func CreateTelemetryParameterValue

func CreateTelemetryParameterValue(session *xorm.Session, tType string, typeId int64, protocols SetInt, fqdns SetString, uris SetString, aliasNames SetString) error

Registed telemetry parameter value (target-protocol, target-fqdn, target-uri) to DB

func CreateTelemetryPreMitigation

func CreateTelemetryPreMitigation(customer *Customer, cuid string, cdid string, tmid int, dataRequest messages.PreOrOngoingMitigation, aliases types.Aliases, isPresent bool) error

Create telemetry pre-mitigation that is called by controller

func CreateTelemetrySetupBaseline

func CreateTelemetrySetupBaseline(session *xorm.Session, customerId int, cuid string, cdid string, tsid int, baselineList []Baseline) error

Create telemetry setup with setup_type is 'baseline'

func CreateTelemetrySetupPipe

func CreateTelemetrySetupPipe(session *xorm.Session, customerId int, cuid string, cdid string, tsid int, pipeList []TotalPipeCapacity) error

Create telemetry setup with setup_type is 'pipe'

func CreateTelemetrySetupTelemetryConfiguration

func CreateTelemetrySetupTelemetryConfiguration(session *xorm.Session, customerId int, cuid string, cdid string, tsid int, telemetryConfiguration *TelemetryConfiguration) error

Create telemetry setup with setup_type is 'telemetry_configuration'

func CreateTotalPipeCapacity

func CreateTotalPipeCapacity(customerId int, cuid string, cdid string, tsid int, pipeList []TotalPipeCapacity, isPresent bool) (isConflict bool, err error)

Create total pipe capacity

func DeleteAllTelemetryPreMitigation

func DeleteAllTelemetryPreMitigation(customerId int, cuid string) error

Delete all telemetry pre-mitigation

func DeleteAllTelemetrySetup

func DeleteAllTelemetrySetup(customerId int, cuid string, cdid string) error

Delete all telemetry configuration

func DeleteBaseline

func DeleteBaseline(session *xorm.Session, id int64) (err error)

Delete baseline

func DeleteBlockerById

func DeleteBlockerById(blockerId int64) (err error)

* Delete the Blocker by the Blocker ID. * * parameter: * blockerId Blocker ID * return: * error error

func DeleteCurrentUriFilteringTelemetryPreMitigation

func DeleteCurrentUriFilteringTelemetryPreMitigation(engine *xorm.Engine, session *xorm.Session, customerId int, cuid string, tmid int) error

Delete current uri filtering telemetry pre-mitigation

func DeleteCustomer

func DeleteCustomer(customerId int) (err error)

* Delete a customer by customer ID. * * parameter: * customer_id Customer ID * return: * error error

func DeleteMitigationScope

func DeleteMitigationScope(customerId int, clientIdentifier string, mitigationId int, mitigationScopeId int64) (err error)

* Deletes a mitigation scope object by a customerId and a mitigationId. * Indicate either mitigationScopeId or set of (customerId, clientIdentifier, mitigationId) * customerId id of the Customer * mitigationId mitigation id of the mitigation scope object * mitigationScopeId mitigatoin scope id of the mitigation scope object * return: * mitigationScope mitigation-scope * error error

func DeleteOneTelemetryPreMitigation

func DeleteOneTelemetryPreMitigation(customerId int, cuid string, tmid int) error

Delete one telemetry pre-mitigation

func DeleteOneTelemetrySetup

func DeleteOneTelemetrySetup(customerId int, cuid string, cdid string, tsid int, dbTelemetrySetupList []db_models.TelemetrySetup) error

Delete one telemetry setup configuration

func DeleteProtection

func DeleteProtection(mitigationScopeId int64) (err error)

* Deletes a protection by the mitigation ID. * * parameter: * mitigationId mitigation ID * return: * error error

func DeleteProtectionById

func DeleteProtectionById(id int64) (err error)

func DeleteSignalSessionConfiguration

func DeleteSignalSessionConfiguration(customerId int, sessionId int) (err error)

* Deletes the SignalSessionConfiguration by the customer ID and session id. * * parameter: * customerId customer ID * sessionId session ID * return: * error error

func DeleteSignalSessionConfigurationByCustomerId

func DeleteSignalSessionConfigurationByCustomerId(customerId int) (err error)

* Deletes the SignalSessionConfiguration by the customer ID * * parameter: * customerId customer ID * return: * error error

func DeleteTelemetryAttackDetail

func DeleteTelemetryAttackDetail(engine *xorm.Engine, session *xorm.Session, mitigationScopeId int64) error

Delete telemetry attack_detail

func DeleteTelemetryConfiguration

func DeleteTelemetryConfiguration(session *xorm.Session, teleConId int64) error

Delete telemetry configuration

func DeleteTelemetrySetupBaseline

func DeleteTelemetrySetupBaseline(engine *xorm.Engine, session *xorm.Session, customerId int, cuid string, teleSetupId int64) error

Delete telemetry setup with setup type is 'baseline'

func DeleteTelemetrySetupPipe

func DeleteTelemetrySetupPipe(engine *xorm.Engine, session *xorm.Session, teleSetupId int64) error

Delete telemetry setup with setup type is 'pipe'

func DeleteTelemetrySetupTelemetryConfiguration

func DeleteTelemetrySetupTelemetryConfiguration(engine *xorm.Engine, session *xorm.Session, teleSetupId int64) error

Delete telemetry setup with setup type is 'telemetry_configuration'

func DeleteUriFilteringAttackDetail

func DeleteUriFilteringAttackDetail(engine *xorm.Engine, session *xorm.Session, uriFilterPreMitigationId int64) error

Delete uri filtering attack detail

func ExecuteSQL

func ExecuteSQL(sql string) (res sql.Result, err error)

Execute SQL

func GetActiveMitigationMap

func GetActiveMitigationMap() map[int64]ActiveMitigationRequest

func GetAliasByName

func GetAliasByName(engine *xorm.Engine, customerId int, cuid string, aliasNames []string) (aliases types.Aliases, err error)

Get alias by name list (the name list from baseline/pre-mitigation)

func GetAllMitigationScopes

func GetAllMitigationScopes() (mitigations []db_models.MitigationScope, err error)

* Get all mitigationScope. * * parameter: * return: * mitigations list of mitigation request * err error

func GetBlockerById

func GetBlockerById(blockerId int64) (blocker db_models.Blocker, err error)

func GetBlockerConfiguration

func GetBlockerConfiguration(customerId int, targetType string) (blockerConfiguration *db_models.BlockerConfiguration, err error)

* Get blocker configuration by customerID and targetType

func GetBlockerConfigurationParameters

func GetBlockerConfigurationParameters(blockerConfigurationId int64) (blockerConfigurationParameters []db_models.BlockerConfigurationParameter, err error)

* Obtain the designated BlockerConfigurationParameters by the Blocker COnfiguration ID. * * parameter: * blockerConfigurationId the Blocker Configuration ID * return: * blockerConfigurationParameters the Blocker Configuration Parameter * error error

func GetBlockerParameters

func GetBlockerParameters(blockerId int64) (blockerParameters []db_models.BlockerParameter, err error)

* Obtain the designated BlockerParameters by the Blocker ID. * * parameter: * blockerId Blocker ID * return: * BlockerParameter BlockerParameter * error error

func GetBlockers

func GetBlockers() (blockers []db_models.Blocker, err error)

* Obtain all the blocker information stored in the database. * * return: * blockers a list of blockers * error error

func GetControlFilteringByACLName

func GetControlFilteringByACLName(aclName string) (controlFilteringList []db_models.ControlFiltering, err error)

* Get control filtering from mitigation scope id

func GetCuidByCustomerID

func GetCuidByCustomerID(customerID int, clientIdentifier string) (cuid []string, err error)

* Find cuid by a customerId. * * parameter: * customerId id of the Customer * return: * cuid of mitigation * error error

func GetFreshSessionMap

func GetFreshSessionMap() map[int]ActiveSessionConfiguration

func GetLowestLoadBlocker

func GetLowestLoadBlocker(blockerType string) (blocker db_models.Blocker, err error)

* Obtain the blocker with the least load. * If the load values are same, capacity information are used to break the tie.

func GetMitigationByCustomerIdAndCuid

func GetMitigationByCustomerIdAndCuid(customerId int, cuid string) (mitigationList []db_models.MitigationScope, err error)

Get mitigation by customerId and cuid

func GetMitigationIds

func GetMitigationIds(customerId int, clientIdentifier string) (mitigationIds []int, err error)

* Find all mitigationId by a customerId. * * parameter: * customerId id of the Customer * return: * mitigationIds list of mitigation id * error error

func GetMitigationIdsByCustomer

func GetMitigationIdsByCustomer(customerId int) (mitigationscopeIds []int64, err error)

Find all mitigationIds with status is 2 by a customerId

func GetMitigationScopeById

func GetMitigationScopeById(id int64) (*db_models.MitigationScope, error)

Get mitigation scope by id

func GetMitigationScopeValidator

func GetMitigationScopeValidator(blockerType string) mitigationScopeValidator

Return mitigation scope validator by input blocker type (goBgpScopeValidator or goAristaScopeValidator)

func GetPreConfiguredMitigationIds

func GetPreConfiguredMitigationIds(customerId int) (mitigationscopeIds []int64, err error)

* Find all mitigationIds with status is 8 by a customerId * * parameter: * customerId id of the Customer * return: * mitigationIds list of mitigation id * error error

func GetProtectionParameters

func GetProtectionParameters(protectionId int64) (goBGPParameters []db_models.GoBgpParameter, err error)

* Obtains a list of ProtectionParameter objects by ID of the parent Protection. * * parameter: * protectionId id of the parent Protection * return: * ProtectionParameter []db_models.ProtectionParameter * error error

func GetQueriesFromUriQuery

func GetQueriesFromUriQuery(queries []string) (targetPrefix string, targetPort string, targetProtocol string, targetFqdn string, targetUri string, aliasName string,
	sourcePrefix string, sourcePort string, sourceIcmpType string, content string, errMsg string)

Get queries from Uri-query

func GetSession

func GetSession(engine *xorm.Engine) (*xorm.Session, error)

Session start

func GetTelemetryAttackDetailById

func GetTelemetryAttackDetailById(id int64) (dbAttackDetail db_models.TelemetryAttackDetail, err error)

Get telemetry attack detail by Id

func GetTelemetrySetupByCuid

func GetTelemetrySetupByCuid(customerId int, cuid string) (dbTelemetrySetupList []db_models.TelemetrySetup, err error)

Get telemetry setup by cuid

func GetTelemetrySetupByCuidAndNonNegativeTsid

func GetTelemetrySetupByCuidAndNonNegativeTsid(customerId int, cuid string) (dbTelemetrySetupList []db_models.TelemetrySetup, err error)

Get telemetry setup by cuid and tsid >= 0

func GetTelemetrySetupByCuidAndSetupType

func GetTelemetrySetupByCuidAndSetupType(customerId int, cuid string, setupType string) (dbTelemetrySetupList []db_models.TelemetrySetup, err error)

Get telemetry setup by cuid and setup type (telemetry_configuration, pipe, baseline)

func GetTelemetrySetupByCustomerIdAndSetupType

func GetTelemetrySetupByCustomerIdAndSetupType(customerId int, setupType string) (dbTelemetrySetupList []db_models.TelemetrySetup, err error)

Get telemetry setup by customerId and setup type (telemetry_configuration, pipe, baseline)

func GetTelemetrySetupByTsid

func GetTelemetrySetupByTsid(customerId int, cuid string, tsid int) (dbTelemetrySetupList []db_models.TelemetrySetup, err error)

Get telemetry setup by tsid

func GetTelemetrySetupByTsidAndSetupType

func GetTelemetrySetupByTsidAndSetupType(customerId int, cuid string, tsid int, setupType string) (dbTelemetrySetup db_models.TelemetrySetup, err error)

Get telemetry setup by tsid and setup type (telemetry_configuration, pipe, baseline)

func GetTelemetryTopTalkerById

func GetTelemetryTopTalkerById(id int64) (dbTopTalker db_models.TelemetryTopTalker, err error)

Get telemetry top talker by Id

func GetTmidListByCustomerIdAndCuid

func GetTmidListByCustomerIdAndCuid(customerId int, cuid string) (tmids []int, err error)

Get tmids (telemetry_pre_mitigation and uri_filtering_telemetry_pre_mitigation) by customer_id and cuid

func GetUriFilteringAttackDetailById

func GetUriFilteringAttackDetailById(id int64) (dbAttackDetail db_models.UriFilteringAttackDetail, err error)

Get uri filtering attack detail by id

func GetUriFilteringTelemetryPreMitigation

func GetUriFilteringTelemetryPreMitigation(customerId int, cuid string, tmid *int, queries []string) ([]db_models.UriFilteringTelemetryPreMitigation, error)

Get uri filtering telemetry pre-mitigation

func GetUriFilteringTelemetryPreMitigationById

func GetUriFilteringTelemetryPreMitigationById(id int64) (dbPreMitigation db_models.UriFilteringTelemetryPreMitigation, err error)

Get uri filtering telemetry pre-mitigation by id

func GetUriFilteringTopTalkerById

func GetUriFilteringTopTalkerById(id int64) (dbTopTalker db_models.UriFilteringTopTalker, err error)

Get uri filtering top talker by id

func InitTable

func InitTable(rebuildFlag bool)

* Create all system tables. * if the rebuildFlag is set, drop all and recreate them. * * parameter: * rebuildFlag indicates whether we should re-create the tables. * return: * error error

func IsActive

func IsActive(status int) bool

* Return status that is active or inactive * * return: * bool * true status is active * false status is inactive

func IsContainIntValue

func IsContainIntValue(targetQuery string, targetValue int) bool

Check contain integer value between uri-query and target-value target-protocol

func IsContainRangeValue

func IsContainRangeValue(targetQuery string, lower int, upper int) bool

Check contain range values between uri-query and target-value target-port

func IsContainStringValue

func IsContainStringValue(targetQuery string, targetValue string) bool

Check contain string value between uri-query and target-value target-prefix, target-fqdn, alias-name

func IsExistTelemetryPreMitigationValueByQueries

func IsExistTelemetryPreMitigationValueByQueries(queries []string, customerId int, cuid string, preMitigation db_models.UriFilteringTelemetryPreMitigation) (bool, error)

* Check existed uri filtering telemetry pre-mitigation by uri-query * return: * true: if existed * false: if doesn't exist

func IsExistedVendorAttackMapping

func IsExistedVendorAttackMapping(engine *xorm.Engine, clientId int64, vendorId int, attackId int) (bool, error)

* Check vendor-mapping is exist * true: if existed * false: if doesn't exist

func IsInCustomerDomain

func IsInCustomerDomain(customer *Customer, targets []Target) (errMsg string)

* Check if the target prefix is not included in customer's domain address * parameters: * customer the customer * targets list of mitigation target address * return: string * "" all targets are in customer's domain * errMsg some of targets is not in customer's domain

func IsValid

func IsValid(targets []Target) (errMsg string)

* Check if the target prefix include multicast, broadcast or loopback ip address * parameters: * targets list of mitigation target address * return: string * "" all targets are valid * errMsg some of targets is invalid

func MarshalFlowSpecRules

func MarshalFlowSpecRules(values []bgp.FlowSpecComponentInterface) []*any.Any

* Marshal Flowspec Rules * Base on func MarshalFlowSpecRules(), packet "github.com/osrg/gobgp/v3/internal/pkg/apiutil" from GoBGP open source

func MarshalNLRI

func MarshalNLRI(value bgp.AddrPrefixInterface) *any.Any

* Marshal nlri * Base on func MarshalNLRI(), packet "github.com/osrg/gobgp/v3/internal/pkg/apiutil" from GoBGP open source

func MarshalPathAttributes

func MarshalPathAttributes(attrList []bgp.PathAttributeInterface) []*any.Any

* Marshal path attributes * Base on func MarshalPathAttributes(), packet "github.com/osrg/gobgp/v3/internal/pkg/apiutil" from GoBGP open source

func NewExtendedCommunitiesAttributeFromNative

func NewExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeExtendedCommunities) *api.ExtendedCommunitiesAttribute

* New Extended Communities Attribute * Base on func NewExtendedCommunitiesAttributeFromNative(), packet "github.com/osrg/gobgp/v3/internal/pkg/apiutil" from GoBGP open source

func NewIP6ExtendedCommunitiesAttributeFromNative

func NewIP6ExtendedCommunitiesAttributeFromNative(a *bgp.PathAttributeIP6ExtendedCommunities) *api.IP6ExtendedCommunitiesAttribute

* New IP6 Extended Communities Attribute * Base on func NewIP6ExtendedCommunitiesAttributeFromNative(), packet "github.com/osrg/gobgp/v3/internal/pkg/apiutil" from GoBGP open source

func NewRedirectExtendedCommunitiesAttribute

func NewRedirectExtendedCommunitiesAttribute(routeStr string) (bgp.PathAttributeInterface, error)

* New Redirect Extended Communities Attribute * Base on func redirectParser() and, packet "github.com/osrg/gobgp/v3/cmd/gobgp" from GoBGP open source

func PortRangeOrOperatorToString

func PortRangeOrOperatorToString(port *types.PortRangeOrOperator) (p string)

* Convert port to string

func ProtectionStatusToDbModel

func ProtectionStatusToDbModel(protectionId int64, status *ProtectionStatus) (newProtectionStatus db_models.ProtectionStatus)

func ReConnectDB

func ReConnectDB() (*xorm.Engine, error)

database reconnection create

func RefreshActiveSessionConfiguration

func RefreshActiveSessionConfiguration(customerId int, sid int, maxAge uint)

* Refresh or update an active session configuration when client request Get with sid * or request Put with sid to update session configuration

func RegisterBaseline

func RegisterBaseline(session *xorm.Session, teleSetupId int64, baseline Baseline) (*db_models.Baseline, error)

Registed baseline to DB

func RegisterTelemetryConfiguration

func RegisterTelemetryConfiguration(session *xorm.Session, teleSetupId int64, telemetryConfiguration *TelemetryConfiguration) (*db_models.TelemetryConfiguration, error)

Registered telemetry configuration to DB

func RegisterTelemetryParameterIntValue

func RegisterTelemetryParameterIntValue(session *xorm.Session, tType string, typeId int64, parameterType string, intValues SetInt) error

Registered telemetry parameter int value

func RegisterTelemetryParameterStringValue

func RegisterTelemetryParameterStringValue(session *xorm.Session, tType string, typeId int64, parameterType string, stringValues SetString) error

Registered telemetry parameter string value

func RegisterTelemetryPortRange

func RegisterTelemetryPortRange(session *xorm.Session, tType string, typeId int64, prefixType string, portRanges []PortRange) error

Registed telemetry port range to DB

func RegisterTelemetryPrefix

func RegisterTelemetryPrefix(session *xorm.Session, tType string, typeId int64, prefixType string, prefixs []Prefix) error

Registered telemetry prefix to DB

func RegisterTelemetrySetup

func RegisterTelemetrySetup(session *xorm.Session, customerId int, cuid string, cdid string, tsid int, setupType string) (*db_models.TelemetrySetup, error)

Registed telemetry setup to DB

func RegisterTotalConnectionCapacity

func RegisterTotalConnectionCapacity(session *xorm.Session, teleBaselineId int64, tccs []TotalConnectionCapacity) error

Registered total connection capacity to DB

func RegisterTotalConnectionCapacityPerPort

func RegisterTotalConnectionCapacityPerPort(session *xorm.Session, teleBaselineId int64, tccs []TotalConnectionCapacityPerPort) error

Registered total connection capacity per port to DB

func RegisterTotalPipecapacity

func RegisterTotalPipecapacity(session *xorm.Session, teleSetupId int64, pipeList []TotalPipeCapacity) error

Registed total pipe capacity to DB

func RegisterTraffic

func RegisterTraffic(session *xorm.Session, tType string, prefixType string, typeId int64, trafficType string, traffics []Traffic) error

Registered traffic to DB

func RegisterTrafficPerPort

func RegisterTrafficPerPort(session *xorm.Session, tType string, typeId int64, trafficType string, traffics []TrafficPerPort) error

Registered traffic per port to DB

func RegisterTrafficPerProtocol

func RegisterTrafficPerProtocol(session *xorm.Session, tType string, typeId int64, trafficType string, traffics []TrafficPerProtocol) error

Registered traffic per procol to DB

func RegisterUnitConfiguration

func RegisterUnitConfiguration(session *xorm.Session, tConID int64, unitConfigList []UnitConfig) (err error)

Registered unit configuration to DB

func RegisterUriFilteringTelemetryPreMitigation

func RegisterUriFilteringTelemetryPreMitigation(session *xorm.Session, customerId int, cuid string, cdid string, tmid int, newPreMitigation *TelemetryPreMitigation) error

Register uri filtering telemetry pre-mitigation

func RemoveACLByID

func RemoveACLByID(aclID int64, acl data_db_models.ACL) error

* Remove Acl by ID

func RemoveAccessGroup

func RemoveAccessGroup(aclType string, aclName string) string

* Remove ip/ipv6 access group to remove acl from interface

func RemoveAccessList

func RemoveAccessList(aclType string, aclName string) string

* Remove ip/ipv6 access list

func RemoveActiveMitigationRequest

func RemoveActiveMitigationRequest(id int64)

func RemoveActiveSessionConfiguration

func RemoveActiveSessionConfiguration(customerId int)

* Remove by customer id an active session configuration out of map when it is deleted * or expired max-age and reset to default value

func RemoveConfigureSession

func RemoveConfigureSession(sessName string) string

* Remove configure session

func RemoveControlFilteringByID

func RemoveControlFilteringByID(controlFilteringID int64, controlFiltering db_models.ControlFiltering) error

* Remove control filtering by ID

func SetTestMode

func SetTestMode(flag bool)

test mode set

func ShowSQL

func ShowSQL(display bool) (err error)

Execute SQL display mode change

func StartProtection

func StartProtection(p Protection, b Blocker) (err error)

* Updates a protection object in the DB on the invocation of the protection. * 1. turn the is_enabled field on and updates the started_at with current datetime. * 2. increase the value in the load field of the blocker.

func StopProtection

func StopProtection(p Protection, b Blocker) (err error)

* Updates a protection object in the DB on the termination of the protection. * 1. turn the is_enabled field off and updates the finished_at with current datetime. * 2. decrease the value in the load field of the blocker.

func UpdateACLNameToMitigation

func UpdateACLNameToMitigation(mitigationID int64) (string, error)

* Update acl_name for mitigation scope

func UpdateBaseline

func UpdateBaseline(session *xorm.Session, customerId int, cuid string, cdid string, tsid int, baselineList []Baseline) error

Update baseline

func UpdateBlockerLoad

func UpdateBlockerLoad(blockerId int64, diff int) (err error)

* Update the load value of a Blocker * * parameter: * blockerId id * diff diff of the load value * return: * error error

func UpdateCustomer

func UpdateCustomer(customer Customer) (err error)

* Update a customer object. * * parameter: * customer Customer * return: * err error

func UpdateMitigationScope

func UpdateMitigationScope(mitigationScope MitigationScope, customer Customer, isIfMatchOption bool, isDeleteFunc bool) (err error)

* Updates a MitigationScope object in the DB. * * parameter: * mitigationScope MitigationScope * customer Customer * return: * err error

func UpdateMitigationScopeStatus

func UpdateMitigationScopeStatus(mitigationScopeId int64, status int) (err error)

* Updates a MitigationScope status in the DB. * * parameter: * mitigationScopeId int64 * status int * return: * err error

func UpdateProtection

func UpdateProtection(protection Protection) (err error)

* Updates a Protection object in the DB. * * parameter: * protection ProtectionBase * return: * err error

func UpdateSignalSessionConfiguration

func UpdateSignalSessionConfiguration(signalSessionConfiguration SignalSessionConfiguration, customer Customer) (err error)

* Updates SignalSessionConfiguration in the DB. * * parameter: * signalSessionConfiguration SignalSessionConfiguration * customer Customer * return: * err error

func UpdateTelemetryConfiguration

func UpdateTelemetryConfiguration(customerId int, cuid string, cdid string, tsid int, telemetryConfiguration *TelemetryConfiguration) (err error)

Update telemetry configuration

func UpdateTotalPipeCapacity

func UpdateTotalPipeCapacity(session *xorm.Session, customerId int, cuid string, cdid string, tsid int, pipeList []TotalPipeCapacity) error

Update total pipe capacity

func ValidateAttackDetail

func ValidateAttackDetail(ads []messages.AttackDetail) (isUnprocessableEntity bool, errMsg string)

Validate attack-detail

func ValidateBaseline

func ValidateBaseline(customer *Customer, cuid string, tsid int, data []messages.Baseline) (isPresent bool, isUnprocessableEntity bool, errMsg string)

Validate baseline

func ValidateConflictForUnit

func ValidateConflictForUnit(percentileList map[messages.UnitString]uint64, percentile uint64, unit messages.UnitString) (errMsg string)

*

  • Check conflict for unit
  • parameter:
  • percentileList: the list with key is unit, value is value of
  • low-percentile-g/mid-percentile-g/high-percentile-g/peak-g/current-g
  • percentile: the value of low-percentile-g/mid-percentile-g/high-percentile-g/peak-g/current-g
  • unit: the unit
  • return
  • errMsg:
  • if unit is not conflict, errMsg is ""
  • if unit is conflict, errMsg is not ""

func ValidateConflictScale

func ValidateConflictScale(lowPercentileList map[messages.UnitString]uint64, midPercentileList map[messages.UnitString]uint64,
	highPercentileList map[messages.UnitString]uint64, peakPercentileList map[messages.UnitString]uint64,
	currentPercentileList map[messages.UnitString]uint64) (errMsg string)

*

  • Validate unit for low-percentile-g, mid-percentile-g, high-percentile-g, peak-g, current-g
  • parameter:
  • lowPercentileList: the list with key is unit, value is value of low-percentile-g
  • midPercentileList: the list with key is unit, value is value of mid-percentile-g
  • highPercentileList: the list with key is unit, value is value of high-percentile-g
  • peakPercentileList: the list with key is unit, value is value of peak-g
  • currentPercentileList: the list with key is unit, value is value of current-g
  • return
  • errMsg:
  • if unit is not conflict, errMsg is ""
  • if unit is conflict, errMsg is not ""

func ValidateConflictScaleForUnit

func ValidateConflictScaleForUnit(percentileList map[messages.UnitString]uint64) (errMsg string)

*

  • Auto scale and check conflict for unit
  • parameter:
  • percentileList: the list with key is unit, value is value of
  • low-percentile-g/mid-percentile-g/high-percentile-g/peak-g/current-g
  • return
  • errMsg:
  • if unit is not conflict, errMsg is ""
  • if unit is conflict, errMsg is not ""

func ValidateDescriptionLang

func ValidateDescriptionLang(desl string) (bool, string)

Validate description-lang

func ValidatePort

func ValidatePort(port *int) (isUnprocessableEntity bool, errMsg string)

Validate port

func ValidatePortRange

func ValidatePortRange(targetPortRanges []messages.PortRange) (isUnprocessableEntity bool, errMsg string)

Validate port range

func ValidatePrefix

func ValidatePrefix(customer *Customer, targetPrefixs []string, targetFqdns []string, targetUris []string) (errMsg string)

Validate prefix

func ValidateProtocol

func ValidateProtocol(protocol *uint8) (isUnprocessableEntity bool, errMsg string)

Validate protocol

func ValidateProtocolList

func ValidateProtocolList(protocolList []int) (errMsg string)

Validate protocol

func ValidateTargets

func ValidateTargets(customer *Customer, target *messages.Target) (isUnprocessableEntity bool, errMsg string)

Validate targets (target_prefix, target_port_range, target_uri, target_fqdn)

func ValidateTelemetryConfiguration

func ValidateTelemetryConfiguration(customerID int, cuid string, tsid int, data *messages.TelemetryConfigurationCurrent) (isPresent bool, isUnprocessableEntity bool, errMsg string)

Validate telemetry configuration

func ValidateTelemetryPreMitigation

func ValidateTelemetryPreMitigation(customer *Customer, cuid string, tmid int, data messages.PreOrOngoingMitigation) (isPresent bool, isUnprocessableEntity bool, errMsg string)

Validate telemetry pre-mitigation

func ValidateTotalAttackConnectionPort

func ValidateTotalAttackConnectionPort(tacs []messages.TotalAttackConnectionPort) (isUnprocessableEntity bool, errMsg string)

Valdate total-attack-connection-port

func ValidateTotalAttackConnectionProtocol

func ValidateTotalAttackConnectionProtocol(tacs []messages.TotalAttackConnectionProtocol) (isUnprocessableEntity bool, errMsg string)

Valdate total-attack-connection-protocol

func ValidateTotalConnectionCapacity

func ValidateTotalConnectionCapacity(tccList []messages.TotalConnectionCapacity) (isUnprocessableEntity bool, errMsg string)

Validate total connection capacity

func ValidateTotalConnectionCapacityPerPort

func ValidateTotalConnectionCapacityPerPort(tccList []messages.TotalConnectionCapacityPerPort) (isUnprocessableEntity bool, errMsg string)

Validate total connection capacity per port

func ValidateTotalPipeCapacity

func ValidateTotalPipeCapacity(customerID int, cuid string, tsid int, data []messages.TotalPipeCapacity) (isPresent bool, isUnprocessableEntity bool, errMsg string)

Validate total pipe capacity

func ValidateTraffic

func ValidateTraffic(trafficList []messages.Traffic) (isUnprocessableEntity bool, errMsg string)

Validate traffic

func ValidateTrafficPerPort

func ValidateTrafficPerPort(trafficList []messages.TrafficPerPort) (isUnprocessableEntity bool, errMsg string)

Validate traffic per port

func ValidateTrafficPerProtocol

func ValidateTrafficPerProtocol(trafficList []messages.TrafficPerProtocol) (isUnprocessableEntity bool, errMsg string)

Validate traffic per protocol

func ValidateUnit

func ValidateUnit(unit *messages.UnitString) (isUnprocessableEntity bool, errMsg string)

Validate unit

Types

type ACL

type ACL struct {
	ACLName string
	ACLType string
}

type ACLBlockerList

type ACLBlockerList struct {
	ACLID      int64
	CustomerID int
	ACL        *types.ACL
	Blocker    Blocker
}

type ACLMapping

type ACLMapping struct {
	// contains filtered or unexported fields
}

Arista ACL that mapping with mitigation request or data channel ACL

func (*ACLMapping) CreateACLRule

func (mapping *ACLMapping) CreateACLRule() string

* Create acl rule * * parameter: * actionType the type of action "permit" or "deny" * protocol the protocol * sourceAddress the source address (TCP/UDP) * destAddress the destination address * sourcePort the source port (TCP/UDP) * destPort the destination port * ttl the ttl * fragment the fragment * flagBits the flag bits (TCP) * messageType the message (ICMP) * * return rule with type string *

func (*ACLMapping) MapACLPort

func (mapping *ACLMapping) MapACLPort(sourcePort *types.PortRangeOrOperator, destinationPort *types.PortRangeOrOperator)

* Map data channel port-range-or-operator to arista ACL rule

func (*ACLMapping) MapACLTcpFlagsFlowWithFlagsBitmask

func (mapping *ACLMapping) MapACLTcpFlagsFlowWithFlagsBitmask(flag *types.FlagsBitmask)

* Map data channel tcp flags bitmask to Arista Acl tcp-flags

func (*ACLMapping) MapDataChannelACLRule

func (mapping *ACLMapping) MapDataChannelACLRule(protocol *uint8, sourceAddr *types.IPPrefix, destinationAddr *types.IPPrefix, ttl *uint8, dscp *uint8, ecn *uint8)

* Map protocol, source address, destination address and ttl to arista ACL rule

func (*ACLMapping) MapMitigationACLRule

func (mapping *ACLMapping) MapMitigationACLRule(targetProtocol string, targetAddr string, targetPort string, srcAddr string, srcPort string, srcICMPType string)

* Map protocol, source address, destination address to arista ACL rule

type ACLTarget

type ACLTarget struct {
	// contains filtered or unexported fields
}

func CreateACLTargetsForDataChannel

func CreateACLTargetsForDataChannel(d *types.ACL) []ACLTarget

* Create ACL target for data channel ACL

func CreateACLTargetsForMitigation

func CreateACLTargetsForMitigation(m *MitigationScope) []ACLTarget

* Create ACL target for mitigation request

func (*ACLTarget) ACLRule

func (acl *ACLTarget) ACLRule() string

func (*ACLTarget) ACLType

func (acl *ACLTarget) ACLType() string

type ActivationType

type ActivationType int
const (
	ActiveWhenMitigating ActivationType = iota + 1
	Immediate
	Deactivate
)

type ActiveMitigationRequest

type ActiveMitigationRequest struct {
	MitigationScopeId int64
	Lifetime          int
	LastModified      time.Time
}

* Struct for Active Mitigation Request.

func CreateActiveMitigationRequest

func CreateActiveMitigationRequest(id int64, lifetime int) (acm ActiveMitigationRequest)

type ActiveSessionConfiguration

type ActiveSessionConfiguration struct {
	SessionId   int
	MaxAge      uint
	LastRefresh time.Time
}

* Struct for Fresh Session Configuration.

type AddressRange

type AddressRange struct {
	Prefixes []Prefix
}

func (*AddressRange) Includes

func (a *AddressRange) Includes(prefix Prefix) bool

* Check if the AddressRange includes the prefix. * * parameter: * prefix Prefix * return: * bool true/false

func (*AddressRange) Validate

func (a *AddressRange) Validate(prefix Prefix) bool

* Validate the prefix ownerships of the Customer. * * parameter: * prefix Prefix * return: * bool true/false

type AristaACL

type AristaACL struct {
	ProtectionBase
	// contains filtered or unexported fields
}

func NewAristaProtection

func NewAristaProtection(base ProtectionBase, params []db_models.AristaParameter) *AristaACL

func (*AristaACL) AclTargets

func (a *AristaACL) AclTargets() []ACLTarget

func (AristaACL) Type

func (p AristaACL) Type() ProtectionType

type AttackDetail

type AttackDetail struct {
	VendorId          int
	AttackId          int
	DescriptionLang   string
	AttackDescription string
	AttackSeverity    messages.AttackSeverityString
	StartTime         messages.Uint64String
	EndTime           messages.Uint64String
	SourceCount       PercentilePeakAndCurrent
	TopTalker         []TopTalker
}

func GetUriFilteringAttackDetail

func GetUriFilteringAttackDetail(engine *xorm.Engine, customerId int, cuid string, preMitigationId int64) ([]AttackDetail, error)

Get uri filtering attack detail

func NewAttackDetail

func NewAttackDetail(adRequests []messages.AttackDetail) (attackDetailList []AttackDetail, err error)

New attack detail

type AttackStatus

type AttackStatus int
const (
	UnderAttack AttackStatus = iota + 1
	AttackSuccessfullyMitigated
)

type AuthenticationInformation

type AuthenticationInformation struct {
}

type Baseline

type Baseline struct {
	Id                             int64
	BaselineId                     int
	TargetPrefix                   []Prefix
	TargetPortRange                []PortRange
	TargetProtocol                 SetInt
	FQDN                           SetString
	URI                            SetString
	AliasName                      SetString
	TotalTrafficNormal             []Traffic
	TotalTrafficNormalPerProtocol  []TrafficPerProtocol
	TotalTrafficNormalPerPort      []TrafficPerPort
	TotalConnectionCapacity        []TotalConnectionCapacity
	TotalConnectionCapacityPerPort []TotalConnectionCapacityPerPort
	TargetList                     []Target
}

func DefaultBaseline

func DefaultBaseline() (baselineList []Baseline, err error)

Default value of baseline

func GetBaselineByTeleSetupId

func GetBaselineByTeleSetupId(customerId int, cuid string, setupId int64) (baselineList []Baseline, err error)

Get baseline by teleSetupId

func NewBaseline

func NewBaseline() (baseline *Baseline)

func NewBaselineList

func NewBaselineList(baselines []messages.Baseline, aliases types.Aliases) (baselineList []Baseline, err error)

New baseline

type Blocker

type Blocker interface {
	GenerateProtectionCommand(mitigationScope *MitigationScope) (command string, err error)
	Connect() error
	ExecuteProtection(protection Protection) error
	StopProtection(protection Protection) error
	RegisterProtection(r *MitigationOrDataChannelACL, targetID int64, customerID int, targetType string) (Protection, error)
	UnregisterProtection(protection Protection) error

	Id() int64
	Capacity() int
	Load() int
	SetLoad(l int)
	Type() BlockerType
}

type BlockerBase

type BlockerBase struct {
	// contains filtered or unexported fields
}

define Blocker struct

func (BlockerBase) Capacity

func (b BlockerBase) Capacity() int

func (*BlockerBase) Id

func (b *BlockerBase) Id() int64

func (BlockerBase) Load

func (b BlockerBase) Load() int

func (*BlockerBase) SetLoad

func (b *BlockerBase) SetLoad(l int)

func (*BlockerBase) Sync

func (b *BlockerBase) Sync()

type BlockerSelectionStrategy

type BlockerSelectionStrategy interface {
	// contains filtered or unexported methods
}

Blocker selection algorithm interface

type BlockerType

type BlockerType string

type ConfigurationParameterRange

type ConfigurationParameterRange struct {
	// contains filtered or unexported fields
}

func NewConfigurationParameterRange

func NewConfigurationParameterRange(min_value float64, max_value float64) *ConfigurationParameterRange

* Create a new ConfigurationParameterRange * * parameter: * min_value min_value of the range * max_value max_value of the range * return: * configurationParameterRange ConfigurationParameterRange

func (*ConfigurationParameterRange) Includes

func (p *ConfigurationParameterRange) Includes(parameter float64) bool

* Check whether the value of the argument is within the range. * * parameter: * parameter ConfigurationParameter to be compared * return: * bool true/false

func (*ConfigurationParameterRange) StartingOn

* Create a ConfigurationParameterRange with the upper open-ended parameters. * * parameter: * end max_value of the range * return: * configurationParameterRange ConfigurationParameterRange

func (*ConfigurationParameterRange) UpTo

* Create a ConfigurationParameterRange with the lower open-ended parameter. * * parameter: * end max_value of the range * return: * configurationParameterRange ConfigurationParameterRange

type ConflictCause

type ConflictCause int
const (
	OVERLAPPING_TARGETS ConflictCause = iota + 1
	WHITELIST_ACL_COLLISION
	CUID_COLLISION
	UNDEFINED
	OVERLAPPING_PIPE_SCOPE
)

type ConflictInformation

type ConflictInformation struct {
	ConflictStatus ConflictStatus
	ConflictCause  ConflictCause
	ConflictScope  *ConflictScope
	RetryTimer     int
}

func (*ConflictInformation) ParseToResponse

func (conflictInfo *ConflictInformation) ParseToResponse() *messages.ConflictInformation

* Parse Conflict Information model to response model * parameter: * conflictInfo Conflict Information model * return: Conflict Information response model

type ConflictScope

type ConflictScope struct {
	MitigationId    int
	TargetProtocol  SetInt
	TargetFQDN      SetString
	TargetURI       SetString
	AliasName       SetString
	TargetIP        []Prefix
	TargetPrefix    []Prefix
	TargetPortRange []PortRange
	Acl             []ACL
}

func NewConflictScope

func NewConflictScope() (cs *ConflictScope)

Conflict Scope constructor

func (*ConflictScope) ParseToResponse

func (conflictScope *ConflictScope) ParseToResponse() *messages.ConflictScope

* Parse Conflict Scope model to response model * parameter: * conflictScope Conflict Scope model * return: Conflict Scope response model

type ConflictStatus

type ConflictStatus int
const (
	REJECTED ConflictStatus = iota + 1
	DEACTIVATED
	DEACTIVATED_ALL
)

type ControlFiltering

type ControlFiltering struct {
	ACLName        string
	ActivationType *messages.ActivationTypeString
}

func GetControlFilteringByMitigationScopeID

func GetControlFilteringByMitigationScopeID(engine *xorm.Engine, customerID int, clientIdentifier string, mitigationScopeID int64) (controlFilteringList []ControlFiltering, err error)

* Get control filtering from mitigation scope id

type Customer

type Customer struct {
	Id                         int
	CommonName                 string
	CustomerNetworkInformation *CustomerNetworkInformation
}

func GetCustomer

func GetCustomer(customerId int) (customer Customer, err error)

* Find a customer by customer ID. * * parameter: * customer_id Customer ID * return: * customer Customer * error error

func GetCustomerByCommonName

func GetCustomerByCommonName(cn string) (*Customer, error)

* find Customer by the common name in the certificate. * * parameter: * cn client common name * return: * customer request source Customer * error error

func GetCustomerById

func GetCustomerById(customerId int) (*Customer, error)

* find Customer by the integer customer ID. * * parameter: * customerId CustomerId in the database. * return: * customer request source Customer * error error

func GetCustomerCommonName

func GetCustomerCommonName(commonName string) (customer Customer, err error)

* Find a customer by CommonName * * parameter: * customer_id Customer ID * return: * customer Customer * error error

func NewCustomer

func NewCustomer() *Customer

func (*Customer) GetOngoingProtection

func (c *Customer) GetOngoingProtection() (p []Protection)

func (*Customer) Store

func (c *Customer) Store()

type CustomerNetworkInformation

type CustomerNetworkInformation struct {
	FQDN         SetString
	URI          SetString
	AddressRange AddressRange
}

func NewCustomerNetworkInformation

func NewCustomerNetworkInformation() *CustomerNetworkInformation

type Customers

type Customers int

type FlowSpec

type FlowSpec struct {
	ProtectionBase
	// contains filtered or unexported fields
}

func NewFlowSpecProtection

func NewFlowSpecProtection(base ProtectionBase, params []db_models.FlowSpecParameter) *FlowSpec

* Flowspec protection constructor

func (*FlowSpec) FlowSpecTargets

func (g *FlowSpec) FlowSpecTargets() []FlowSpecTarget

func (FlowSpec) Type

func (g FlowSpec) Type() ProtectionType

type FlowSpecMapping

type FlowSpecMapping struct {
	DestinationPrefix  string             `json:"destination"`
	SourcePrefix       string             `json:"source"`
	Protocol           []int              `json:"protocol"`
	Port               []FlowspecPort     `json:"port"`
	DestinationPort    []FlowspecPort     `json:"destination-port"`
	SourcePort         []FlowspecPort     `json:"source-port"`
	ImcpType           []FlowspecICMPType `json:"imcp-type"`
	ImcpCode           *int               `json:"imcp-code"`
	TcpFlags           []FlowspecBitmask  `json:"tcp-flags"`
	PacketLength       *int               `json:"packet-length"`
	Dscp               *int               `json:"dscp"`
	Fragment           *FlowspecBitmask   `json:"fragment"`
	FlowLabel          *int               `json:"label"`
	TrafficActionType  string             `json:"action_type"`
	TrafficActionValue string             `json:"action_value"`
	FlowType           string             `json:"flow-type"`
}

GoBGP Flowspec object that mapping with mitigation request or data channel ACL

func (*FlowSpecMapping) CreateExtendedCommunities

func (mapping *FlowSpecMapping) CreateExtendedCommunities() (bgp.PathAttributeInterface, error)

* Create flow spec extended community (traffic filtering action) * * parameter: * trafficActionType the type of action "accept", "discard", "rate-limit" or "redirect" * trafficActionCode the value of traffic action * * return flow spec path attribute *

func (*FlowSpecMapping) CreateFlowSpec

func (mapping *FlowSpecMapping) CreateFlowSpec() (bgp.AddrPrefixInterface, error)

* Create flow spec * * parameter: * trafficActionType the type of action "accept", "discard", "rate-limit" or "redirect" * trafficActionCode the value of traffic action * destinationPrefix the destination address * sourcePrefix the source address * protocol the protocol * fragment the fragment * tcpFlags the flag bits (TCP) * port the destination/source port (TCP/UDP) * destinationPort the destination port (TCP/UDP) * sourcePort the source port (TCP/UDP) * packetLength the length of the packet * icmpType the icmp message type (ICMP) * icmpCode the icmp message code (ICMP) * dcsp the dscp * flowLabel the flow label (Ipv6) * * return flow spec as interface type *

func (*FlowSpecMapping) FromDB

func (f *FlowSpecMapping) FromDB(data []byte) error

func (*FlowSpecMapping) MapACLFragmentFlow

func (mapping *FlowSpecMapping) MapACLFragmentFlow(flags *types.IPv4Flags, aclFragment *types.Fragment)

* Map data channel flags and fragment to GoBGP flow spec fragment

func (*FlowSpecMapping) MapACLPortFlow

func (mapping *FlowSpecMapping) MapACLPortFlow(sourcePort *types.PortRangeOrOperator, destinationPort *types.PortRangeOrOperator)

* Map data channel port-range-or-operator to GoBGP flow spec

func (*FlowSpecMapping) MapACLTcpFlagsFlowWithFlags

func (mapping *FlowSpecMapping) MapACLTcpFlagsFlowWithFlags(flags *types.TCPFlags)

* Map data channel tcp flags to GoBGP flow spec tcp-flags

func (*FlowSpecMapping) MapACLTcpFlagsFlowWithFlagsBitmask

func (mapping *FlowSpecMapping) MapACLTcpFlagsFlowWithFlagsBitmask(flag *types.FlagsBitmask)

* Map data channel tcp flags bitmaks to GoBGP flow spec tcp-flags

func (*FlowSpecMapping) MapDataChannelACLFlow

func (mapping *FlowSpecMapping) MapDataChannelACLFlow(protocol *uint8, sourceAddr *types.IPPrefix, destinationAddr *types.IPPrefix, length *uint16, dscp *uint8)

* Map protocol, source address, destination address and packet length to GoBGP Flow Spec

func (*FlowSpecMapping) MapMitigationFlow

func (mapping *FlowSpecMapping) MapMitigationFlow(targetProtocols SetInt, targetAddress string, targetPorts []PortRange, sourceAddress string, sourcePorts []PortRange, sourceICMPTypes []ICMPTypeRange)

* Map protocol, source address, destination address to GoBGP Flow Spec

func (*FlowSpecMapping) MapMitigationICMPTypeFlow

func (mapping *FlowSpecMapping) MapMitigationICMPTypeFlow(icmpTypeRanges []ICMPTypeRange)

* Map mitigation icmp type range to GoBGP flow spec icmp type

func (*FlowSpecMapping) MapMitigationPortFlow

func (mapping *FlowSpecMapping) MapMitigationPortFlow(portRanges []PortRange)

* Map mitigation port range to GoBGP flow spec destination port

func (*FlowSpecMapping) MapMitigationSourcePortFlow

func (mapping *FlowSpecMapping) MapMitigationSourcePortFlow(portRanges []PortRange)

* Map mitigation source port range to GoBGP flow spec source port

func (*FlowSpecMapping) String

func (f *FlowSpecMapping) String() string

func (*FlowSpecMapping) ToDB

func (f *FlowSpecMapping) ToDB() ([]byte, error)

type FlowSpecTarget

type FlowSpecTarget struct {
	// contains filtered or unexported fields
}

func CreateFlowSpecTargetsForDataChannelACL

func CreateFlowSpecTargetsForDataChannelACL(acl *types.ACL) ([]FlowSpecTarget, error)

* Create FlowSpec target for data channel ACL * * parameter: * acl the data channel acl * * return * flowspecTargets the list of flowspec * err the error

func CreateFlowSpecTargetsForMitigation

func CreateFlowSpecTargetsForMitigation(m *MitigationScope, vrf string) ([]FlowSpecTarget, error)

* Create FlowSpec target for mitigation request * * parameter: * m the mitigation request * vrf the virtual routing forwarding as customer configuration * * return * flowspecTargets the list of flowspec * err the error

func (*FlowSpecTarget) FlowSpec

func (flow *FlowSpecTarget) FlowSpec() []byte

func (*FlowSpecTarget) FlowType

func (flow *FlowSpecTarget) FlowType() string

func (*FlowSpecTarget) String

func (flow *FlowSpecTarget) String() string

type FlowspecBitmask

type FlowspecBitmask struct {
	Bitmask uint8 `json:"bitmask"`
	Flag    int   `json:"flag"`
}

GoBGP Flowspec bitmask that mapping with mitigation request or data channel flags

type FlowspecICMPType

type FlowspecICMPType struct {
	LowerType *int `json:"lower-type"`
	UpperType *int `json:"upper-type"`
}

GoBGP Flowspec icmp type that mapping with mitigation request or data channel icmp type

type FlowspecPort

type FlowspecPort struct {
	LowerPort *int   `json:"lower-port"`
	UpperPort *int   `json:"upper-port"`
	Operator  *uint8 `json:"operator"`
	Port      *int   `json:"port"`
}

GoBGP Flowspec port that mapping with mitigation request or data channel port

func ACLPortToFlowspecPort

func ACLPortToFlowspecPort(port *types.PortRangeOrOperator) []FlowspecPort

* Convert data channel Acl port to flow spec port

type GoAristaReceiver

type GoAristaReceiver struct {
	BlockerBase
	// contains filtered or unexported fields
}

implements Blocker

func NewGoAristaReceiver

func NewGoAristaReceiver(base BlockerBase, configParams map[string][]string) *GoAristaReceiver

func (*GoAristaReceiver) AristaConection

func (g *GoAristaReceiver) AristaConection() string

func (*GoAristaReceiver) AristaInterface

func (g *GoAristaReceiver) AristaInterface() string

func (*GoAristaReceiver) Connect

func (g *GoAristaReceiver) Connect() (err error)

func (*GoAristaReceiver) ExecuteProtection

func (g *GoAristaReceiver) ExecuteProtection(p Protection) (err error)

* Execute protection * 1. Connect to arista and create rule ACL * 2. Start protection * parameter: * p the protection * return: * err error

func (*GoAristaReceiver) GenerateProtectionCommand

func (g *GoAristaReceiver) GenerateProtectionCommand(m *MitigationScope) (c string, err error)

func (*GoAristaReceiver) RegisterProtection

func (g *GoAristaReceiver) RegisterProtection(r *MitigationOrDataChannelACL, targetID int64, customerID int, targetType string) (p Protection, err error)

* Register protection with acl is mititgation request or data channel acl * * parameter: * r the mitigation request or the data channel acl * targetID the target_id of protection * customerID the Id of Customer * targetType the target_type of protection * return: * p the new protection * err error

func (*GoAristaReceiver) StopProtection

func (g *GoAristaReceiver) StopProtection(p Protection) (err error)

* Stop protection * 1. Connect to arista and remove rule ACL * 2. Stop protection * parameter: * p the protection * return: * err error

func (*GoAristaReceiver) Type

func (g *GoAristaReceiver) Type() BlockerType

func (*GoAristaReceiver) UnregisterProtection

func (g *GoAristaReceiver) UnregisterProtection(p Protection) (err error)

* Remove protection * parameter: * p the protection * return: * err error

type GoBgpFlowSpecReceiver

type GoBgpFlowSpecReceiver struct {
	BlockerBase
	// contains filtered or unexported fields
}

implements Blocker

func NewGoBgpFlowSpecReceiver

func NewGoBgpFlowSpecReceiver(base BlockerBase, params map[string][]string, configParams map[string][]string) *GoBgpFlowSpecReceiver

func (*GoBgpFlowSpecReceiver) Connect

func (g *GoBgpFlowSpecReceiver) Connect() (err error)

func (*GoBgpFlowSpecReceiver) ExecuteProtection

func (g *GoBgpFlowSpecReceiver) ExecuteProtection(p Protection) (err error)

* Execute protection * 1. Connect to gobgp and create flow spec * 2. Start protection * parameter: * p the protection * return: * err error

func (*GoBgpFlowSpecReceiver) GenerateProtectionCommand

func (g *GoBgpFlowSpecReceiver) GenerateProtectionCommand(m *MitigationScope) (c string, err error)

func (*GoBgpFlowSpecReceiver) RegisterProtection

func (g *GoBgpFlowSpecReceiver) RegisterProtection(r *MitigationOrDataChannelACL, targetID int64, customerID int, targetType string) (p Protection, err error)

* Register protection with flow spec is mititgation request or data channel acl * * parameter: * r the mitigation request or the data channel acl * targetID the target_id of protection * customerID the Id of Customer * targetType the target_type of protection * return: * p the new protection * err error

func (*GoBgpFlowSpecReceiver) StopProtection

func (g *GoBgpFlowSpecReceiver) StopProtection(p Protection) (err error)

* Stop protection * 1. Connect to gobgp and remove flow spec * 2. Stop protection * parameter: * p the protection * return: * err error

func (*GoBgpFlowSpecReceiver) Type

func (*GoBgpFlowSpecReceiver) UnregisterProtection

func (g *GoBgpFlowSpecReceiver) UnregisterProtection(p Protection) (err error)

* Remove protection * parameter: * p the protection * return: * err error

type GoBgpRtbhReceiver

type GoBgpRtbhReceiver struct {
	BlockerBase
	// contains filtered or unexported fields
}

implements Blocker

func NewGoBgpRtbhReceiver

func NewGoBgpRtbhReceiver(base BlockerBase, params map[string][]string) *GoBgpRtbhReceiver

func (*GoBgpRtbhReceiver) Connect

func (g *GoBgpRtbhReceiver) Connect() (err error)

func (*GoBgpRtbhReceiver) ExecuteProtection

func (g *GoBgpRtbhReceiver) ExecuteProtection(p Protection) (err error)

* Invoke GoBGP RTBH[Remotely Triggered Black Hole]

func (*GoBgpRtbhReceiver) GenerateProtectionCommand

func (g *GoBgpRtbhReceiver) GenerateProtectionCommand(m *MitigationScope) (c string, err error)

func (*GoBgpRtbhReceiver) Host

func (g *GoBgpRtbhReceiver) Host() string

func (*GoBgpRtbhReceiver) NextHop

func (g *GoBgpRtbhReceiver) NextHop() string

func (*GoBgpRtbhReceiver) Port

func (g *GoBgpRtbhReceiver) Port() string

func (*GoBgpRtbhReceiver) RegisterProtection

func (g *GoBgpRtbhReceiver) RegisterProtection(r *MitigationOrDataChannelACL, targetID int64, customerID int, targetType string) (p Protection, err error)

func (*GoBgpRtbhReceiver) StopProtection

func (g *GoBgpRtbhReceiver) StopProtection(p Protection) (err error)

* Stop GoBGP RTBH.

func (*GoBgpRtbhReceiver) Timeout

func (g *GoBgpRtbhReceiver) Timeout() int

func (*GoBgpRtbhReceiver) Type

func (g *GoBgpRtbhReceiver) Type() BlockerType

func (*GoBgpRtbhReceiver) UnregisterProtection

func (g *GoBgpRtbhReceiver) UnregisterProtection(p Protection) (err error)

type ICMPTypeRange

type ICMPTypeRange struct {
	LowerType int
	UpperType int
}

func GetTelemetrySourceIcmpTypeRange

func GetTelemetrySourceIcmpTypeRange(engine *xorm.Engine, teleTopTalkerId int64) (icmpTypeRangeList []ICMPTypeRange, err error)

Get telemetry source icmp type range

func GetUriFilteringIcmpTypeRange

func GetUriFilteringIcmpTypeRange(engine *xorm.Engine, teleTopTalkerId int64) (icmpTypeRangeList []ICMPTypeRange, err error)

Get uri filtering icmp type range

func NewICMPTypeRange

func NewICMPTypeRange(lower_type int, upper_type int) ICMPTypeRange

* Create a new icmp type range. * * parameter: * LowerType LowerTYpe * UpperType UpperType * return: * ICMPTypeRange ICMPTypeRange

type LoadBaseBlockerSelection

type LoadBaseBlockerSelection struct{}

Blocker selection strategy which select the blockers with lowest loads. implements BlockerSelectionStrategy

type MessageEntity

type MessageEntity interface{}

type MessageEntityValidator

type MessageEntityValidator interface {
	Validate(m MessageEntity, c *Customer) (ret bool)
}

type MitigationOrDataChannelACL

type MitigationOrDataChannelACL struct {
	MitigationRequest *MitigationScope
	DataChannelACL    *types.ACL
}

type MitigationScope

type MitigationScope struct {
	MitigationId                   int
	MitigationScopeId              int64
	TargetProtocol                 SetInt
	FQDN                           SetString
	URI                            SetString
	AliasName                      SetString
	Lifetime                       int
	Status                         int
	AttackStatus                   int
	TriggerMitigation              bool
	TargetIP                       []Prefix
	TargetPrefix                   []Prefix
	SourcePrefix                   []Prefix
	TargetPortRange                []PortRange
	SourcePortRange                []PortRange
	SourceICMPTypeRange            []ICMPTypeRange
	Customer                       *Customer
	ClientIdentifier               string
	ClientDomainIdentifier         string
	AclName                        string
	TargetList                     []Target // List of target prefix/fqdn/uri
	ControlFilteringList           []ControlFiltering
	TelemetryTotalTraffic          []Traffic
	TelemetryTotalAttackTraffic    []Traffic
	TelemetryTotalAttackConnection TelemetryTotalAttackConnection
	TelemetryAttackDetail          []TelemetryAttackDetail
}

func GetMitigationScope

func GetMitigationScope(customerId int, clientIdentifier string, mitigationId int, mitigationScopeId int64, queries []string) (mitigationScope *MitigationScope, err error)

* Obtains a mitigation scope object by a customerId and a mitigationId. * Indicate either mitigationScopeId or set of (customerId, clientIdentifier, mitigationId) * * parameter: * customerId id of the Customer * mitigationId mitigation id of the mitigation scope object * mitigationScopeId mitigatoin scope id of the mitigation scope object * return: * mitigationScope mitigation-scope * error error

func NewMitigationScope

func NewMitigationScope(c *Customer, clientIdentifier string) (s *MitigationScope)

Mitigation Scope constructor

func (*MitigationScope) GetFqdnAsTarget

func (s *MitigationScope) GetFqdnAsTarget() (targetList []Target, err error)

* Get mitigation FQDNs as target type * * return: * targetList list of the target FQDNs * err error

func (*MitigationScope) GetPrefixAsTarget

func (s *MitigationScope) GetPrefixAsTarget() (targetList []Target)

* Get mitigation prefixes as target type * * return: * targetList list of the target Prefixes

func (*MitigationScope) GetTargetList

func (s *MitigationScope) GetTargetList() (targetList []Target, err error)

* Get list of mitigation target Prefixes/FQDNs/URIs * * return: * targetList list of the target Prefixes/FQDNs/URIs * err error

func (*MitigationScope) GetUriAsTarget

func (s *MitigationScope) GetUriAsTarget() (targetList []Target, err error)

* Get mitigation URIs as target type * * return: * targetList list of the target URIs * err error

func (*MitigationScope) IsActive

func (s *MitigationScope) IsActive() bool

* Return mitigation status that is active or inactive * * return: * bool * true mitigation is active * false mitigation is inactive

type ParameterType

type ParameterType string
const (
	TARGET_PROTOCOL ParameterType = "TARGET_PROTOCOL"
	TARGET_FQDN     ParameterType = "FQDN"
	TARGET_URI      ParameterType = "URI"
	ALIAS_NAME      ParameterType = "ALIAS_NAME"
)

type PercentilePeakAndCurrent

type PercentilePeakAndCurrent struct {
	LowPercentileG  messages.Uint64String
	MidPercentileG  messages.Uint64String
	HighPercentileG messages.Uint64String
	PeakG           messages.Uint64String
	CurrentG        messages.Uint64String
}

func ConvertDataToPercentilePeakAndCurrent

func ConvertDataToPercentilePeakAndCurrent(low uint64, mid uint64, high uint64, peak uint64, current uint64) (ppac PercentilePeakAndCurrent)

Cobvert data to PercentilePeakAndCurrent

func GetModelsPercentilePeakAndCurrent

func GetModelsPercentilePeakAndCurrent(value *PercentilePeakAndCurrent) (sourceCount PercentilePeakAndCurrent)

Get percentile peak and current with type is PercentilePeakAndCurrent

func GetTelemetrySourceCount

func GetTelemetrySourceCount(engine *xorm.Engine, adId int64) (PercentilePeakAndCurrent, error)

Get telemetry source count

func GetUriFilteringSourceCount

func GetUriFilteringSourceCount(engine *xorm.Engine, adId int64) (PercentilePeakAndCurrent, error)

Get uri filtering source count

func NewPercentilePeakAndCurrent

func NewPercentilePeakAndCurrent(scRequest messages.PercentilePeakAndCurrent) (sourceCount PercentilePeakAndCurrent)

New percentile peak and current

type PercentileType

type PercentileType string
const (
	LOW_PERCENTILE_L  PercentileType = "LOW_PERCENTILE_L"
	MID_PERCENTILE_L  PercentileType = "MID_PERCENTILE_L"
	HIGH_PERCENTILE_L PercentileType = "HIGH_PERCENTILE_L"
	PEAK_L            PercentileType = "PEAK_L"
	CURRENT_L         PercentileType = "CURRENT_L"
	LOW_PERCENTILE_C  PercentileType = "LOW_PERCENTILE_C"
	MID_PERCENTILE_C  PercentileType = "MID_PERCENTILE_C"
	HIGH_PERCENTILE_C PercentileType = "HIGH_PERCENTILE_C"
	PEAK_C            PercentileType = "PEAK_C"
	CURRENT_C         PercentileType = "CURRENT_C"
)

type PortRange

type PortRange struct {
	LowerPort int
	UpperPort int
}

func GetTelemetryPortRange

func GetTelemetryPortRange(engine *xorm.Engine, tType string, typeId int64, prefixType string) (portRangeList []PortRange, err error)

Get telemetry port range

func GetTelemetrySourcePortRange

func GetTelemetrySourcePortRange(engine *xorm.Engine, teleTopTakerId int64) (portRangeList []PortRange, err error)

Get telemetry source port range

func GetUriFilteringSourcePortRange

func GetUriFilteringSourcePortRange(engine *xorm.Engine, teleTopTalkerId int64) (portRangeList []PortRange, err error)

Get uri filtering source port range

func NewPortRange

func NewPortRange(lower_port int, upper_port int) PortRange

* Create a new port range. * * parameter: * LowerPort LowerPort * UpperPort UpperPort * return: * PortRange PortRange

func NewTargetPortRange

func NewTargetPortRange(portRanges []messages.PortRange) (portRangeList []PortRange)

New target port range

func (*PortRange) Includes

func (p *PortRange) Includes(port int) bool

* Check if the PortRange includes the port. * * parameter: * port target port number * return: * bool error

type Prefix

type Prefix struct {
	Addr      string
	PrefixLen int
	// contains filtered or unexported fields
}

Object to store CIDR

func ConvertAddrStringToPrefix

func ConvertAddrStringToPrefix(addrString []string) []Prefix

func GetTelemetryPrefix

func GetTelemetryPrefix(engine *xorm.Engine, tType string, typeId int64, prefixType string) (prefixList []Prefix, err error)

Get telemetry prefix

func GetTelemetrySourcePrefix

func GetTelemetrySourcePrefix(engine *xorm.Engine, teleTopTalkerId int64) (prefix Prefix, err error)

Get telemetry source prefix

func GetUriFilteringSourcePrefix

func GetUriFilteringSourcePrefix(engine *xorm.Engine, teleTopTalkerId int64) (prefix Prefix, err error)

Get uri filtering source prefix

func NewPrefix

func NewPrefix(addrString string) (p Prefix, err error)

Create new prefixes from CIDR format strings.

func NewPrefixFromFQDN

func NewPrefixFromFQDN(fqdn string) (p []Prefix, err error)

* Create new prefixes from FQDN format strings. * parameters: * fqdn fqdn input string * return: * p ip prefix of the fqdn * err error

func NewPrefixFromIps

func NewPrefixFromIps(ips []net.IP) (p []Prefix, err error)

func NewPrefixFromURI

func NewPrefixFromURI(uri string) (p []Prefix, err error)

* Create new prefixes from URI format strings. * parameters: * uri uri input string * return: * p ip prefix of the uri * err error

func NewTelemetryPrefix

func NewTelemetryPrefix(prefixes []string) (prefixList []Prefix, err error)

New telemetry prefix

func RemoveOverlapPrefix

func RemoveOverlapPrefix(prefixlst []Prefix) []Prefix

Remove overlap prefix

func (Prefix) CheckValidRangeIpAddress

func (prefix Prefix) CheckValidRangeIpAddress(addressRangePrefixes AddressRange) (bool, []string)

Check validate range ip address

func (*Prefix) Includes

func (p *Prefix) Includes(other *Prefix) (ret bool)

Check if this prefix includes the prefix.

func (*Prefix) IsBroadCast

func (prefix *Prefix) IsBroadCast() bool

IsBroadCast reports whether ip is a broadcast address.

func (*Prefix) IsLoopback

func (prefix *Prefix) IsLoopback() bool

IsLoopback reports whether ip is a loopback address.

func (*Prefix) IsMulticast

func (prefix *Prefix) IsMulticast() bool

IsMulticast reports whether ip is a multicast address.

func (*Prefix) LastIP

func (p *Prefix) LastIP() (ip net.IP)

Obtain the broadcast address.

func (*Prefix) String

func (p *Prefix) String() string

* Convert to CIDR strings.

func (*Prefix) Validate

func (p *Prefix) Validate(addr string) (ret bool)

Check if this prefix includes the address(string).

type PrefixType

type PrefixType string
const (
	TARGET_PREFIX PrefixType = "TARGET_PREFIX"
	SOURCE_PREFIX PrefixType = "SOURCE_PREFIX"
)

type Protection

type Protection interface {
	Id() int64
	CustomerId() int
	TargetId() int64
	TargetType() string
	AclName() string
	SessionName() string
	SetSessionName(name string)
	Action() string
	SetAction(action string)
	IsEnabled() bool
	SetIsEnabled(b bool)
	Type() ProtectionType
	TargetBlocker() Blocker
	StartedAt() time.Time
	SetStartedAt(t time.Time)
	FinishedAt() time.Time
	SetFinishedAt(t time.Time)
	RecordTime() time.Time
	DroppedDataInfo() *ProtectionStatus
}

func GetActiveProtectionByTargetIDAndTargetType

func GetActiveProtectionByTargetIDAndTargetType(targetID int64, targetType string) (p Protection, err error)

func GetProtectionById

func GetProtectionById(id int64) (p Protection, err error)

type ProtectionBase

type ProtectionBase struct {
	// contains filtered or unexported fields
}

Protection Base

func GetProtectionBase

func GetProtectionBase(mitigationScopeId int64) (protection ProtectionBase, err error)

* Obtains a Protection object by ID. * * parameter: * mitigationId mitigation ID * return: * protection Protection * error error

func (ProtectionBase) AclName

func (p ProtectionBase) AclName() string

func (ProtectionBase) Action

func (p ProtectionBase) Action() string

func (ProtectionBase) CustomerId

func (p ProtectionBase) CustomerId() int

func (ProtectionBase) DroppedDataInfo

func (p ProtectionBase) DroppedDataInfo() *ProtectionStatus

func (ProtectionBase) FinishedAt

func (p ProtectionBase) FinishedAt() time.Time

func (ProtectionBase) Id

func (p ProtectionBase) Id() int64

func (ProtectionBase) IsEnabled

func (p ProtectionBase) IsEnabled() bool

func (ProtectionBase) RecordTime

func (p ProtectionBase) RecordTime() time.Time

func (ProtectionBase) SessionName

func (p ProtectionBase) SessionName() string

func (*ProtectionBase) SetAction

func (p *ProtectionBase) SetAction(action string)

func (*ProtectionBase) SetFinishedAt

func (p *ProtectionBase) SetFinishedAt(t time.Time)

func (*ProtectionBase) SetIsEnabled

func (p *ProtectionBase) SetIsEnabled(e bool)

func (*ProtectionBase) SetSessionName

func (p *ProtectionBase) SetSessionName(name string)

func (*ProtectionBase) SetStartedAt

func (p *ProtectionBase) SetStartedAt(t time.Time)

func (ProtectionBase) StartedAt

func (p ProtectionBase) StartedAt() time.Time

func (ProtectionBase) TargetBlocker

func (p ProtectionBase) TargetBlocker() Blocker

func (ProtectionBase) TargetId

func (p ProtectionBase) TargetId() int64

func (ProtectionBase) TargetType

func (p ProtectionBase) TargetType() string

type ProtectionStatus

type ProtectionStatus struct {
	// contains filtered or unexported fields
}

func NewProtectionStatus

func NewProtectionStatus(id int64, bytesDropped, packetsDropped, bpsDropped, ppsDropped int) *ProtectionStatus

func (*ProtectionStatus) BpsDropped

func (p *ProtectionStatus) BpsDropped() int

func (*ProtectionStatus) BytesDropped

func (p *ProtectionStatus) BytesDropped() int

func (*ProtectionStatus) Id

func (p *ProtectionStatus) Id() int64

func (*ProtectionStatus) PacketDropped

func (p *ProtectionStatus) PacketDropped() int

func (*ProtectionStatus) PpsDropped

func (p *ProtectionStatus) PpsDropped() int

func (*ProtectionStatus) SetId

func (p *ProtectionStatus) SetId(id int64)

type ProtectionType

type ProtectionType string

type QueryType

type QueryType int
const (
	TargetPrefix QueryType = iota + 1
	TargetPort
	TargetProtocol
	TargetFqdn
	TargetUri
	TargetAlias
	Mid
	SourcePrefix
	SourcePort
	SourceIcmpType
	Content
)

type RTBH

type RTBH struct {
	ProtectionBase
	// contains filtered or unexported fields
}

implements Protection

func NewRTBHProtection

func NewRTBHProtection(base ProtectionBase, params []db_models.GoBgpParameter) *RTBH

func (*RTBH) RtbhTargets

func (r *RTBH) RtbhTargets() []string

func (RTBH) Type

func (r RTBH) Type() ProtectionType

type Range

type Range interface {
	Start() interface{}
	End() interface{}
	IncludeRange(Range) bool
	Includes(interface{}) bool
}

type ScopeBlockerList

type ScopeBlockerList struct {
	Scope   *MitigationScope
	Blocker Blocker
}

type Set

type Set interface {
	ToInterfaceList() []interface{}
	FromParameterValue([]db_models.ParameterValue)
}

type SetInt

type SetInt map[int]struct{}

func GetTelemetryParameterWithParameterTypeIsProtocol

func GetTelemetryParameterWithParameterTypeIsProtocol(engine *xorm.Engine, tType string, typeId int64, parameterType string) (protocolList SetInt, err error)

Get telemetry parameter with parameter type is 'protocol'

func NewSetInt

func NewSetInt() SetInt

func (SetInt) AddList

func (s SetInt) AddList(list []int)

func (SetInt) Append

func (s SetInt) Append(value int)

func (SetInt) Delete

func (s SetInt) Delete(value int)

func (SetInt) FromParameterValue

func (s SetInt) FromParameterValue(array []db_models.ParameterValue)

func (SetInt) Include

func (s SetInt) Include(value int) bool

func (SetInt) List

func (s SetInt) List() []int

func (SetInt) ToInterfaceList

func (s SetInt) ToInterfaceList() []interface{}

type SetString

type SetString map[string]struct{}

func GetTelemetryParameterWithParameterTypeIsAlias

func GetTelemetryParameterWithParameterTypeIsAlias(engine *xorm.Engine, tType string, typeId int64, parameterType string) (aliasNameList SetString, err error)

Get telemetry parameter with parameter type is 'alias'

func GetTelemetryParameterWithParameterTypeIsFqdn

func GetTelemetryParameterWithParameterTypeIsFqdn(engine *xorm.Engine, tType string, typeId int64, parameterType string) (fqdnList SetString, err error)

Get telemetry parameter with parameter type is 'fqdn'

func GetTelemetryParameterWithParameterTypeIsUri

func GetTelemetryParameterWithParameterTypeIsUri(engine *xorm.Engine, tType string, typeId int64, parameterType string) (uriList SetString, err error)

Get telemetry parameter with parameter type is 'uri'

func NewSetString

func NewSetString() SetString

func (SetString) AddList

func (s SetString) AddList(list []string)

func (SetString) Append

func (s SetString) Append(value string)

func (SetString) Delete

func (s SetString) Delete(value string)

func (SetString) FromParameterValue

func (s SetString) FromParameterValue(array []db_models.ParameterValue)

func (SetString) Include

func (s SetString) Include(value string) bool

func (SetString) List

func (s SetString) List() []string

func (SetString) ToInterfaceList

func (s SetString) ToInterfaceList() []interface{}

type SetupType

type SetupType string
const (
	TELEMETRY_CONFIGURATION SetupType = "TELEMETRY_CONFIGURATION"
	PIPE                    SetupType = "PIPE"
	BASELINE                SetupType = "BASELINE"
)

type SignalConfigurationParameter

type SignalConfigurationParameter struct {
	// contains filtered or unexported fields
}

type SignalConfigurationValidator

type SignalConfigurationValidator struct {
	SignalConfigurationParameter SignalConfigurationParameter
}

implements SignalSessionConfigurationValidator

func (*SignalConfigurationValidator) CheckMissingSessionConfiguration

func (v *SignalConfigurationValidator) CheckMissingSessionConfiguration(data *messages.SignalConfigs, c Customer) (ret bool, errMessage string)

*Check missing session config

func (*SignalConfigurationValidator) Validate

func (v *SignalConfigurationValidator) Validate(m MessageEntity, c Customer) (isPresent bool, isUnprocessableEntity bool, errMessage string)

define validate

type SignalSessionConfiguration

type SignalSessionConfiguration struct {
	SessionId             int
	HeartbeatInterval     int
	MissingHbAllowed      int
	MaxRetransmit         int
	AckTimeout            float64
	AckRandomFactor       float64
	MaxPayload            int
	NonMaxRetransmit      int
	NonTimeout            float64
	NonReceiveTimeout     float64
	NonProbingWait        float64
	NonPartialWait        float64
	HeartbeatIntervalIdle int
	MissingHbAllowedIdle  int
	MaxRetransmitIdle     int
	AckTimeoutIdle        float64
	AckRandomFactorIdle   float64
	MaxPayloadIdle        int
	NonMaxRetransmitIdle  int
	NonTimeoutIdle        float64
	NonReceiveTimeoutIdle float64
	NonProbingWaitIdle    float64
	NonPartialWaitIdle    float64
}

func GetCurrentSignalSessionConfiguration

func GetCurrentSignalSessionConfiguration(customerId int) (signalSessionConfiguration *SignalSessionConfiguration, err error)

* Obtains the current SignalSessionConfiguration by the customer ID. * * parameter: * customerId id of the customer * return: * signalSessionConfiguration SignalSessionConfiguration * error error

func GetSignalSessionConfiguration

func GetSignalSessionConfiguration(customerId int, sessionId int) (signalSessionConfiguration *SignalSessionConfiguration, err error)

* Obtains the SignalSessionConfiguration by the customer ID. * * parameter: * customerId id of the customer * sessionId id of the session * return: * signalSessionConfiguration SignalSessionConfiguration * error error

func NewSignalSessionConfiguration

func NewSignalSessionConfiguration(sessionId int, payload messages.SignalConfigs) (s *SignalSessionConfiguration)

* Store newly created SignalSessionConfiguration objects to the DB. * * parameter: * sessionId sessionId * payload SignalConfigs * return: * s SignalSessionConfiguration

type Storable

type Storable interface {
	Store()
}

type Target

type Target struct {
	TargetPrefix Prefix
	TargetType   TargetType
	TargetValue  string // original value from json
}

func GetAliasDataAsTargetList

func GetAliasDataAsTargetList(aliases types.Aliases) (targetList []Target, err error)

Get alias data as TargetList

func GetTelemetryFqdnAsTarget

func GetTelemetryFqdnAsTarget(fqdns SetString) (targetList []Target, err error)

Get telemetry fqdn as target

func GetTelemetryPrefixAsTarget

func GetTelemetryPrefixAsTarget(prefixs []Prefix) (targetList []Target)

Get telemetry prefix as target

func GetTelemetryTargetList

func GetTelemetryTargetList(prefixs []Prefix, fqdns SetString, uris SetString) (targetList []Target, err error)

Get telemetry target list

func GetTelemetryUriAsTarget

func GetTelemetryUriAsTarget(uris SetString) (targetList []Target, err error)

Get telemetry uri as target

func GetUriFilteringTarget

func GetUriFilteringTarget(customerId int, cuid string, ufPreMitigation db_models.UriFilteringTelemetryPreMitigation) ([]Target, error)

Get uri filtering target

type TargetType

type TargetType string
const (
	IP_ADDRESS TargetType = "ip-address"
	IP_PREFIX  TargetType = "prefix"
	FQDN       TargetType = "fqdn"
	URI        TargetType = "uri"
)

type Targets

type Targets struct {
	TargetPrefix    []Prefix
	TargetPortRange []PortRange
	TargetProtocol  SetInt
	FQDN            SetString
	URI             SetString
	AliasName       SetString
	TargetList      []Target
}

func NewTarget

func NewTarget(customer *Customer, cuid string, targetRequest *messages.Target, aliases types.Aliases) (target Targets, err error)

New targets (target_prefix, target_port_range, target_uri, target_fqdn, alias_name)

type TelemetryAttackDetail

type TelemetryAttackDetail struct {
	VendorId          int
	AttackId          int
	AttackDescription string
	AttackSeverity    messages.AttackSeverityString
	StartTime         messages.Uint64String
	EndTime           messages.Uint64String
	SourceCount       PercentilePeakAndCurrent
	TopTalker         []TelemetryTopTalker
}

func GetTelemetryAttackDetail

func GetTelemetryAttackDetail(engine *xorm.Engine, mitigationScopeId int64) ([]TelemetryAttackDetail, error)

Get telemetry attack detail

func NewTelemetryAttackDetail

func NewTelemetryAttackDetail(adRequests []messages.TelemetryAttackDetail) (attackDetailList []TelemetryAttackDetail, err error)

New telemetry attack-detail

type TelemetryConfiguration

type TelemetryConfiguration struct {
	MeasurementInterval       messages.IntervalString
	MeasurementSample         messages.SampleString
	LowPercentile             float64
	MidPercentile             float64
	HighPercentile            float64
	UnitConfigList            []UnitConfig
	ServerOriginatedTelemetry bool
	TelemetryNotifyInterval   int
}

func DefaultValueTelemetryConfiguration

func DefaultValueTelemetryConfiguration() (telemetryConfiguration *TelemetryConfiguration)

Default value of telemetry configuration

func GetTelemetryConfiguration

func GetTelemetryConfiguration(teleSetupId int64) (telemetryConfiguration *TelemetryConfiguration, err error)

Get telemetry configuration

func NewTelemetryConfiguration

func NewTelemetryConfiguration(telemetryConfig *messages.TelemetryConfigurationCurrent) (t *TelemetryConfiguration)

New telemetry configuration

type TelemetryConfigurationParameter

type TelemetryConfigurationParameter struct {
	MeasurementInterval     ConfigurationParameterRange
	MeasurementSample       ConfigurationParameterRange
	LowPercentile           ConfigurationParameterRange
	MidPercentile           ConfigurationParameterRange
	HighPercentile          ConfigurationParameterRange
	TelemetryNotifyInterval ConfigurationParameterRange
}

type TelemetryPreMitigation

type TelemetryPreMitigation struct {
	Cuid                          string
	Cdid                          string
	Tmid                          int
	Targets                       Targets
	TotalTraffic                  []Traffic
	TotalTrafficProtocol          []TrafficPerProtocol
	TotalTrafficPort              []TrafficPerPort
	TotalAttackTraffic            []Traffic
	TotalAttackTrafficProtocol    []TrafficPerProtocol
	TotalAttackTrafficPort        []TrafficPerPort
	TotalAttackConnectionProtocol []TotalAttackConnectionProtocol
	TotalAttackConnectionPort     []TotalAttackConnectionPort
	AttackDetail                  []AttackDetail
}

func GetUriFilteringTelemetryPreMitigationAttributes

func GetUriFilteringTelemetryPreMitigationAttributes(customerId int, cuid string, ufPreMitigations []db_models.UriFilteringTelemetryPreMitigation) (preMitigationList []TelemetryPreMitigation, err error)

Get uri filtering telemetry pre-mitigation attributes

func NewTelemetryPreMitigation

func NewTelemetryPreMitigation(customer *Customer, cuid string, dataRequest messages.PreOrOngoingMitigation, aliases types.Aliases) (preMitigation *TelemetryPreMitigation, err error)

New telemetry pre-mtigation

type TelemetrySetUpConfiguration

type TelemetrySetUpConfiguration struct {
	Cuid                   string
	Cdid                   string
	Tsid                   int
	TelemetryConfiguration TelemetryConfiguration
	TotalPipeCapacity      []TotalPipeCapacity
	Baseline               []Baseline
}

type TelemetryTopTalker

type TelemetryTopTalker struct {
	SpoofedStatus         bool
	SourcePrefix          Prefix
	SourcePortRange       []PortRange
	SourceIcmpTypeRange   []ICMPTypeRange
	TotalAttackTraffic    []Traffic
	TotalAttackConnection TelemetryTotalAttackConnection
}

func GetTelemetryTopTalker

func GetTelemetryTopTalker(engine *xorm.Engine, adId int64) ([]TelemetryTopTalker, error)

Get telemetry top talker

func NewTelemetryTopTalker

func NewTelemetryTopTalker(ttRequest messages.TelemetryTopTalker) (talkerList []TelemetryTopTalker, err error)

New telemetry top talker

type TelemetryTotalAttackConnection

type TelemetryTotalAttackConnection struct {
	ConnectionC     PercentilePeakAndCurrent
	EmbryonicC      PercentilePeakAndCurrent
	ConnectionPsC   PercentilePeakAndCurrent
	RequestPsC      PercentilePeakAndCurrent
	PartialRequestC PercentilePeakAndCurrent
}

func GetTelemetryTotalAttackConnection

func GetTelemetryTotalAttackConnection(engine *xorm.Engine, prefixType string, prefixTypeId int64) (tac TelemetryTotalAttackConnection, err error)

Get telemetry total attack connection

type TelemetryType

type TelemetryType string
const (
	TELEMETRY       TelemetryType = "TELEMETRY"
	TELEMETRY_SETUP TelemetryType = "TELEMETRY_SETUP"
)

type TopTalker

type TopTalker struct {
	SpoofedStatus                 bool
	SourcePrefix                  Prefix
	SourcePortRange               []PortRange
	SourceIcmpTypeRange           []ICMPTypeRange
	TotalAttackTraffic            []Traffic
	TotalAttackConnectionProtocol []TotalAttackConnectionProtocol
}

func GetUriFilteringTopTalker

func GetUriFilteringTopTalker(engine *xorm.Engine, adId int64) ([]TopTalker, error)

Get uri filtering top talker

func NewTopTalker

func NewTopTalker(ttRequest messages.TopTalker) (talkerList []TopTalker, err error)

New top talker

type TotalAttackConnectionPort

type TotalAttackConnectionPort struct {
	Protocol        int
	Port            int
	ConnectionC     PercentilePeakAndCurrent
	EmbryonicC      PercentilePeakAndCurrent
	ConnectionPsC   PercentilePeakAndCurrent
	RequestPsC      PercentilePeakAndCurrent
	PartialRequestC PercentilePeakAndCurrent
}

func ConvertDataToTotalAttackConnectionPort

Convert data to TotalAttackConnectionPort

func GetUriFilteringTotalAttackConnectionPort

func GetUriFilteringTotalAttackConnectionPort(engine *xorm.Engine, telePreMitigationId int64) (tacList []TotalAttackConnectionPort, err error)

Get uri filtering total attack connection port

func NewTotalAttackConnectionPerPort

func NewTotalAttackConnectionPerPort(tacRequests []messages.TotalAttackConnectionPort) (tacList []TotalAttackConnectionPort)

New total attack connection port

type TotalAttackConnectionProtocol

type TotalAttackConnectionProtocol struct {
	Protocol        int
	ConnectionC     PercentilePeakAndCurrent
	EmbryonicC      PercentilePeakAndCurrent
	ConnectionPsC   PercentilePeakAndCurrent
	RequestPsC      PercentilePeakAndCurrent
	PartialRequestC PercentilePeakAndCurrent
}

func ConvertDataToTotalAttackConnectionProtocol

Convert data to TotalAttackConnectionProtocol

func GetUriFilteringTotalAttackConnectionProtocol

func GetUriFilteringTotalAttackConnectionProtocol(engine *xorm.Engine, prefixType string, prefixTypeId int64) (tacList []TotalAttackConnectionProtocol, err error)

Get uri filtering total attack connection protocol

func NewTotalAttackConnectionPerProtocol

func NewTotalAttackConnectionPerProtocol(tacRequests []messages.TotalAttackConnectionProtocol) (tacList []TotalAttackConnectionProtocol)

New total attack connection protocol

type TotalAttackConnectionType

type TotalAttackConnectionType string
const (
	CONNECTION_C      TotalAttackConnectionType = "CONNECTION-C"
	EMBRYONIC_C       TotalAttackConnectionType = "EMBRYONIC-C"
	CONNECTION_PS_C   TotalAttackConnectionType = "CONNECTION-PS-C"
	REQUEST_PS_C      TotalAttackConnectionType = "REQUEST-PS-C"
	PARTIAL_REQUEST_C TotalAttackConnectionType = "PARTIAL-REQUEST-C"
)

type TotalConnectionCapacity

type TotalConnectionCapacity struct {
	TotalConnectionCapacityId int64
	Protocol                  int
	Connection                messages.Uint64String
	ConnectionClient          messages.Uint64String
	Embryonic                 messages.Uint64String
	EmbryonicClient           messages.Uint64String
	ConnectionPs              messages.Uint64String
	ConnectionClientPs        messages.Uint64String
	RequestPs                 messages.Uint64String
	RequestClientPs           messages.Uint64String
	PartialRequestMax         messages.Uint64String
	PartialRequestClientMax   messages.Uint64String
}

func GetTotalConnectionCapacity

func GetTotalConnectionCapacity(engine *xorm.Engine, teleBaselineId int64) (tccList []TotalConnectionCapacity, err error)

Get total connection capacity

func NewTotalConnectionCapacity

func NewTotalConnectionCapacity(totalConnectionCapacities []messages.TotalConnectionCapacity) (totalConnectionCapacityList []TotalConnectionCapacity)

New total connection capacity

type TotalConnectionCapacityPerPort

type TotalConnectionCapacityPerPort struct {
	TotalConnectionCapacityId int64
	Protocol                  int
	Port                      int
	Connection                messages.Uint64String
	ConnectionClient          messages.Uint64String
	Embryonic                 messages.Uint64String
	EmbryonicClient           messages.Uint64String
	ConnectionPs              messages.Uint64String
	ConnectionClientPs        messages.Uint64String
	RequestPs                 messages.Uint64String
	RequestClientPs           messages.Uint64String
	PartialRequestMax         messages.Uint64String
	PartialRequestClientMax   messages.Uint64String
}

func GetTotalConnectionCapacityPerPort

func GetTotalConnectionCapacityPerPort(engine *xorm.Engine, teleBaselineId int64) (tccList []TotalConnectionCapacityPerPort, err error)

Get total connection capacity per port

func NewTotalConnectionCapacityPerPort

func NewTotalConnectionCapacityPerPort(totalConnectionCapacities []messages.TotalConnectionCapacityPerPort) (totalConnectionCapacityList []TotalConnectionCapacityPerPort)

New total connection capacity per port

type TotalPipeCapacity

type TotalPipeCapacity struct {
	LinkId   string
	Capacity messages.Uint64String
	Unit     messages.UnitString
}

func DefaultTotalPipeCapacity

func DefaultTotalPipeCapacity() (pipeList []TotalPipeCapacity)

Default value of total pipe capacity

func GetTotalPipeCapacity

func GetTotalPipeCapacity(teleSetupId int64) (totalPipeCapacityList []TotalPipeCapacity, err error)

Get total pipe capacity

func NewTotalPipeCapacity

func NewTotalPipeCapacity(pipes []messages.TotalPipeCapacity) (pipeList []TotalPipeCapacity)

New total pipe capacity

type Traffic

type Traffic struct {
	TrafficId       int64
	Unit            messages.UnitString
	LowPercentileG  messages.Uint64String
	MidPercentileG  messages.Uint64String
	HighPercentileG messages.Uint64String
	PeakG           messages.Uint64String
	CurrentG        messages.Uint64String
}

func GetModelsTraffic

func GetModelsTraffic(traffics []Traffic) (trafficList []Traffic)

Get traffic with type is Traffic

func GetTelemetryTraffic

func GetTelemetryTraffic(engine *xorm.Engine, prefixType string, prefixTypeId int64, trafficType string) (trafficList []Traffic, err error)

Get telemetry traffic

func GetTraffic

func GetTraffic(engine *xorm.Engine, tType string, typeId int64, prefixType string, trafficType string) (trafficList []Traffic, err error)

Get traffic

func GetUriFilteringTraffic

func GetUriFilteringTraffic(engine *xorm.Engine, prefixType string, preMitigationId int64, trafficType string) (trafficList []Traffic, err error)

Get uri filtering traffic

func NewTelemetryTotalAttackTraffic

func NewTelemetryTotalAttackTraffic(teleTraffics []messages.Traffic) (trafficList []Traffic)

New telemetry total-attack-traffic

func NewTraffic

func NewTraffic(traffics []messages.Traffic) (trafficList []Traffic)

New traffic

type TrafficPerPort

type TrafficPerPort struct {
	TrafficId       int64
	Unit            messages.UnitString
	Port            int
	LowPercentileG  messages.Uint64String
	MidPercentileG  messages.Uint64String
	HighPercentileG messages.Uint64String
	PeakG           messages.Uint64String
	CurrentG        messages.Uint64String
}

func GetTrafficPerPort

func GetTrafficPerPort(engine *xorm.Engine, tType string, typeId int64, trafficType string) (trafficList []TrafficPerPort, err error)

Get traffic per port

func GetUriFilteringTrafficPerPort

func GetUriFilteringTrafficPerPort(engine *xorm.Engine, preMitigationId int64, trafficType string) (trafficList []TrafficPerPort, err error)

Get uri filtering traffic per port

func NewTrafficPerPort

func NewTrafficPerPort(traffics []messages.TrafficPerPort) (trafficList []TrafficPerPort)

New traffic per port

type TrafficPerProtocol

type TrafficPerProtocol struct {
	TrafficId       int64
	Unit            messages.UnitString
	Protocol        int
	LowPercentileG  messages.Uint64String
	MidPercentileG  messages.Uint64String
	HighPercentileG messages.Uint64String
	PeakG           messages.Uint64String
	CurrentG        messages.Uint64String
}

func GetTrafficPerProtocol

func GetTrafficPerProtocol(engine *xorm.Engine, tType string, typeId int64, trafficType string) (trafficList []TrafficPerProtocol, err error)

Get traffic per protocol

func GetUriFilteringTrafficPerProtocol

func GetUriFilteringTrafficPerProtocol(engine *xorm.Engine, preMitigationId int64, trafficType string) (trafficList []TrafficPerProtocol, err error)

Get uri filtering traffic per protocol

func NewTrafficPerProtocol

func NewTrafficPerProtocol(traffics []messages.TrafficPerProtocol) (trafficList []TrafficPerProtocol)

New traffic per protocol

type UnitConfig

type UnitConfig struct {
	Unit       messages.UnitString
	UnitStatus bool
}

type UriFilteringTelemetryPreMitigation

type UriFilteringTelemetryPreMitigation struct {
	Cuid       string
	Cdid       string
	Tmid       int
	TargetList []Target
}

func GetUriFilteringPreMitigationList

func GetUriFilteringPreMitigationList(engine *xorm.Engine, customerId int, cuid string) ([]UriFilteringTelemetryPreMitigation, error)

Get uri filtering pre-mitigation list

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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