MCPcopy
hub / github.com/crowdsecurity/crowdsec / Load

Method Load

pkg/appsec/appsec.go:568–583  ·  view source on GitHub ↗
(configName string, hub *cwhub.Hub)

Source from the content-addressed store, hash-verified

566}
567
568func (wc *AppsecConfig) Load(configName string, hub *cwhub.Hub) error {
569 item := hub.GetItem(cwhub.APPSEC_CONFIGS, configName)
570
571 if item != nil && item.State.IsInstalled() {
572 wc.Logger.Infof("loading %s", item.State.LocalPath)
573
574 err := wc.LoadByPath(item.State.LocalPath)
575 if err != nil {
576 return fmt.Errorf("unable to load appsec-config %s : %s", item.State.LocalPath, err)
577 }
578
579 return nil
580 }
581
582 return fmt.Errorf("no appsec-config found for %s", configName)
583}
584
585func (wc *AppsecConfig) Build(ctx context.Context, hub *cwhub.Hub) (*AppsecRuntimeConfig, error) {
586 ret := &AppsecRuntimeConfig{Logger: wc.Logger.WithField("component", "appsec_runtime_config")}

Callers 3

ConfigureMethod · 0.95
getAlertContextFunction · 0.45
TestLiveAcquisitionFunction · 0.45

Calls 3

LoadByPathMethod · 0.95
GetItemMethod · 0.80
IsInstalledMethod · 0.80

Tested by 1

TestLiveAcquisitionFunction · 0.36