Skip to content

Commit 899be13

Browse files
committed
Add RuleLicense to JSON output
1 parent 272624a commit 899be13

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/bincapz/report.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type Behavior struct {
2727
RiskScore int
2828
RiskLevel string
2929
RuleAuthor string
30+
RuleLicense string
3031
}
3132

3233
type FileReport struct {
@@ -209,6 +210,7 @@ func fileReport(mrs yara.MatchRules, ignoreTags []string, minLevel int) FileRepo
209210
syscalls := []string{}
210211
desc := ""
211212
author := ""
213+
license := ""
212214

213215
for _, m := range mrs {
214216
risk := behaviorRisk(m.Namespace, m.Tags)
@@ -229,6 +231,12 @@ func fileReport(mrs yara.MatchRules, ignoreTags []string, minLevel int) FileRepo
229231
b.RuleAuthor = author
230232
}
231233

234+
case "license", "license_url":
235+
license = fmt.Sprintf("%s", meta.Value)
236+
if len(license) > len(b.RuleLicense) {
237+
b.RuleLicense = license
238+
}
239+
232240
case "description", "threat_name", "name":
233241
desc = fmt.Sprintf("%s", meta.Value)
234242
if len(desc) > len(b.Description) {

0 commit comments

Comments
 (0)