|
@@ -19,6 +19,7 @@ import (
|
|
"time"
|
|
"time"
|
|
|
|
|
|
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
|
|
"github.com/crowdsecurity/crowdsec/pkg/cwversion"
|
|
|
|
+ "github.com/crowdsecurity/crowdsec/pkg/exprhelpers"
|
|
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
|
|
@@ -42,6 +43,7 @@ func LoadStages(stageFiles []Stagefile, pctx *UnixParserCtx) ([]Node, error) {
|
|
tmpstages := make(map[string]bool)
|
|
tmpstages := make(map[string]bool)
|
|
pctx.Stages = []string{}
|
|
pctx.Stages = []string{}
|
|
|
|
|
|
|
|
+ exprhelpers.Init()
|
|
for _, stageFile := range stageFiles {
|
|
for _, stageFile := range stageFiles {
|
|
if !strings.HasSuffix(stageFile.Filename, ".yaml") {
|
|
if !strings.HasSuffix(stageFile.Filename, ".yaml") {
|
|
log.Warningf("skip non yaml : %s", stageFile.Filename)
|
|
log.Warningf("skip non yaml : %s", stageFile.Filename)
|
|
@@ -109,6 +111,12 @@ func LoadStages(stageFiles []Stagefile, pctx *UnixParserCtx) ([]Node, error) {
|
|
if node.Stage == "" {
|
|
if node.Stage == "" {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if len(node.Data) > 0 {
|
|
|
|
+ for _, data := range node.Data {
|
|
|
|
+ err = exprhelpers.FileInit(pctx.DataFolder, data.DestPath)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
nodes = append(nodes, node)
|
|
nodes = append(nodes, node)
|
|
nodesCount++
|
|
nodesCount++
|
|
}
|
|
}
|