Documentation ¶
Index ¶
- func AddActiveACLRequest(id int64, clientID int64, name string, validThrough time.Time)
- func AddActiveAliasRequest(id int64, clientID int64, name string, validThrough time.Time)
- func CallBlocker(acls []ACL, customerID int) (err error)
- func CancelBlocker(aclID int64, activationType types.ActivationType) (err error)
- func CheckActiveDataChannelACL(customer *models.Customer, cuid string) (bool, error)
- func CheckExistDotsClient(tx *db.Tx, cuid string) (bool, error)
- func DeleteACLByName(tx *db.Tx, clientID int64, name string, now time.Time) (bool, error)
- func DeleteAliasByName(tx *db.Tx, clientID int64, name string, now time.Time) (bool, error)
- func DeleteClientByCuid(tx *db.Tx, customer *models.Customer, cuid string) (bool, error)
- func FindACLByID(id int64) (data_db_models.ACL, error)
- func FindAllACLs() (acls []data_db_models.ACL, err error)
- func FindAllAliases() (aliases []data_db_models.Alias, err error)
- func FindClientByID(id int64) (data_db_models.Client, error)
- func FindCuidsByCustomerId(tx *db.Tx, customer *models.Customer) (cuids []string, err error)
- func GetActiveACLMap() map[int64]ActiveACLRequest
- func GetActiveAliasMap() map[int64]ActiveAliasRequest
- func GetDataChannelAclAcceptList(customer *models.Customer, cuid string) ([]string, error)
- func GetMaxPriority(engine *xorm.Engine) (maxPriority int, err error)
- func IsActive(customerId int, cuid string, activationType types.ActivationType) (bool, error)
- func ManageExpiredAliasAndAcl(lifetimeInterval int)
- func RemoveActiveACLRequest(id int64)
- func RemoveActiveAliasRequest(id int64)
- func RemoveOverlapIPPrefix(targetPrefix []types.IPPrefix) []types.IPPrefix
- func ToActivationType(activationType int) types.ActivationType
- func UpdatePriorityAcl(session *xorm.Session, lenNewAcl int, pointPriority int) (err error)
- type ACL
- type ACLs
- type APPair
- type ActiveACLRequest
- type ActiveAliasRequest
- type Alias
- func (a *Alias) GetFqdnAsTarget() (targetList []models.Target, err error)
- func (a *Alias) GetPrefixAsTarget() (targetList []models.Target, err error)
- func (a *Alias) GetUriAsTarget() (targetList []models.Target, err error)
- func (alias *Alias) Save(tx *db.Tx) error
- func (alias *Alias) ToTypesAlias(now time.Time) (*types.Alias, error)
- type Aliases
- type AttackMapping
- type Client
- type Vendor
- type Vendors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddActiveACLRequest ¶
* Add active Acl
func AddActiveAliasRequest ¶
* Add active Alias
func CallBlocker ¶
* Call blocker (GoBGP or Arista)
func CancelBlocker ¶
func CancelBlocker(aclID int64, activationType types.ActivationType) (err error)
* Cancel blocker when update or delete data channel acl
func CheckActiveDataChannelACL ¶
* Check active data channel acl * If data channel acl is active, the server will return true * Else the server will return false
func DeleteACLByName ¶
func DeleteAliasByName ¶
func DeleteClientByCuid ¶
func FindACLByID ¶
* Find acl by id * * parameter: * id the id of data_client * return: * acl the data_acl
func FindAllAliases ¶
func FindAllAliases() (aliases []data_db_models.Alias, err error)
* Find all Alias in DB
func FindClientByID ¶
* Find client by id * * parameter: * id the id of data_client * return: * client the data_client
func FindCuidsByCustomerId ¶
* Find all cuids by customerId. * * parameter: * customerId the id of the Customer * return: * cuids the list of cuid * error the error
func GetDataChannelAclAcceptList ¶
* Get data channel acl accept list * return * List data channel acl with action is accept
func GetMaxPriority ¶
Get priority is max value
func IsActive ¶
* Return activation status that is active or inactive * * return: * bool * true status is active * false status is inactive
func ManageExpiredAliasAndAcl ¶
func ManageExpiredAliasAndAcl(lifetimeInterval int)
* Management expired Alias and Acl
func RemoveOverlapIPPrefix ¶
Remove overlap IPPrefix
func ToActivationType ¶
func ToActivationType(activationType int) types.ActivationType
* Parse int activation type to ACL activation type * * return: * acl activation type
Types ¶
type ACL ¶
func FindACLByName ¶
type APPair ¶
type APPair struct { Acl ACL Protection models.Protection }
type ActiveACLRequest ¶
* Struct for Active Acl Request.
type ActiveAliasRequest ¶
* Struct for Active Alias Request.
type Alias ¶
func FindAliasByName ¶
func (*Alias) GetFqdnAsTarget ¶
* Get mitigation FQDNs as target type * * return: * targetList list of the target FQDNs * err error
func (*Alias) GetPrefixAsTarget ¶
* Get alias prefixes as target type * * return: * targetList list of the target Prefixes
func (*Alias) GetUriAsTarget ¶
* Get mitigation URIs as target type * * return: * targetList list of the target URIs * err error
type AttackMapping ¶
type Client ¶
func FindClientByCuid ¶
type Vendor ¶
type Vendor struct { Id int64 ClientId int64 VendorId int VendorName string DescriptionLang string LastUpdated uint64 AttackMapping []AttackMapping }
func FindVendorByVendorId ¶
Find vendor-mapping by vendor-id
func NewVendorMapping ¶
New vendor-mapping
type Vendors ¶
type Vendors []Vendor
func FindVendorMappingByClientId ¶
Find vendor-mapping by client-id
func (Vendors) ToTypesVendorMapping ¶
func (vendors Vendors) ToTypesVendorMapping(depth *int) *types.VendorMapping
Convert vendor-mapping to types vendor-mapping