Documentation ¶
Index ¶
- Variables
- func Atof(params ...any) (any, error)
- func B64Decode(params ...any) (any, error)
- func CrowdsecCTI(params ...any) (any, error)
- func CrowdsecCTIInitCache(size int, ttl time.Duration)
- func Distance(params ...any) (any, error)
- func Fields(params ...any) (any, error)
- func File(params ...any) (any, error)
- func FileInit(fileFolder string, filename string, fileType string) error
- func Get(params ...any) (any, error)
- func GetDecisionsCount(params ...any) (any, error)
- func GetDecisionsSinceCount(params ...any) (any, error)
- func GetExprOptions(ctx map[string]interface{}) []expr.Option
- func GetFromStash(params ...any) (any, error)
- func Hostname(params ...any) (any, error)
- func Index(params ...any) (any, error)
- func IndexAny(params ...any) (any, error)
- func Init(databaseClient *database.Client) error
- func InitCrowdsecCTI(Key *string, TTL *time.Duration, Size *int, LogLevel *log.Level) error
- func IpInRange(params ...any) (any, error)
- func IpToRange(params ...any) (any, error)
- func IsIP(params ...any) (any, error)
- func IsIPV4(params ...any) (any, error)
- func IsIPV6(params ...any) (any, error)
- func Join(params ...any) (any, error)
- func JsonExtract(params ...any) (any, error)
- func JsonExtractLib(params ...any) (any, error)
- func JsonExtractObject(params ...any) (any, error)
- func JsonExtractSlice(params ...any) (any, error)
- func JsonExtractUnescape(params ...any) (any, error)
- func KeyExists(params ...any) (any, error)
- func LogInfo(params ...any) (any, error)
- func LookupHost(params ...any) (any, error)
- func Lower(params ...any) (any, error)
- func Match(params ...any) (any, error)
- func ParseKV(params ...any) (any, error)
- func ParseUnix(params ...any) (any, error)
- func ParseUnixTime(params ...any) (any, error)
- func ParseUri(params ...any) (any, error)
- func PathEscape(params ...any) (any, error)
- func PathUnescape(params ...any) (any, error)
- func QueryEscape(params ...any) (any, error)
- func QueryUnescape(params ...any) (any, error)
- func RegexpCacheInit(filename string, CacheCfg types.DataSource) error
- func RegexpInFile(params ...any) (any, error)
- func Replace(params ...any) (any, error)
- func ReplaceAll(params ...any) (any, error)
- func SetInStash(params ...any) (any, error)
- func ShutdownCrowdsecCTI()
- func Split(params ...any) (any, error)
- func SplitAfter(params ...any) (any, error)
- func SplitAfterN(params ...any) (any, error)
- func SplitN(params ...any) (any, error)
- func Sprintf(params ...any) (any, error)
- func TimeNow(params ...any) (any, error)
- func ToJson(params ...any) (any, error)
- func ToString(params ...any) (any, error)
- func Trim(params ...any) (any, error)
- func TrimLeft(params ...any) (any, error)
- func TrimPrefix(params ...any) (any, error)
- func TrimRight(params ...any) (any, error)
- func TrimSpace(params ...any) (any, error)
- func TrimSuffix(params ...any) (any, error)
- func UnmarshalJSON(params ...any) (any, error)
- func UpdateRegexpCacheMetrics()
- func Upper(params ...any) (any, error)
- func XMLGetAttributeValue(params ...any) (any, error)
- func XMLGetNodeValue(params ...any) (any, error)
- type ExprDebugger
Constants ¶
This section is empty.
Variables ¶
var CTIApiEnabled = true
this is set for non-recoverable errors, such as 403 when querying API or empty API key
var CTIApiKey = ""
var CTIBackOffDuration time.Duration = 5 * time.Minute
var CTIBackOffUntil time.Time
when hitting quotas or auth errors, we temporarily disable the API
var CTICache gcache.Cache
Cache for responses
var CTIUrl = "https://cti.api.crowdsec.net"
var CTIUrlSuffix = "/v2/smoke/"
var CacheExpiration time.Duration
var RegexpCacheMetrics = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "cs_regexp_cache_size", Help: "Entries per regexp cache.", }, []string{"name"}, )
prometheus
Functions ¶
func CrowdsecCTI ¶
func CrowdsecCTI(ip string) (*cticlient.SmokeItem, error) {
func CrowdsecCTIInitCache ¶
func Distance ¶
func Distance(lat1 string, long1 string, lat2 string, long2 string) (float64, error) {
func GetDecisionsCount ¶
func GetDecisionsCount(value string) int {
func GetDecisionsSinceCount ¶
func GetDecisionsSinceCount(value string, since string) int {
func GetExprOptions ¶
func GetFromStash ¶
func GetFromStash(cacheName string, key string) (string, error) {
func InitCrowdsecCTI ¶
func JsonExtract ¶
func JsonExtract(jsblob string, target string) string {
func JsonExtractLib ¶
func JsonExtractLib(jsblob string, target ...string) string {
func JsonExtractObject ¶
func JsonExtractObject(jsblob string, target string) map[string]interface{} {
func JsonExtractSlice ¶
func JsonExtractSlice(jsblob string, target string) []interface{} {
func JsonExtractUnescape ¶
func JsonExtractUnescape(jsblob string, target ...string) string {
func LookupHost ¶
func LookupHost(value string) []string {
func ParseUnixTime ¶
func ParseUnixTime(value string) (time.Time, error) {
func PathUnescape ¶
func PathUnescape(s string) string {
func QueryUnescape ¶
func QueryUnescape(s string) string {
func RegexpCacheInit ¶
func RegexpCacheInit(filename string, CacheCfg types.DataSource) error
func RegexpInFile ¶
func RegexpInFile(data string, filename string) bool {
func ReplaceAll ¶
func SetInStash ¶
func SetInStash(cacheName string, key string, value string, expiration *time.Duration) any {
func ShutdownCrowdsecCTI ¶
func ShutdownCrowdsecCTI()
func SplitAfter ¶
func SplitAfterN ¶
func TrimPrefix ¶
func TrimSuffix ¶
func UnmarshalJSON ¶
Func UnmarshalJSON(jsonBlob []byte, target interface{}) error {
func UpdateRegexpCacheMetrics ¶
func UpdateRegexpCacheMetrics()
UpdateCacheMetrics is called directly by the prom handler
func XMLGetAttributeValue ¶
func XMLGetAttributeValue(xmlString string, path string, attributeName string) string {
func XMLGetNodeValue ¶
func XMLGetNodeValue(xmlString string, path string) string {
Types ¶
type ExprDebugger ¶
type ExprDebugger struct {
// contains filtered or unexported fields
}
ExprDebugger contains the list of expression to be run when debugging an expression filter
func NewDebugger ¶
func NewDebugger(filter string, exprEnv ...expr.Option) (*ExprDebugger, error)
NewDebugger is the exported function that build the debuggers expressions