diff --git a/cli/reporter/print_compact.go b/cli/reporter/print_compact.go index 31f8d033..25248732 100644 --- a/cli/reporter/print_compact.go +++ b/cli/reporter/print_compact.go @@ -373,20 +373,22 @@ func (r *defaultReporter) printAssetQueries(resolved *policy.ResolvedPolicy, rep r.out.Write([]byte(NewLineCharacter)) } - r.out.Write([]byte("Controls:" + NewLineCharacter)) - for id, score := range report.Scores { - _, ok := resolved.CollectorJob.ReportingQueries[id] - if !ok { - continue - } + if len(report.Scores) > 0 { + r.out.Write([]byte("Controls:" + NewLineCharacter)) + for id, score := range report.Scores { + _, ok := resolved.CollectorJob.ReportingQueries[id] + if !ok { + continue + } - query, ok := queries[id] - if !ok { - r.out.Write([]byte("Couldn't find any queries for incoming value for " + id)) - continue - } + query, ok := queries[id] + if !ok { + r.out.Write([]byte("Couldn't find any queries for incoming value for " + id)) + continue + } - r.printControl(score, query, asset, resolved, report, results) + r.printControl(score, query, asset, resolved, report, results) + } } } diff --git a/policy/scan/local_scanner.go b/policy/scan/local_scanner.go index b4c53344..2362ed83 100644 --- a/policy/scan/local_scanner.go +++ b/policy/scan/local_scanner.go @@ -595,7 +595,11 @@ func (s *localAssetScanner) run() (*AssetReport, error) { return ar, err } s.ProgressReporter.Score(report.Score.Rating().Letter()) - s.ProgressReporter.Completed() + if report.Score.Rating().Letter() == "U" { + s.ProgressReporter.NotApplicable() + } else { + s.ProgressReporter.Completed() + } log.Debug().Str("asset", s.job.Asset.Mrn).Msg("scan complete") ar.Report = report