LoadProtonRules loads embedded proton YAML templates. The data is a YAML array of template objects produced by recuLoadPoc.
()
| 151 | // LoadProtonRules loads embedded proton YAML templates. |
| 152 | // The data is a YAML array of template objects produced by recuLoadPoc. |
| 153 | func LoadProtonRules() error { |
| 154 | rulesData := LoadConfig("proton_rules") |
| 155 | if len(rulesData) == 0 { |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | var templates []interface{} |
| 160 | if err := yaml.Unmarshal(rulesData, &templates); err != nil { |
| 161 | return err |
| 162 | } |
| 163 | |
| 164 | docs := make([][]byte, 0, len(templates)) |
| 165 | for _, tmpl := range templates { |
| 166 | doc, err := yaml.Marshal(tmpl) |
| 167 | if err != nil { |
| 168 | continue |
| 169 | } |
| 170 | docs = append(docs, doc) |
| 171 | } |
| 172 | return LoadProtonTemplates(docs) |
| 173 | } |
| 174 | |
| 175 | // LoadFoundKeys loads embedded found/keys templates (credential detection). |
| 176 | func LoadFoundKeys() error { |
no test coverage detected