Skip to content
This repository was archived by the owner on Mar 29, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions minion/frontend/static/js/minion-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,17 @@ app.controller("RawController", function ($scope, $routeParams, $http, $location
});

app.controller("ScanController", function($scope, $routeParams, $http, $location) {

$scope.getArtifact = function(scanId, artifactName) {
window.open('/api/scan/' + scanId + '/artifact/' + artifactName, '_blank', '');
}

$scope.$on('$viewContentLoaded', function() {
$http.get('/api/scan/' + $routeParams.scanId).success(function(response) {
if (response.success) {
var scan = response.data;
var issues = [];
var artifacts = [];
$scope.timenow = Math.round(+new Date()/1000);
var issueCounts = {high: 0, medium: 0, low: 0, info: 0, error: 0};
_.each(scan.sessions, function (session) {
Expand All @@ -546,6 +552,10 @@ app.controller("ScanController", function($scope, $routeParams, $http, $location
break;
}
});
_.each(session.artifacts, function (artifact) {
artifact.session = session;
artifacts.push(artifact);
});
});
} else {
$location.path('/404');
Expand All @@ -561,6 +571,7 @@ app.controller("ScanController", function($scope, $routeParams, $http, $location
$scope.scan = scan;
$scope.issues = issues;
$scope.issueCounts = issueCounts;
$scope.artifacts = artifacts
$scope.failures = failures;
});
});
Expand Down
25 changes: 25 additions & 0 deletions minion/frontend/static/partials/scan.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,31 @@ <h3>Workflow</h3>
</tr>
</table>

<div ng-show="artifacts.length > 0">

<h3>Artifacts</h3>

<table class="table table-bordered">
<thead>
<tr>
<th>Plugin</th>
<th>Artifact name</th>
<th>Links</th>
</tr>
</thead>
<tr ng-repeat="artifact in artifacts">
<td>{{artifact.session.plugin.name}} (v{{artifact.session.plugin.version}})</td>
<td>{{artifact.name}}</td>
<td>
<div ng-repeat="path in artifact.paths">
<a ng-click="getArtifact(scan.id,path)">{{path}}</a>
</div>
</td>
</tr>
</table>

</div>

<div ng-show="failures.length > 0">

<h3>Failures</h3>
Expand Down
6 changes: 6 additions & 0 deletions minion/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,12 @@ def api_scan_issue(minion_scan_id, minion_issue_id):
else:
return jsonify(success=False, reason=r.json()['reason'])

@app.route("/api/scan/<minion_scan_id>/artifact/<minion_artifact_name>")
@requires_session
def api_scan_artifact(minion_scan_id, minion_artifact_name):
r = requests.get(config['backend-api']['url'] + "/scans/" + minion_scan_id + "/artifact/" + minion_artifact_name)
return Response(response=r, mimetype=r.headers['content-type'])

@app.route("/api/scan/<minion_scan_id>")
@requires_session
def api_scan(minion_scan_id):
Expand Down