rule

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

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

func DeleteCustomRule(c api.Client, id int) error

Delete an existing custom rule.

func GenerateCustomRuleId

func GenerateCustomRuleId(c api.Client) (int, error)

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.

Jump to

Keyboard shortcuts

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