Path: blob/dev/pkg/catalog/config/ignorefile.go
2070 views
package config12import (3"os"4"runtime/debug"56"github.com/projectdiscovery/gologger"7"gopkg.in/yaml.v2"8)910// IgnoreFile is an internal nuclei template blocking configuration file11type IgnoreFile struct {12Tags []string `yaml:"tags"`13Files []string `yaml:"files"`14}1516// ReadIgnoreFile reads the nuclei ignore file returning blocked tags and paths17func ReadIgnoreFile() IgnoreFile {18file, err := os.Open(DefaultConfig.GetIgnoreFilePath())19if err != nil {20gologger.Error().Msgf("Could not read nuclei-ignore file: %s\n%s\n", err, string(debug.Stack()))21return IgnoreFile{}22}23defer func() {24_ = file.Close()25}()2627ignore := IgnoreFile{}28if err := yaml.NewDecoder(file).Decode(&ignore); err != nil {29gologger.Error().Msgf("Could not parse nuclei-ignore file: %s\n", err)30return IgnoreFile{}31}32return ignore33}343536