Path: blob/dev/pkg/catalog/config/ignorefile.go
2861 views
package config12import (3"os"45"github.com/projectdiscovery/gologger"6"gopkg.in/yaml.v2"7)89// IgnoreFile is an internal nuclei template blocking configuration file10type IgnoreFile struct {11Tags []string `yaml:"tags"`12Files []string `yaml:"files"`13}1415// ReadIgnoreFile reads the nuclei ignore file returning blocked tags and paths16func ReadIgnoreFile() IgnoreFile {17file, err := os.Open(DefaultConfig.GetIgnoreFilePath())18if err != nil {19gologger.Error().Msgf("Could not read nuclei-ignore file: %s\n", err)20return IgnoreFile{}21}22defer func() {23_ = file.Close()24}()2526ignore := IgnoreFile{}27if err := yaml.NewDecoder(file).Decode(&ignore); err != nil {28gologger.Error().Msgf("Could not parse nuclei-ignore file: %s\n", err)29return IgnoreFile{}30}31return ignore32}333435