Skip to content

Commit d1f27b1

Browse files
committed
fix missing pledges syscalls and caps
1 parent 5026133 commit d1f27b1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pkg/report/report.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func Generate(ctx context.Context, path string, mrs *yarax.ScanResults, c malcon
449449

450450
b := buildBehavior(m, matchedStrings, key, ruleURL, risk)
451451

452-
handleMetadata(m, b, fr, override, mrsMap, pledges, caps, syscalls)
452+
handleMetadata(m, b, fr, override, mrsMap, &pledges, &caps, &syscalls)
453453

454454
// Fix YARA Forge rules that record their author URL as reference URLs
455455
if strings.HasPrefix(b.RuleURL, b.ReferenceURL) {
@@ -588,7 +588,7 @@ func buildBehavior(m *yarax.Rule, matchedStrings []string, key string, ruleURL s
588588
}
589589
}
590590

591-
func handleMetadata(m *yarax.Rule, b *malcontent.Behavior, fr *malcontent.FileReport, override bool, mrsMap map[string]*yarax.Rule, pledges []string, caps []string, syscalls []string) {
591+
func handleMetadata(m *yarax.Rule, b *malcontent.Behavior, fr *malcontent.FileReport, override bool, mrsMap map[string]*yarax.Rule, pledges *[]string, caps *[]string, syscalls *[]string) {
592592
k := ""
593593
v := ""
594594

@@ -655,12 +655,12 @@ func handleMetadata(m *yarax.Rule, b *malcontent.Behavior, fr *malcontent.FileRe
655655
// YARAforge forgets to encode spaces
656656
b.RuleURL = fixURL(v)
657657
case "pledge":
658-
pledges = append(pledges, v)
658+
*pledges = append(*pledges, v)
659659
case "syscall":
660660
sy := strings.Split(v, ",")
661-
syscalls = append(syscalls, sy...)
661+
*syscalls = append(*syscalls, sy...)
662662
case "cap":
663-
caps = append(caps, v)
663+
*caps = append(*caps, v)
664664
}
665665
}
666666
}

0 commit comments

Comments
 (0)