From 6ac0a9ef9da2eb7ba3155ffb8279d8752741cd62 Mon Sep 17 00:00:00 2001 From: Sebastien Blot Date: Fri, 5 May 2023 13:49:58 +0200 Subject: [PATCH] wip --- cmd/crowdsec-cli/utils.go | 2 ++ pkg/cwhub/loader.go | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/crowdsec-cli/utils.go b/cmd/crowdsec-cli/utils.go index cc6d7a431..81e9db7d4 100644 --- a/cmd/crowdsec-cli/utils.go +++ b/cmd/crowdsec-cli/utils.go @@ -332,6 +332,8 @@ func ShowMetrics(hubItem *cwhub.Item) { } ShowMetrics(hubItem) } + case cwhub.WAF_RULES: + log.Fatalf("FIXME: not implemented yet") default: log.Errorf("item of type '%s' is unknown", hubItem.Type) } diff --git a/pkg/cwhub/loader.go b/pkg/cwhub/loader.go index 52b90ecae..961e9a02e 100644 --- a/pkg/cwhub/loader.go +++ b/pkg/cwhub/loader.go @@ -90,8 +90,11 @@ func parser_visit(path string, f os.DirEntry, err error) error { } else if stage == COLLECTIONS { ftype = COLLECTIONS stage = "" + } else if stage == WAF_RULES { + ftype = WAF_RULES + stage = "" } else if ftype != PARSERS && ftype != PARSERS_OVFLW /*its a PARSER / PARSER_OVFLW with a stage */ { - return fmt.Errorf("unknown configuration type for file '%s'", path) + return fmt.Errorf("unknown configuration type %s for file '%s'", ftype, path) } log.Tracef("CORRECTED [%s] by [%s] in stage [%s] of type [%s]", fname, fauthor, stage, ftype)