Documentation
¶
Index ¶
Constants ¶
View Source
const CustomRulesEndpoint = "api/v1/custom-rules"
Variables ¶
This section is empty.
Functions ¶
func CreateCustomRule ¶
func CreateCustomRule(c api.Client, rule CustomRule) (int, error)
Create a new custom rule.
func DeleteCustomRule ¶
Delete an existing custom rule.
func GenerateCustomRuleId ¶
Helper method to generate an ID for new custom rule. Finds the maximum custom rule ID and increments it by 1.
func UpdateCustomRule ¶
func UpdateCustomRule(c api.Client, rule CustomRule) error
Update an existing custom rule.
Types ¶
type CustomRule ¶
type CustomRule struct { Id int `json:"_id,omitempty"` AttackTechniques []string `json:"attackTechniques,omitempty"` Description string `json:"description,omitempty"` Message string `json:"message,omitempty"` MinVersion string `json:"minVersion,omitempty"` Name string `json:"name,omitempty"` Script string `json:"script,omitempty"` Type string `json:"type,omitempty"` VulnIDs []string `json:"vulnIds,omitempty"` }
func GetCustomRuleById ¶
func GetCustomRuleById(c api.Client, id int) (*CustomRule, error)
Get a specific custom rule by ID.
func GetCustomRuleByName ¶
func GetCustomRuleByName(c api.Client, name string) (*CustomRule, error)
Get a specific custom rule by name.
func ListCustomRules ¶
func ListCustomRules(c api.Client) ([]CustomRule, error)
Get all custom rules.
Click to show internal directories.
Click to hide internal directories.