LoadFoundKeys loads embedded found/keys templates (credential detection).
()
| 174 | |
| 175 | // LoadFoundKeys loads embedded found/keys templates (credential detection). |
| 176 | func LoadFoundKeys() error { |
| 177 | keysData := LoadConfig("found_keys") |
| 178 | if len(keysData) == 0 { |
| 179 | return nil |
| 180 | } |
| 181 | |
| 182 | var templates []interface{} |
| 183 | if err := yaml.Unmarshal(keysData, &templates); err != nil { |
| 184 | return err |
| 185 | } |
| 186 | |
| 187 | docs := make([][]byte, 0, len(templates)) |
| 188 | for _, tmpl := range templates { |
| 189 | doc, err := yaml.Marshal(tmpl) |
| 190 | if err != nil { |
| 191 | continue |
| 192 | } |
| 193 | docs = append(docs, doc) |
| 194 | } |
| 195 | return AppendProtonTemplates(docs) |
| 196 | } |
| 197 | |
| 198 | func LoadExtractorConfig(filename string) ([]*parsers.Extractor, error) { |
| 199 | var extracts []*parsers.Extractor |