Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
categorize attackers, closes #59
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffbryner committed Aug 4, 2014
1 parent 2e7b7e6 commit 99444d6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
9 changes: 2 additions & 7 deletions meteor/app/client/alertsummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,13 @@ if (Meteor.isClient) {
Meteor.subscribe("alerts-summary", onReady=function(){
refreshAlertsData();
});
cnt=alertsCount.findOne();
var cnt=alertsCount.findOne();
$('#alertsearchtext').val(Session.get('alertsearchtext'));
if ( cnt ){
//debugLog('cnt exists alertsCount changed..updating text.')
$('#totalAlerts').text(cnt.count);
}
Deps.onInvalidate(function () {
//debugLog('alertsCount changed..refreshing alerts data.')
refreshAlertsData();
});


}
}); //end deps.autorun
};

Expand Down
10 changes: 9 additions & 1 deletion meteor/app/client/attackerdetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@
<td>{{dateCreated}}</td>
<td>{{eventscount}}</td>
<td>{{alertscount}}</td>
<td>{{category}}</td>
<td>
<select id="attackerCategory" name="category" class="input-medium" title="category of this attacker">
<option {{ isselected 'unknown' category }} value='unknown'>Unknown</option>
<option {{ isselected 'skiddie' category }} value='skiddie'>Script Kiddie</option>
<option {{ isselected 'bruteforcer' category }} value='bruteforcer'>Brute Forcer</option>
<option {{ isselected 'bountyhunter' category }} value='bountyhunter'>Bounty Hunter</option>
<option {{ isselected 'APT' category }} value='apt'>APT</option>
</select>
</td>
<td>{{summary}}</td>
</tr>
</tbody>
Expand Down
6 changes: 6 additions & 0 deletions meteor/app/client/attackerdetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Jeff Bryner jbryner@mozilla.com

if (Meteor.isClient) {

Template.attackerdetails.events({
"change #attackerCategory": function(e,t){
attackers.update(Session.get('attackerID'), {$set: {'category':$('#attackerCategory').val()}});
}
});

//details helpers
Template.attackerdetails.thisalert = function (mongoalertid) {
//attackers store a ref mongo id to alerts attacker.alerts.alertid
Expand Down
4 changes: 2 additions & 2 deletions meteor/app/client/attackers.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ if (Meteor.isClient) {
},
"change #attackerLimit": function(e,t){
Session.set('attackerlimit', $('#attackerLimit').val());
debugLog('should change dep' + Session.get('attackerlimit'));
},
"mousedown": function(event,template){
//if mouse is over a character
Expand Down Expand Up @@ -534,7 +533,8 @@ if (Meteor.isClient) {
.group(categoryDim.group())
.label(function(d) {return d.key; })
.innerRadius(30)
.expireCache();
.expireCache()
.on('filtered',filterCharacters);
ringChartLastSeen
.width(150).height(150)
.dimension(agoDim)
Expand Down
15 changes: 10 additions & 5 deletions meteor/app/lib/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,22 +179,27 @@ if (Meteor.isServer) {
//the only rule is that the incident creator is the only one who can delete an incident.
incidents.allow({
insert: function (userId, doc) {
// the user must be logged in to create an incident
// the user must be logged in
return (userId);
},
update: function (userId, doc, fields, modifier) {
// the user must be logged in to create an incident
// the user must be logged in
return (userId);
},
remove: function (userId, doc) {
// can only remove one's own indicents
return doc.creator === Meteor.user().profile.email;
},
fetch: ['creator']
});


});

attackers.allow({
update: function (userId, doc, fields, modifier) {
// the user must be logged in
return (userId);
}
});

};

if (Meteor.isClient) {
Expand Down

0 comments on commit 99444d6

Please sign in to comment.