added taxonomies when not found and templates

This commit is contained in:
Davide Arcuri 2020-03-30 09:18:08 +02:00
parent 964a59ad0e
commit f0737d0e6d
3 changed files with 54 additions and 3 deletions

View File

@ -20,9 +20,11 @@ class GRRAnalyzer(Analyzer):
namespace = 'GRR'
predicate = 'Client id'
for client_id in raw['results']:
taxonomies.append(self.build_taxonomy(level, namespace, predicate, client_id))
if len(raw['results']) > 0:
for client_id in raw['results']:
taxonomies.append(self.build_taxonomy(level, namespace, predicate, client_id))
else:
taxonomies.append(self.build_taxonomy(level, namespace, predicate, "NotFound"))
return {"taxonomies": taxonomies}
def run(self):

View File

@ -0,0 +1,46 @@
<div class="panel panel-info" ng-if="success && content.results.length > 0">
<div class="panel-heading">
GRR search results for
<strong>{{artifact.data | fang}}</strong>
</div>
<div class="panel-body">
<div>
<dl class="dl-horizontal">
<dt>GRR uids:</dt>
<dd class="wrap">
<ul>
<li ng-repeat="list in content.results">
{{list}}
</li>
</ul>
</dd>
</dl>
</div>
</div>
</div>
<!-- No results -->
<div class="panel panel-danger" ng-if="success && content.results.length == 0">
<div class="panel-heading">
GRR search results for
<strong>{{artifact.data | fang}}</strong>
</div>
<div class="panel-body">
<p>No results</p>
</div>
</div>
<!-- General error -->
<div class="panel panel-danger" ng-if="!success">
<div class="panel-heading">
<strong>{{artifact.data | fang}}</strong>
</div>
<div class="panel-body">
<dl class="dl-horizontal" ng-if="content.errorMessage">
<dt>
<i class="fa fa-warning"></i> GRR:
</dt>
<dd class="wrap">{{content.errorMessage}}</dd>
</dl>
</div>
</div>

View File

@ -0,0 +1,3 @@
<span class="label" ng-repeat="t in content.taxonomies" ng-class="{'info': 'label-info', 'safe': 'label-success', 'suspicious': 'label-warning', 'malicious':'label-danger'}[t.level]">
{{t.namespace}}:{{t.predicate}}="{{t.value}}"
</span>